From 00452cca5f0762916bfa9e6aaaf6b596ad8f4614 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sat, 13 Jan 2024 06:39:22 +0900 Subject: [PATCH] chore: focus in signals --- dzgui.sh | 4 ++-- helpers/ui.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index 3abf8cb..0a17188 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.0.0.rc-5 +version=5.0.0.rc-6 #CONSTANTS aid=221100 @@ -528,7 +528,7 @@ fetch_dzq(){ fetch_helpers_by_sum(){ declare -A sums sums=( - ["ui.py"]="9cef55ccaa1c71b7e3ef648fe68d0eec" + ["ui.py"]="a6d80a2cfff27e7c02e16499a0983f8e" ["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" ["funcs"]="d9b0e6fa68314c18ac7aad565645948f" diff --git a/helpers/ui.py b/helpers/ui.py index f79c4a1..eaefb8f 100644 --- a/helpers/ui.py +++ b/helpers/ui.py @@ -1487,7 +1487,6 @@ class App(Gtk.Application): self.win = OuterWindow() self.win.fullscreen() - #self.win.set_keep_below(True) accel = Gtk.AccelGroup() accel.connect(Gdk.KEY_q, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE, self._halt_window_subprocess) @@ -1525,6 +1524,8 @@ class FilterPanel(Gtk.Box): self.keyword_entry.set_placeholder_text("Filter by keyword") self.keyword_entry.connect("activate", self._on_keyword_enter) self.keyword_entry.connect("key-press-event", self._on_esc_pressed) + self.keyword_entry.connect("focus-in-event", self._on_keyword_focused) + self.keyword_entry.connect("focus-out-event", self._on_keyword_unfocused) renderer_text = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END) self.maps_combo = Gtk.ComboBox.new_with_model(map_store) @@ -1546,6 +1547,16 @@ class FilterPanel(Gtk.Box): self.pack_start(self.debug_toggle, False, False, 0) + def _on_keyword_unfocused(self, widget): + print("user unfocused keyword field") + win = self.get_outer_window() + win.set_keep_below(False) + + def _on_keyword_focused(self, widget): + print("user focused keyword field") + win = self.get_outer_window() + win.set_keep_below(True) + def _on_button_toggled(self, button, command): transient_parent = self.get_outer_window() grid = self.get_outer_grid() @@ -1577,6 +1588,8 @@ class FilterPanel(Gtk.Box): return outer_window def _on_keyword_enter(self, keyword_entry): + win = self.get_outer_window() + win.set_keep_below(False) keyword = keyword_entry.get_text() old_keyword = keyword_filter[0].split(delimiter)[1] if keyword == old_keyword: