8468: GuiColorOption missing avail-changed event handler
This commit is contained in:
parent
8374e87b4d
commit
39f06eb4b0
@ -241,6 +241,9 @@ class GuiColorOption(Gtk.ColorButton):
|
||||
self.changekey = self.connect('color-set', self.__color_changed)
|
||||
self.valuekey = self.__option.connect('value-changed', self.__value_changed)
|
||||
|
||||
self.conkey = self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
def __color_changed(self, obj): # IGNORE:W0613 - obj is unused
|
||||
@ -257,6 +260,13 @@ class GuiColorOption(Gtk.ColorButton):
|
||||
self.__option.set_value(value)
|
||||
self.__option.enable_signals()
|
||||
|
||||
def __update_avail(self):
|
||||
"""
|
||||
Update the availability (sensitivity) of this widget.
|
||||
"""
|
||||
avail = self.__option.get_available()
|
||||
self.set_sensitive(avail)
|
||||
|
||||
def __value_changed(self):
|
||||
"""
|
||||
Handle the change made programmatically
|
||||
@ -270,6 +280,7 @@ class GuiColorOption(Gtk.ColorButton):
|
||||
remove stuff that blocks garbage collection
|
||||
"""
|
||||
self.__option.disconnect(self.valuekey)
|
||||
self.__option.disconnect(self.conkey)
|
||||
self.__option = None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user