Auto-convert gtk.Button from .ui files (Touch UI)
Convert all gtk.Button widgets loaded from .ui files to finger-friendly widget if enable_fingerscroll is True.
This commit is contained in:
parent
5cf3f87d12
commit
d7100371f9
|
@ -162,6 +162,9 @@ class GtkBuilderWidget(object):
|
||||||
def _handle_menu_bar(self, menu):
|
def _handle_menu_bar(self, menu):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def _handle_button(self, button):
|
||||||
|
pass
|
||||||
|
|
||||||
def set_attributes(self):
|
def set_attributes(self):
|
||||||
"""
|
"""
|
||||||
Convert widget names to attributes of this object.
|
Convert widget names to attributes of this object.
|
||||||
|
@ -180,6 +183,9 @@ class GtkBuilderWidget(object):
|
||||||
if isinstance(widget, gtk.MenuBar):
|
if isinstance(widget, gtk.MenuBar):
|
||||||
self._handle_menu_bar(widget)
|
self._handle_menu_bar(widget)
|
||||||
|
|
||||||
|
if isinstance(widget, gtk.Button):
|
||||||
|
self._handle_button(widget)
|
||||||
|
|
||||||
# The following call looks ugly, but see Gnome bug 591085
|
# The following call looks ugly, but see Gnome bug 591085
|
||||||
widget_name = gtk.Buildable.get_name(widget)
|
widget_name = gtk.Buildable.get_name(widget)
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,10 @@ class BuilderWidget(GtkBuilderWidget):
|
||||||
for child in menu_bar.get_children():
|
for child in menu_bar.get_children():
|
||||||
self.set_finger_friendly(child)
|
self.set_finger_friendly(child)
|
||||||
|
|
||||||
|
|
||||||
|
def _handle_button(self, button):
|
||||||
|
self.set_finger_friendly(button)
|
||||||
|
|
||||||
def on_window_orientation_changed(self, orientation):
|
def on_window_orientation_changed(self, orientation):
|
||||||
"""Override this method to relayout a window for portrait mode."""
|
"""Override this method to relayout a window for portrait mode."""
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue