feat: connect search icon to activate signal

This commit is contained in:
aclist 2026-02-12 19:20:23 +09:00
parent e1d84ec7be
commit cf754ee286
2 changed files with 13 additions and 4 deletions

View File

@ -614,10 +614,11 @@ class Controller(GObject.GObject):
def cleanup(self) -> None:
treeview = self.get_active_treeview()
# TODO: signals or other approach to deferring model insertion
# after thread closes
# TODO: signals or other approach to deferring map
# model insertion after thread closes
# cf. servers_loaded signal
treeview.set_model(self.to_insert)
# CHORE: this is placeholder logic
if self.first_iteration:
self.mediator.filters.set_unique_maps(self.new_maps)

View File

@ -91,8 +91,10 @@ class FilterPanel(Gtk.Box):
self.keyword_entry.set_icon_from_icon_name(
Gtk.EntryIconPosition.SECONDARY, SEARCH_ICON
)
self.keyword_entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, False)
# entry.connect("icon-release", self._on_icon_release)
self.keyword_entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, True)
self.keyword_entry.connect(
"icon-release", lambda *args: self.keyword_entry.activate()
)
self.emitter.connect(
"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:
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:
if maps is None:
return