diff options
Diffstat (limited to 'toolbar.py')
-rw-r--r-- | toolbar.py | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -12,29 +12,29 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -from gi.repository import Gtk -from gi.repository import GObject +import gtk +import gobject -from sugar3.graphics.icon import Icon -import sugar3.graphics.style as style +from sugar.graphics.icon import Icon +import sugar.graphics.style as style -class WidgetItem(Gtk.ToolItem): +class WidgetItem(gtk.ToolItem): def __init__(self, widget): - GObject.GObject.__init__(self) + gtk.ToolItem.__init__(self) self.add(widget) widget.show() -class ButtonItem(Gtk.ToolButton): - def __init__(self, icon_name, size=Gtk.IconSize.SMALL_TOOLBAR, **kwargs): - GObject.GObject.__init__(self, **kwargs) +class ButtonItem(gtk.ToolButton): + def __init__(self, icon_name, size=gtk.ICON_SIZE_SMALL_TOOLBAR, **kwargs): + gobject.GObject.__init__(self, **kwargs) icon = Icon(icon_name=icon_name, icon_size=size) - # The alignment is a hack to work around Gtk.ToolButton code - # that sets the icon_size when the icon_widget is a Gtk.Image - alignment = Gtk.Alignment.new(0.5, 0.5) + # The alignment is a hack to work around gtk.ToolButton code + # that sets the icon_size when the icon_widget is a gtk.Image + alignment = gtk.Alignment(0.5, 0.5) alignment.add(icon) self.set_icon_widget(alignment) - if size == Gtk.IconSize.SMALL_TOOLBAR: + if size == gtk.ICON_SIZE_SMALL_TOOLBAR: button_size = style.SMALL_ICON_SIZE + 8 self.set_size_request(button_size, button_size) |