Skip to content

Commit

Permalink
fix(desktop_lyrics): Select the lyrics interface and automatically re…
Browse files Browse the repository at this point in the history
…-search after selecting the lyrics
  • Loading branch information
chenmozhijin committed Dec 14, 2024
1 parent e961f57 commit c6bbea2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion LDDC/view/desktop_lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self, parent: QWidget | None = None) -> None:
self.setWindowIcon(QIcon(":/LDDC/img/icon/logo.png"))

self.path = ""
self.last_keywords = "" # 上次搜索的关键词
self.select_lyrics_button.clicked.connect(self.select_lyrics)
self.open_local_lyrics_button.clicked.connect(self.open_local_lyrics)

Expand Down Expand Up @@ -161,7 +162,8 @@ def show(self, infos: dict | None = None) -> None:
offset = infos.get("offset")
if isinstance(offset, int):
self.offset_spinBox.setValue(offset)
if keyword:
if keyword and keyword != self.last_keywords:
self.last_keywords = keyword
self.source_comboBox.setCurrentIndex(0)
self.search_type_comboBox.setCurrentIndex(0)
self.search_keyword_lineEdit.setText(keyword)
Expand Down

0 comments on commit c6bbea2

Please sign in to comment.