From 5b58900d8fa34973f79c571fab6d15dcb9740b82 Mon Sep 17 00:00:00 2001 From: cosven Date: Sat, 30 Nov 2024 16:08:57 +0800 Subject: [PATCH] clean code --- feeluown/gui/components/menu.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/feeluown/gui/components/menu.py b/feeluown/gui/components/menu.py index 4ce972abd..db7e26b44 100644 --- a/feeluown/gui/components/menu.py +++ b/feeluown/gui/components/menu.py @@ -1,7 +1,7 @@ import logging from typing import Optional, TYPE_CHECKING -from PyQt5.QtCore import Qt, QPoint +from PyQt5.QtCore import Qt from feeluown.excs import ProviderIOError from feeluown.utils.aio import run_fn, run_afn @@ -75,6 +75,7 @@ async def goto_song_album(song): def show_similar_resource(self, song): from feeluown.gui.components.search import SearchResultView + # TODO: add a close button, and rename it to ClosableSearchResultView class SearchResultViewWithEsc(SearchResultView): def keyPressEvent(self, event): if event.key() == Qt.Key_Escape: @@ -100,10 +101,7 @@ def keyPressEvent(self, event): x = self._app.ui.sidebar.width() y = self._app.height() - height - self._app.ui.player_bar.height() - # Set the size using resize() and position using move() - view.resize(width, height) - pos = self._app.mapToGlobal(QPoint(0, 0)) - view.move(pos.x() + x, pos.y() + y) + view.setGeometry(x, y, width, height) view.show() view.raise_()