fix: autoscroll now works if the entry is at the very bottom of the scroll

the delay is needed because the osk will change the scrolledwindow adjustment, and it's only possible to scroll down more after the keyboard has been shown
This commit is contained in:
Alfredo Monclus
2024-09-19 10:16:49 -03:00
parent 5d806a82da
commit 7b857ff991

View File

@@ -103,12 +103,15 @@ class Panel(ScreenPanel):
for param in self.macros[macro]["params"]:
labels.add(Gtk.Label(param))
self.macros[macro]["params"][param].connect("focus-in-event", self._screen.show_keyboard)
self.macros[macro]["params"][param].connect("focus-in-event", self.scroll_to_entry)
self.macros[macro]["params"][param].connect("focus-in-event", self.show_keyboard)
self.macros[macro]["params"][param].connect("focus-out-event", self._screen.remove_keyboard)
labels.add(self.macros[macro]["params"][param])
def scroll_to_entry(self, entry, event):
def show_keyboard(self, entry, event):
self._screen.show_keyboard(entry, event)
GLib.timeout_add(100, self.scroll_to_entry, entry)
def scroll_to_entry(self, entry):
self.labels['macros_list'].get_vadjustment().set_value(
entry.get_allocation().y - 50
)