Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

feat: 保留上次浮窗的位置 #444

Merged
RinLit-233-shiroko merged 5 commits into
Class-Widgets:mainfrom
baiyao105:feat-#443
Feb 15, 2025
Merged

feat: 保留上次浮窗的位置 #444
RinLit-233-shiroko merged 5 commits into
Class-Widgets:mainfrom
baiyao105:feat-#443

Conversation

@baiyao105

@baiyao105 baiyao105 commented Feb 15, 2025

Copy link
Copy Markdown
Member

feat: #443

clone #443

修改:

  • main.py

    • 移除对全局变量的依赖,直接通过 PyQt5 的 API 获取屏幕宽度
      • 先调用 self.init_ui() 初始化窗口,再计算 self.width()
    • __init__中加载位置,mouseReleaseEvent保存位置,FloatingWidget类配置读写方法

修改后流程

1.初始化窗口
2.获取屏幕尺寸
3.计算默认位置
4.加载保存的位置或使用默认位置

测试

  • windows环境

@baiyao105

Copy link
Copy Markdown
Member Author

Important

浮窗位置不一定100%复原

原因

  • 使用了边界检查(adjust_position_to_screen)函数,超过屏幕的部分在重启之后将会移动会屏幕内

@RinLit-233-shiroko

Copy link
Copy Markdown
Member

Important

浮窗位置不一定100%复原

原因

  • 使用了边界检查(adjust_position_to_screen)函数,超过屏幕的部分在重启之后将会移动会屏幕内

hao

@RinLit-233-shiroko RinLit-233-shiroko merged commit 9454fd1 into Class-Widgets:main Feb 15, 2025
@baiyao105 baiyao105 deleted the feat-#443 branch March 1, 2025 12:28
pizeroLOL pushed a commit to pizeroLOL/Class-Widgets that referenced this pull request Aug 10, 2025
* fix(#426) :时差偏移应用到课程表,对通知限制

* fix(#426): 时差偏移应用到课程表,限制通知2s内仅触发一次

* feat: 保留浮窗上次启动位置
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants