Add a set_named_icon method
This commit is contained in:
parent
0ebba0d454
commit
b476b13673
@ -1,5 +1,6 @@
|
|||||||
gtk-theme-name = "sugar"
|
gtk-theme-name = "sugar"
|
||||||
gtk-icon-theme-name = "sugar"
|
gtk-icon-theme-name = "sugar"
|
||||||
gtk-font-name = "Sans Serif 11"
|
gtk-font-name = "Sans Serif 10"
|
||||||
gtk-cursor-theme-name = "sugar"
|
gtk-cursor-theme-name = "sugar"
|
||||||
gtk-toolbar-style = GTK_TOOLBAR_ICONS
|
gtk-toolbar-style = GTK_TOOLBAR_ICONS
|
||||||
|
gtk-icon-sizes = "gtk-large-toolbar=32,32"
|
||||||
|
@ -22,7 +22,9 @@ from sugar.graphics.icon import Icon
|
|||||||
class ToggleToolButton(gtk.ToggleToolButton):
|
class ToggleToolButton(gtk.ToggleToolButton):
|
||||||
def __init__(self, named_icon=None):
|
def __init__(self, named_icon=None):
|
||||||
gtk.ToggleToolButton.__init__(self)
|
gtk.ToggleToolButton.__init__(self)
|
||||||
|
self.set_named_icon(named_icon)
|
||||||
|
|
||||||
|
def set_named_icon(self, named_icon)
|
||||||
icon = Icon(named_icon)
|
icon = Icon(named_icon)
|
||||||
self.set_icon_widget(icon)
|
self.set_icon_widget(icon)
|
||||||
icon.show()
|
icon.show()
|
||||||
|
@ -22,7 +22,9 @@ from sugar.graphics.icon import Icon
|
|||||||
class ToolButton(gtk.ToolButton):
|
class ToolButton(gtk.ToolButton):
|
||||||
def __init__(self, named_icon=None):
|
def __init__(self, named_icon=None):
|
||||||
gtk.ToolButton.__init__(self)
|
gtk.ToolButton.__init__(self)
|
||||||
|
self.set_named_icon(named_icon)
|
||||||
|
|
||||||
|
def set_named_icon(self, named_icon):
|
||||||
icon = Icon(named_icon)
|
icon = Icon(named_icon)
|
||||||
self.set_icon_widget(icon)
|
self.set_icon_widget(icon)
|
||||||
icon.show()
|
icon.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user