mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
feat: connect search icon to activate signal
This commit is contained in:
1 parent
e1d84ec7be
commit
cf754ee286
2 files changed
+13
-4
No files matched your search
@@ -614,10 +614,11 @@ class Controller(GObject.GObject):
|
|||||||
def cleanup(self) -> None:
|
def cleanup(self) -> None:
|
||||||
treeview = self.get_active_treeview()
|
treeview = self.get_active_treeview()
|
||||||
|
|
||||||
# TODO: signals or other approach to deferring model insertion
|
# TODO: signals or other approach to deferring map
|
||||||
# after thread closes
|
# model insertion after thread closes
|
||||||
# cf. servers_loaded signal
|
# cf. servers_loaded signal
|
||||||
treeview.set_model(self.to_insert)
|
treeview.set_model(self.to_insert)
|
||||||
|
|
||||||
# CHORE: this is placeholder logic
|
# CHORE: this is placeholder logic
|
||||||
if self.first_iteration:
|
if self.first_iteration:
|
||||||
self.mediator.filters.set_unique_maps(self.new_maps)
|
self.mediator.filters.set_unique_maps(self.new_maps)
|
||||||
|
|||||||
@@ -91,8 +91,10 @@ class FilterPanel(Gtk.Box):
|
|||||||
self.keyword_entry.set_icon_from_icon_name(
|
self.keyword_entry.set_icon_from_icon_name(
|
||||||
Gtk.EntryIconPosition.SECONDARY, SEARCH_ICON
|
Gtk.EntryIconPosition.SECONDARY, SEARCH_ICON
|
||||||
)
|
)
|
||||||
self.keyword_entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, False)
|
self.keyword_entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, True)
|
||||||
# entry.connect("icon-release", self._on_icon_release)
|
self.keyword_entry.connect(
|
||||||
|
"icon-release", lambda *args: self.keyword_entry.activate()
|
||||||
|
)
|
||||||
|
|
||||||
self.emitter.connect(
|
self.emitter.connect(
|
||||||
"request_keyword_focus", lambda _: self.keyword_entry.grab_focus()
|
"request_keyword_focus", lambda _: self.keyword_entry.grab_focus()
|
||||||
@@ -126,6 +128,12 @@ class FilterPanel(Gtk.Box):
|
|||||||
for el in self.filters_label, self.keyword_entry, self.maps_combo, button_grid:
|
for el in self.filters_label, self.keyword_entry, self.maps_combo, button_grid:
|
||||||
self.pack_start(el, NO_EXPAND, NO_FILL, NO_PADDING)
|
self.pack_start(el, NO_EXPAND, NO_FILL, NO_PADDING)
|
||||||
|
|
||||||
|
# def _on_icon_release(self, widget: Gtk.Entry, icon_pos: Gtk ^ a, b) -> None:
|
||||||
|
# print(a)
|
||||||
|
# print(b)
|
||||||
|
# print(icon)
|
||||||
|
# self.keyword_entry.activate()
|
||||||
|
|
||||||
def set_unique_maps(self, maps: list) -> None:
|
def set_unique_maps(self, maps: list) -> None:
|
||||||
if maps is None:
|
if maps is None:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in new issue
Block a user