better UX for using fulltext search"
This commit is contained in:
parent
b55b105e05
commit
f7a7d1e43d
@ -18,12 +18,20 @@ class SearchLineEdit(QLineEdit):
|
||||
super().__init__(parent)
|
||||
self.setVisible(False)
|
||||
|
||||
def toggle_visibility(self):
|
||||
def toggle_visibility(self) -> bool:
|
||||
"""
|
||||
Returns true if visible
|
||||
false if hidden
|
||||
|
||||
This is used to bring focus back to the music table after toggling visibility
|
||||
"""
|
||||
if self.isHidden():
|
||||
self.setHidden(False)
|
||||
return True
|
||||
else:
|
||||
self.setHidden(True)
|
||||
self.setText(None)
|
||||
return False
|
||||
|
||||
# def toggle_visibility(self):
|
||||
# if self.is_hidden:
|
||||
|
||||
6
main.py
6
main.py
@ -491,7 +491,11 @@ class ApplicationWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def handle_search_box(self):
|
||||
"""show or hide the searchbox"""
|
||||
self.lineEditSearch.toggle_visibility()
|
||||
visible = self.lineEditSearch.toggle_visibility()
|
||||
if visible:
|
||||
self.lineEditSearch.setFocus()
|
||||
else:
|
||||
self.tableView.setFocus()
|
||||
|
||||
def handle_search_box_text(self, text: str):
|
||||
"""when text changes, update the music table thingie"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user