Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Mouse scroll direction option from Pedigree view #1766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions gramps/plugins/view/pedigreeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ def __init__(self, pdata, dbstate, uistate, nav_group=0):
self.show_tag_color = self._config.get("interface.pedview-show-tags")
# Tree draw direction
self.tree_direction = self._config.get("interface.pedview-tree-direction")
self.cb_change_scroll_direction(None, self.tree_direction < 2)
# Show on not unknown people.
# Default - not show, for mo fast display hight tree
self.show_unknown_people = self._config.get(
Expand Down Expand Up @@ -657,8 +656,6 @@ def build_widget(self):
self.scrolledwindow.set_policy(
Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC
)
self.scrolledwindow.add_events(Gdk.EventMask.SCROLL_MASK)
self.scrolledwindow.connect("scroll-event", self.cb_bg_scroll_event)
event_box = Gtk.EventBox()
# Required for drag-scroll events and popup menu
event_box.add_events(
Expand Down Expand Up @@ -1440,13 +1437,6 @@ def rebuild(self, table_widget, positions, lst, size):
vadjustment, (vadjustment.get_upper() - vadjustment.get_page_size()) / 2
)

# Setup mouse wheel scroll direction for style C,
# depending of tree direction
if self.tree_direction in [0, 1]:
self.cb_change_scroll_direction(None, True)
elif self.tree_direction in [2, 3]:
self.cb_change_scroll_direction(None, False)

def attach_widget(self, table, widget, xmax, right, left, top, bottom):
"""
Attach a widget to the table.
Expand Down Expand Up @@ -1603,18 +1593,6 @@ def update_scrollbar_positions(self, adjustment, value):
adjustment.set_value(value)
return True

def cb_bg_scroll_event(self, widget, event):
"""
Function change scroll direction to horizontally
if variable self.scroll_direction setup.
"""
if self.scroll_direction and event.type == Gdk.EventType.SCROLL:
if event.direction == Gdk.ScrollDirection.UP:
event.direction = Gdk.ScrollDirection.LEFT
elif event.direction == Gdk.ScrollDirection.DOWN:
event.direction = Gdk.ScrollDirection.RIGHT
return False

def cb_person_button_press(self, obj, event, person_handle, family_handle):
"""
Call edit person function for mouse left button double click on person
Expand Down Expand Up @@ -1703,13 +1681,6 @@ def cb_childmenu_changed(self, obj, person_handle):
self.change_active(person_handle)
return True

def cb_change_scroll_direction(self, menuitem, data):
"""Change scroll_direction option."""
if data:
self.scroll_direction = True
else:
self.scroll_direction = False

def kb_goto_home(self, *obj):
"""Goto home person from keyboard."""
self.cb_home(None)
Expand Down Expand Up @@ -1799,34 +1770,6 @@ def add_settings_to_menu(self, menu):
item.show()
menu.append(item)

# Mouse scroll direction setting.
item = Gtk.MenuItem(label=_("Mouse scroll direction"))
item.set_submenu(Gtk.Menu())
scroll_direction_menu = item.get_submenu()

entry = Gtk.RadioMenuItem(label=_("Top <-> Bottom"))
entry.connect("activate", self.cb_change_scroll_direction, False)
if self.scroll_direction == False:
entry.set_active(True)
entry.show()
scroll_direction_menu.append(entry)

entry = Gtk.RadioMenuItem(label=_("Left <-> Right"))
entry.connect("activate", self.cb_change_scroll_direction, True)
if self.scroll_direction == True:
entry.set_active(True)
entry.show()
scroll_direction_menu.append(entry)

scroll_direction_menu.show()
item.show()
menu.append(item)

# Separator.
item = Gtk.SeparatorMenuItem()
item.show()
menu.append(item)

# Help menu entry
item = Gtk.MenuItem(label=_("About Pedigree View"))
item.connect("activate", self.on_help_clicked)
Expand Down