Skip to content

Commit

Permalink
fix: 修复一些小问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rachpt committed Jun 4, 2022
1 parent 7912b47 commit 000a7ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lanzou/gui/dialogs/login.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import re
# import browser_cookie3
import browser_cookie3
# https://github.com/borisbabic/browser_cookie3/pull/70
from lanzou import browser_cookie3_n as browser_cookie3
# from lanzou import browser_cookie3_n as browser_cookie3
from PyQt6.QtCore import Qt, pyqtSignal, QPropertyAnimation, QRect, QTimer
from PyQt6.QtGui import QIcon, QPixmap
from PyQt6.QtWidgets import (QDialog, QLabel, QLineEdit, QTextEdit, QPushButton, QFormLayout,
Expand Down
7 changes: 4 additions & 3 deletions lanzou/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def create_tray(self):
hide_action.setIcon(self.style().standardIcon(QStyle.StandardPixmap.SP_TitleBarMinButton))
quit_action.setIcon(self.style().standardIcon(QStyle.StandardPixmap.SP_TitleBarCloseButton))
self.tray.activated[QSystemTrayIcon.ActivationReason].connect(self.icon_activated) # 托盘点击事件
tray_menu = QMenu(QApplication.desktop())
tray_menu = QMenu()
# tray_menu = QMenu(QApplication.desktop())
tray_menu.addAction(show_action)
tray_menu.addAction(hide_action)
tray_menu.addAction(quit_action)
Expand All @@ -93,7 +94,7 @@ def create_tray(self):
self._created_tray = True

def icon_activated(self, reason):
if reason == QSystemTrayIcon.DoubleClick:
if reason == QSystemTrayIcon.ActivationReason.DoubleClick:
tip_title = f"蓝奏云客户端 <{self._user}>" if self._user else "蓝奏云客户端"
if self.isHidden():
self.show()
Expand Down Expand Up @@ -1340,7 +1341,7 @@ def closeEvent(self, event):
self.tray.showMessage(
"已经最小化到托盘",
"双击显示/隐藏窗口,退出请右击",
QSystemTrayIcon.Information,
QSystemTrayIcon.MessageIcon.Information,
3000
)
self._show_to_tray_msg = False # 提示一次
Expand Down

0 comments on commit 000a7ca

Please sign in to comment.