Skip to content

Commit

Permalink
Merge pull request #113 from TechCrafterGaming/PR-003
Browse files Browse the repository at this point in the history
minor bug fixes to Tag Search Box
  • Loading branch information
CyanVoxel committed May 4, 2024
2 parents fd622ea + b834166 commit 164aba1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tagstudio/src/qt/modals/tag_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def __init__(self, library):

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

# def reset(self):
# self.search_field.setText('')
Expand All @@ -80,12 +79,12 @@ def on_return(self, text:str):
# callback(self.first_tag_id)
self.tag_chosen.emit(self.first_tag_id)
self.search_field.setText('')
self.update_tags('')
self.update_tags()
else:
self.search_field.setFocus()
self.parentWidget().hide()

def update_tags(self, query:str):
def update_tags(self, query:str =''):
# for c in self.scroll_layout.children():
# c.widget().deleteLater()
while self.scroll_layout.count():
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/qt/widgets/tag_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, item, title, field_index, library:Library, tags:list[int], dr
tsp = TagSearchPanel(self.lib)
tsp.tag_chosen.connect(lambda x: self.add_tag_callback(x))
self.add_modal = PanelModal(tsp, title, 'Add Tags')
self.add_button.clicked.connect(self.add_modal.show)
self.add_button.clicked.connect(lambda: (tsp.update_tags() ,self.add_modal.show()))

self.set_tags(tags)
# self.add_button.setHidden(True)
Expand Down

0 comments on commit 164aba1

Please sign in to comment.