Skip to content

Commit

Permalink
feat(ui): use tag query as default new tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanVoxel committed Jan 6, 2025
1 parent bf03e28 commit 29c0dfd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tagstudio/src/qt/modals/tag_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,23 @@ def __init__(self, library: Library):

self.create_tag_button = QPushButton()
Translations.translate_qobject(self.create_tag_button, "tag.create")
self.create_tag_button.clicked.connect(self.build_tag)
self.create_tag_button.clicked.connect(lambda: self.build_tag(self.search_field.text()))

self.root_layout.addWidget(self.search_field)
self.root_layout.addWidget(self.scroll_area)
self.root_layout.addWidget(self.create_tag_button)
self.update_tags()

def build_tag(self):
def build_tag(self, name: str):
panel = BuildTagPanel(self.lib)
self.modal = PanelModal(
panel,
has_save=True,
)
Translations.translate_with_setter(self.modal.setTitle, "tag.new")
Translations.translate_with_setter(self.modal.setWindowTitle, "tag.add")
if name.strip():
panel.name_field.setText(name)

self.modal.saved.connect(
lambda: (
Expand Down

0 comments on commit 29c0dfd

Please sign in to comment.