mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-07-20 12:36:19 +02:00
fix(ui): update tag search bar when entry tags are updated
This commit is contained in:
@@ -77,7 +77,7 @@ class PreviewPanel(QWidget):
|
||||
self._layout.add_tag_button.clicked.connect(lambda: self._set_item_mode(_ItemMode.TAG))
|
||||
self._open_tag_search_action.activated.connect(self._open_tag_search_callback)
|
||||
self._layout.tag_search_box.done.connect(self._tag_added_callback)
|
||||
self._layout.tag_search_box.items_updated.connect(self._update_added_callback)
|
||||
self._layout.containers.on_tags_update.connect(self._update_added_callback)
|
||||
|
||||
# Field Search
|
||||
self._layout.add_field_button.clicked.connect(lambda: self._set_item_mode(_ItemMode.FIELD))
|
||||
|
||||
@@ -44,7 +44,6 @@ def _item_name(item: object) -> str:
|
||||
class SuggestBox[T](QWidget):
|
||||
item_chosen = Signal(object)
|
||||
done = Signal()
|
||||
items_updated = Signal()
|
||||
|
||||
def __init__(self, driver: "QtDriver", view: SuggestBoxView) -> None:
|
||||
super().__init__()
|
||||
@@ -190,7 +189,6 @@ class SuggestBox[T](QWidget):
|
||||
raise NotImplementedError()
|
||||
|
||||
def _editing_finished_callback(self):
|
||||
self.items_updated.emit()
|
||||
if self._layout.search_field.text() == "":
|
||||
self.done.emit()
|
||||
self.hide_and_reset()
|
||||
|
||||
@@ -9,7 +9,7 @@ from functools import partial
|
||||
from warnings import catch_warnings
|
||||
|
||||
import structlog
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtCore import Qt, Signal
|
||||
from PySide6.QtWidgets import (
|
||||
QFrame,
|
||||
QHBoxLayout,
|
||||
@@ -47,6 +47,8 @@ logger = structlog.get_logger(__name__)
|
||||
class FieldContainers(QWidget):
|
||||
"""Widget for the tag and field containers displayed inside the Preview Panel."""
|
||||
|
||||
on_tags_update = Signal()
|
||||
|
||||
def __init__(self, library: Library, driver: "QtDriver") -> None:
|
||||
super().__init__()
|
||||
|
||||
@@ -421,7 +423,10 @@ class FieldContainers(QWidget):
|
||||
inner_widget.set_tags(tags)
|
||||
|
||||
inner_widget.on_update.connect(
|
||||
lambda: self.update_from_entry(self.cached_entries[0].id, update_badges=True)
|
||||
lambda: (
|
||||
self.update_from_entry(self.cached_entries[0].id, update_badges=True),
|
||||
self.on_tags_update.emit(),
|
||||
)
|
||||
)
|
||||
else:
|
||||
text = f"<i>{Translations['field.mixed_data']}</i>"
|
||||
|
||||
Reference in New Issue
Block a user