plug-ins/common/gimpfu.py Add a palette selector (bug #155325). Patch by
2004-11-16 Manish Singh <yosh@gimp.org> * plug-ins/common/gimpfu.py * plug-ins/common/gimpui.py: Add a palette selector (bug #155325). Patch by Joao S. O. Bueno.
This commit is contained in:
committed by
Manish Singh
parent
f499a2aacd
commit
007d7549b4
@ -1,3 +1,9 @@
|
||||
2004-11-16 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* plug-ins/common/gimpfu.py
|
||||
* plug-ins/common/gimpui.py: Add a palette selector (bug #155325).
|
||||
Patch by Joao S. O. Bueno.
|
||||
|
||||
2004-11-16 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* plug-ins/common/gimpfu.py: Fix -fu slider behavior (bug #155103).
|
||||
|
||||
@ -91,6 +91,7 @@ PF_PATTERN = 1006
|
||||
PF_GRADIENT = 1007
|
||||
PF_RADIO = 1008
|
||||
PF_TEXT = 1009
|
||||
PF_PALETTE = 1010
|
||||
|
||||
_type_mapping = {
|
||||
PF_INT8 : PDB_INT8,
|
||||
@ -121,6 +122,7 @@ _type_mapping = {
|
||||
PF_GRADIENT : PDB_STRING,
|
||||
PF_RADIO : PDB_STRING,
|
||||
PF_TEXT : PDB_STRING,
|
||||
PF_PALETTE : PDB_STRING,
|
||||
}
|
||||
|
||||
_registered_plugins_ = {}
|
||||
@ -391,6 +393,7 @@ def _interact(func_name, start_params):
|
||||
PF_BRUSH : gimpui.BrushSelector,
|
||||
PF_PATTERN : gimpui.PatternSelector,
|
||||
PF_GRADIENT : gimpui.GradientSelector,
|
||||
PF_PALETTE : gimpui.PaletteSelector,
|
||||
PF_TEXT : TextEntry
|
||||
}
|
||||
|
||||
|
||||
@ -279,6 +279,18 @@ class GradientSelector(_Selector):
|
||||
num, gradients = gimp.pdb.gimp_gradients_get_list(None)
|
||||
return gradients
|
||||
|
||||
class PaletteSelector(_Selector):
|
||||
def __init__(self, default=""):
|
||||
self.default = default
|
||||
_Selector.__init__(self)
|
||||
def get_default(self):
|
||||
return self.default
|
||||
def get_title(self):
|
||||
return "Palettes"
|
||||
def get_list(self):
|
||||
num, palettes = gimp.pdb.gimp_palettes_get_list("")
|
||||
return palettes
|
||||
|
||||
class FontSelector(gtk.HBox):
|
||||
def __init__(self, default="Sans"):
|
||||
gtk.HBox.__init__(self, gtk.FALSE, 5)
|
||||
|
||||
Reference in New Issue
Block a user