Remove redundant code since Gtk 3.24 required
This commit is contained in:
parent
c3a0b330cc
commit
53bfeb66ca
@ -298,12 +298,7 @@ class EditPrimary(ManagedWindow, DbGUIElement, metaclass=abc.ABCMeta):
|
|||||||
menu = Gtk.Menu.new_from_model(menu_model)
|
menu = Gtk.Menu.new_from_model(menu_model)
|
||||||
menu.attach_to_widget(obj, None)
|
menu.attach_to_widget(obj, None)
|
||||||
menu.show_all()
|
menu.show_all()
|
||||||
if Gtk.MINOR_VERSION < 22:
|
menu.popup_at_pointer(event)
|
||||||
# ToDo The following is reported to work poorly with Wayland
|
|
||||||
menu.popup(None, None, None, None,
|
|
||||||
event.button, event.time)
|
|
||||||
else:
|
|
||||||
menu.popup_at_pointer(event)
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -35,10 +35,7 @@ _RETURN = Gdk.keyval_from_name("Return")
|
|||||||
_KP_ENTER = Gdk.keyval_from_name("KP_Enter")
|
_KP_ENTER = Gdk.keyval_from_name("KP_Enter")
|
||||||
|
|
||||||
class SidebarFilter(DbGUIElement):
|
class SidebarFilter(DbGUIElement):
|
||||||
if Gtk.get_minor_version() > 17:
|
_FILTER_WIDTH = -1
|
||||||
_FILTER_WIDTH = -1
|
|
||||||
else:
|
|
||||||
_FILTER_WIDTH = 20
|
|
||||||
_FILTER_ELLIPSIZE = Pango.EllipsizeMode.END
|
_FILTER_ELLIPSIZE = Pango.EllipsizeMode.END
|
||||||
|
|
||||||
def __init__(self, dbstate, uistate, namespace):
|
def __init__(self, dbstate, uistate, namespace):
|
||||||
|
@ -574,15 +574,7 @@ def get_link_color(context):
|
|||||||
"""
|
"""
|
||||||
Find the link color for the current theme.
|
Find the link color for the current theme.
|
||||||
"""
|
"""
|
||||||
from gi.repository import Gtk
|
col = context.get_color(Gtk.StateFlags.LINK)
|
||||||
|
|
||||||
if Gtk.get_minor_version() > 11:
|
|
||||||
col = context.get_color(Gtk.StateFlags.LINK)
|
|
||||||
else:
|
|
||||||
found, col = context.lookup_color('link_color')
|
|
||||||
if not found:
|
|
||||||
col.parse('blue')
|
|
||||||
|
|
||||||
return rgb_to_hex((col.red, col.green, col.blue))
|
return rgb_to_hex((col.red, col.green, col.blue))
|
||||||
|
|
||||||
|
|
||||||
|
@ -1000,12 +1000,7 @@ class ListView(NavigationView):
|
|||||||
popup_menu = Gtk.Menu.new_from_model(menu)
|
popup_menu = Gtk.Menu.new_from_model(menu)
|
||||||
popup_menu.attach_to_widget(obj, None)
|
popup_menu.attach_to_widget(obj, None)
|
||||||
popup_menu.show_all()
|
popup_menu.show_all()
|
||||||
if Gtk.MINOR_VERSION < 22:
|
popup_menu.popup_at_pointer(event)
|
||||||
# ToDo The following is reported to work poorly with Wayland
|
|
||||||
popup_menu.popup(None, None, None, None,
|
|
||||||
event.button, event.time)
|
|
||||||
else:
|
|
||||||
popup_menu.popup_at_pointer(event)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -276,12 +276,8 @@ class Tags(DbGUIElement):
|
|||||||
popup_menu = Gtk.Menu.new_from_model(menu)
|
popup_menu = Gtk.Menu.new_from_model(menu)
|
||||||
popup_menu.attach_to_widget(button, None)
|
popup_menu.attach_to_widget(button, None)
|
||||||
popup_menu.show_all()
|
popup_menu.show_all()
|
||||||
if Gtk.MINOR_VERSION < 22:
|
popup_menu.popup_at_widget(button, Gdk.Gravity.SOUTH,
|
||||||
# ToDo The following is reported to work poorly with Wayland
|
Gdk.Gravity.NORTH_WEST, None)
|
||||||
popup_menu.popup(None, None, cb_menu_position, button, 0, 0)
|
|
||||||
else:
|
|
||||||
popup_menu.popup_at_widget(button, Gdk.Gravity.SOUTH,
|
|
||||||
Gdk.Gravity.NORTH_WEST, None)
|
|
||||||
|
|
||||||
def cb_organize_tags(self, *action):
|
def cb_organize_tags(self, *action):
|
||||||
"""
|
"""
|
||||||
|
@ -1510,13 +1510,8 @@ class GrampletPane(Gtk.ScrolledWindow):
|
|||||||
popup_menu = Gtk.Menu.new_from_model(menu)
|
popup_menu = Gtk.Menu.new_from_model(menu)
|
||||||
popup_menu.attach_to_widget(obj, None)
|
popup_menu.attach_to_widget(obj, None)
|
||||||
popup_menu.show_all()
|
popup_menu.show_all()
|
||||||
if Gtk.MINOR_VERSION < 22:
|
popup_menu.popup_at_pointer(event)
|
||||||
# ToDo The following is reported to work poorly with Wayland
|
return True
|
||||||
popup_menu.popup(None, None, None, None,
|
|
||||||
event.button, event.time)
|
|
||||||
else:
|
|
||||||
popup_menu.popup_at_pointer(event)
|
|
||||||
return True
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def set_inactive(self):
|
def set_inactive(self):
|
||||||
|
@ -72,11 +72,7 @@ class ValidatedComboEntry(Gtk.ComboBox):
|
|||||||
self._entry.set_width_chars(width)
|
self._entry.set_width_chars(width)
|
||||||
# <hack description="set the GTK_ENTRY(self._entry)->is_cell_renderer
|
# <hack description="set the GTK_ENTRY(self._entry)->is_cell_renderer
|
||||||
# flag to TRUE in order to tell the entry to fill its allocation.">
|
# flag to TRUE in order to tell the entry to fill its allocation.">
|
||||||
if Gtk.get_minor_version() < 13:
|
dummy_event = Gdk.Event()
|
||||||
dummy_event = Gdk.Event()
|
|
||||||
dummy_event.type = Gdk.EventType.NOTHING
|
|
||||||
else:
|
|
||||||
dummy_event = Gdk.Event()
|
|
||||||
self._entry.start_editing(dummy_event)
|
self._entry.start_editing(dummy_event)
|
||||||
# </hack>
|
# </hack>
|
||||||
self.add(self._entry)
|
self.add(self._entry)
|
||||||
|
@ -873,14 +873,6 @@ class GeoGraphyView(OsmGps, NavigationView):
|
|||||||
Print or save the view that is currently shown
|
Print or save the view that is currently shown
|
||||||
"""
|
"""
|
||||||
dummy_obj = obj
|
dummy_obj = obj
|
||||||
if Gtk.MAJOR_VERSION == 3 and Gtk.MINOR_VERSION < 11:
|
|
||||||
from gramps.gui.dialog import WarningDialog
|
|
||||||
WarningDialog(
|
|
||||||
_("You can't use the print functionality"),
|
|
||||||
_("Your Gtk version is too old."),
|
|
||||||
parent=self.uistate.window)
|
|
||||||
return
|
|
||||||
|
|
||||||
req = self.osm.get_allocation()
|
req = self.osm.get_allocation()
|
||||||
widthpx = req.width
|
widthpx = req.width
|
||||||
heightpx = req.height
|
heightpx = req.height
|
||||||
|
Loading…
Reference in New Issue
Block a user