Skip to content

Commit a4ac93a

Browse files
committed
新增前台应用隐藏设置
1 parent ad470f3 commit a4ac93a

7 files changed

Lines changed: 520 additions & 17 deletions

File tree

CHANGELOG/v2.3.0-beta.1/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ v2.3 - Shirako (砂狼白子) beta 1
99
- 新增 **UIAccess置顶**,支持在Windows 10/11下开启UIAccess置顶(主窗口/通知浮窗/浮窗)
1010
- 新增 **主窗口置顶**,基础设置支持主窗口置顶配置
1111
- 新增 **计时器窗口**,支持倒计时秒表时钟
12+
- 新增 **浮窗管理**,新增前台窗口隐藏配置
1213

1314
## 💡 功能优化
1415

app/Language/modules/sidebar_tray_management.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"description": "配置浮窗外观设置",
99
},
1010
"edge_settings": {"name": "贴边设置", "description": "配置浮窗贴边设置"},
11+
"foreground_hiding_settings": {
12+
"name": "前台隐藏设置",
13+
"description": "配置浮窗在前台应用时的隐藏设置",
14+
},
1115
"startup_display_floating_window": {
1216
"name": "启动时显示浮窗",
1317
"description": "控制软件启动时是否自动显示浮窗",
@@ -109,6 +113,19 @@
109113
"description": "设置浮窗贴边时显示样式",
110114
"combo_items": ["图标", "文字", "箭头"],
111115
},
116+
"hide_floating_window_on_foreground": {
117+
"name": "前台窗口隐藏浮窗",
118+
"description": "当前台窗口标题或进程名匹配时自动隐藏浮窗",
119+
"switchbutton_name": {"enable": "", "disable": ""},
120+
},
121+
"hide_floating_window_on_foreground_window_titles": {
122+
"name": "前台窗口标题",
123+
"description": "用英文 ; 分隔,包含匹配时隐藏浮窗",
124+
},
125+
"hide_floating_window_on_foreground_process_names": {
126+
"name": "前台进程名",
127+
"description": "用英文 ; 分隔,如 WeChat.exe,匹配时隐藏浮窗",
128+
},
112129
"floating_window_stick_to_edge_arrow_text": {
113130
"name": "抽",
114131
"description": "设置浮窗贴边时箭头按钮显示的文字",
@@ -141,6 +158,10 @@
141158
"name": "Edge settings",
142159
"description": "Configure floating window edge settings",
143160
},
161+
"foreground_hiding_settings": {
162+
"name": "Foreground hiding settings",
163+
"description": "Configure floating window hiding settings when foreground application is active",
164+
},
144165
"startup_display_floating_window": {
145166
"name": "Show popup on startup",
146167
"description": "Set whether to show the floating window after boot",
@@ -243,6 +264,19 @@
243264
"description": "Configure docked floating window style",
244265
"combo_items": {"0": "Icon", "1": "Text", "2": "Arrow"},
245266
},
267+
"hide_floating_window_on_foreground": {
268+
"name": "Hide floating window on foreground",
269+
"description": "Hide floating window when foreground title or process matches",
270+
"switchbutton_name": {"enable": "", "disable": ""},
271+
},
272+
"hide_floating_window_on_foreground_window_titles": {
273+
"name": "Foreground window titles",
274+
"description": "Use English ';' to separate, hide on substring match",
275+
},
276+
"hide_floating_window_on_foreground_process_names": {
277+
"name": "Foreground process names",
278+
"description": "Use English ';' to separate, e.g. WeChat.exe",
279+
},
246280
"floating_window_long_press_duration": {
247281
"name": "Long press time",
248282
"description": "Set floating window long by time (milliseconds)",

app/core/window_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,10 @@ def _show_float_window_impl(self) -> None:
754754
if self.float_window is None:
755755
self.create_float_window()
756756

757+
if hasattr(self.float_window, "toggle_user_requested_visible"):
758+
self.float_window.toggle_user_requested_visible()
759+
return
760+
757761
if self.float_window.isVisible():
758762
self.float_window.hide()
759763
else:

app/tools/settings_default_storage.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@
350350
"floating_window_draggable": {"default_value": True},
351351
"floating_window_size": {"default_value": 3},
352352
"do_not_steal_focus": {"default_value": True},
353+
"hide_floating_window_on_foreground": {"default_value": False},
354+
"hide_floating_window_on_foreground_window_titles": {"default_value": ""},
355+
"hide_floating_window_on_foreground_process_names": {"default_value": ""},
353356
},
354357
"sidebar_tray_management": {"title": {"default_value": None}},
355358
"sidebar_management_window": {

0 commit comments

Comments
 (0)