Swipe hack to fix libhandy behaviour

This commit is contained in:
Teemu Ikonen 2020-11-03 17:34:38 +02:00
parent 6f8030ee25
commit 6b62e79f3f
1 changed files with 14 additions and 0 deletions

View File

@ -901,6 +901,9 @@ class gPodder(BuilderWidget, dbus.service.Object):
return True
def init_episode_list_treeview(self):
# connect the swipe hack
self.deck.connect("notify::visible-child", self.on_deck_notify_visible_child)
self.episode_list_model.set_view_mode(self.config.episode_list_view_mode)
self.view_combobox.set_active_id(self.view2id.get(self.config.episode_list_view_mode, 'ALL'))
@ -2452,6 +2455,17 @@ class gPodder(BuilderWidget, dbus.service.Object):
self.deck.navigate(Handy.NavigationDirection.BACK)
return True
def on_deck_notify_visible_child(self, deck, value):
"""HACK: Fix libhandy swipe logic when multipile swipable widgets
are folded on top of each other.
"""
if self.deck.get_visible_child() == self.detailsbox:
self.leaflet.set_can_swipe_back(False)
else:
self.leaflet.set_can_swipe_back(True)
self.treeAvailable.grab_focus()
return True
def update_episode_list_model(self):
if self.channels and self.active_channel is not None:
if self.treeAvailable.get_realized():