2006-05-12 Alex Roitman <shura@gramps-project.org>
* src/GrampsCfg.py (add_color): Update text label after color change. svn: r6638
This commit is contained in:
parent
3bcc0dd4ff
commit
b9cc6e8bf0
@ -1,3 +1,6 @@
|
|||||||
|
2006-05-12 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/GrampsCfg.py (add_color): Update text label after color change.
|
||||||
|
|
||||||
2006-05-12 Don Allingham <don@gramps-project.org>
|
2006-05-12 Don Allingham <don@gramps-project.org>
|
||||||
* src/ViewManager.py: move ScratchPad to Edit
|
* src/ViewManager.py: move ScratchPad to Edit
|
||||||
* src/GrampsCfg.py: fix color dialog buttons
|
* src/GrampsCfg.py: fix color dialog buttons
|
||||||
|
@ -272,21 +272,22 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
|
|||||||
hexval = Config.get(constant)
|
hexval = Config.get(constant)
|
||||||
color = gtk.gdk.color_parse(hexval)
|
color = gtk.gdk.color_parse(hexval)
|
||||||
entry = gtk.ColorButton(color=color)
|
entry = gtk.ColorButton(color=color)
|
||||||
entry.connect('color-set', self.update_color, constant)
|
color_hex_label = BasicLabel(hexval)
|
||||||
|
entry.connect('color-set',self.update_color,constant,color_hex_label)
|
||||||
table.attach(lwidget, 0, 1, index, index+1, yoptions=0,
|
table.attach(lwidget, 0, 1, index, index+1, yoptions=0,
|
||||||
xoptions=gtk.FILL)
|
xoptions=gtk.FILL)
|
||||||
table.attach(entry, 1, 2, index, index+1, yoptions=0, xoptions=0)
|
table.attach(entry, 1, 2, index, index+1, yoptions=0, xoptions=0)
|
||||||
table.attach(BasicLabel(hexval), 2, 3, index, index+1,
|
table.attach(color_hex_label, 2, 3, index, index+1, yoptions=0)
|
||||||
yoptions=0)
|
|
||||||
|
|
||||||
def update_entry(self, obj, constant):
|
def update_entry(self, obj, constant):
|
||||||
Config.set(constant, unicode(obj.get_text()))
|
Config.set(constant, unicode(obj.get_text()))
|
||||||
|
|
||||||
def update_color(self, obj, constant):
|
def update_color(self, obj, constant, color_hex_label):
|
||||||
color = obj.get_color()
|
color = obj.get_color()
|
||||||
hexval = "#%02x%02x%02x" % (color.red/256,
|
hexval = "#%02x%02x%02x" % (color.red/256,
|
||||||
color.green/256,
|
color.green/256,
|
||||||
color.blue/256)
|
color.blue/256)
|
||||||
|
color_hex_label.set_text(hexval)
|
||||||
Config.set(constant, hexval)
|
Config.set(constant, hexval)
|
||||||
|
|
||||||
def update_checkbox(self, obj, constant):
|
def update_checkbox(self, obj, constant):
|
||||||
|
Loading…
Reference in New Issue
Block a user