Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita56fd8d

Browse files
committed
feat(systray): added systray widget
chore(docs): updated the docs adding systray widget detailschore(readme): updated readme adding the systray widgetfix(tray): removed self.hide() call from remove_tray_icon method
1 parent7a1f8da commita56fd8d

File tree

11 files changed

+1950
-3
lines changed

11 files changed

+1950
-3
lines changed

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ https://github.com/user-attachments/assets/aab8d8e8-248f-46a1-919c-9b0601236ac1
9191
-**[Notifications](https://github.com/amnweb/yasb/wiki/(Widget)-Notifications)**: Shows the number of notifications from Windows.
9292
-**[OBS](https://github.com/amnweb/yasb/wiki/(Widget)-Obs)**: Integrates with OBS Studio to show recording status.
9393
-**[Server Monitor](https://github.com/amnweb/yasb/wiki/(Widget)-Server-Monitor)**: Monitors server status.
94+
-**[Systray](https://github.com/amnweb/yasb/wiki/(Widget)-Systray)**: Displays system tray icons.
9495
-**[Traffic](https://github.com/amnweb/yasb/wiki/(Widget)-Traffic)**: Displays network traffic information.
9596
-**[Taskbar](https://github.com/amnweb/yasb/wiki/(Widget)-Taskbar)**: A customizable taskbar for launching applications.
9697
-**[Power Menu](https://github.com/amnweb/yasb/wiki/(Widget)-Power-Menu)**: A menu for power options.
@@ -108,4 +109,4 @@ https://github.com/user-attachments/assets/aab8d8e8-248f-46a1-919c-9b0601236ac1
108109
##🏆 Contributors
109110
Thanks to our amazing contributors!
110111

111-
[![YASB Contributors](https://contrib.rocks/image?repo=amnweb/yasb)](https://github.com/amnweb/yasb/graphs/contributors)
112+
[![YASB Contributors](https://contrib.rocks/image?repo=amnweb/yasb)](https://github.com/amnweb/yasb/graphs/contributors)

‎docs/_Sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
-[Notifications](./(Widget)-Notifications)
2828
-[OBS](./(Widget)-Obs)
2929
-[Server Monitor](./(Widget)-Server-Monitor)
30+
-[Systray](./(Widget)-Systray)
3031
-[Traffic](./(Widget)-Traffic)
3132
-[Taskbar](./(Widget)-Taskbar)
3233
-[Power Menu](./(Widget)-Power-Menu)

‎docs/widgets/(Widget)-Systray.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#Systray Widget
2+
| Option| Type| Default| Description|
3+
|----------------------|---------|-------------|-----------------------------------------------------------------------------------------|
4+
|`class_name`| string|`'systray'`| The class name for the base widget.|
5+
|`label_collapsed`| string|`'▼'`| Label used for the collapse button when unpinned container is hidden.|
6+
|`label_expanded`| string|`'▶'`| Label used for the collapse button when unpinned container is shown.|
7+
|`label_position`| string|`'left'`| The position of the button that collapses unpinned container. Can be "left" or "right".|
8+
|`icon_size`| integer|`16`| The size of the icons in the systray. Can be any integer between 8 and 64.|
9+
|`pin_click_modifier`| string|`'alt'`| The modifier key used to pin/unpin icons. Can be "ctrl", "alt" or "shift".|
10+
|`show_unpinned`| boolean|`true`| Whether to show unpinned container on startup.|
11+
|`show_battery`| boolean|`false`| Whether to show battery icon (from the original systray).|
12+
|`show_volume`| boolean|`false`| Whether to show volume icon (from the original systray).|
13+
14+
15+
##Example Configuration
16+
```yaml
17+
systray:
18+
type:"yasb.systray.SystrayWidget"
19+
options:
20+
class_name:"systray"
21+
label_collapsed:""
22+
label_expanded:""
23+
label_position:"left"# Can be "left" or "right"
24+
icon_size:16# Can be any integer between 8 and 64
25+
pin_click_modifier:"alt"# Can be "ctrl", "alt" or "shift"
26+
show_unpinned:true
27+
show_battery:false
28+
show_volume:false
29+
```
30+
31+
## Important Notes:
32+
There are some limitations with the systray widget:
33+
- Systray widget will not show icons for apps if they ignore "TaskbarCreated" message. Meaning that if the original developers decided to ignore this message - their systray icons will not be shown. It's rare, but there are such cases (NVIDIA App for example). This is NOT a YASB bug.
34+
- In rare cases systray icon might ignore click events if the original application was already running before YASB was started. Example: Epic Games Launcher. No solution for this so far.
35+
36+
## Description of Options
37+
- **class_name:** The class name for the base widget. Can be changed if multiple systray widgets need to have different styling.
38+
- **label_collapsed:** Label used for the collapse button when unpinned container is hidden.
39+
- **label_expanded:** Label used for the collapse button when unpinned container is shown.
40+
- **label_position:** The position of the button that collapses unpinned container.
41+
- **icon_size:** The size of the icons in the systray. Can be any integer between 8 and 64.
42+
- **pin_click_modifier:** The modifier key used to pin/unpin icons. Can be "ctrl", "alt" or "shift".
43+
- **show_unpinned:** Whether to show unpinned container on startup.
44+
- **show_battery:** Whether to show battery icon (from the original systray).
45+
- **show_volume:** Whether to show volume icon (from the original systray).
46+
47+
## Style
48+
```css
49+
.systray {} /* The base widget style */
50+
.systray .unpinned-container {} /* Style for unpinned container */
51+
.systray .pinned-container {} /* Style for pinned container */
52+
.systray .pinned-container[forceshow=true] {} /* Style for pinned container when it is forced to show during dragging operation */
53+
.systray .button {} /* Style for the individual systray buttons/icons */
54+
.systray .button[dragging=true] {} /* Style for systray buttons/icons when dragging operation is in progress */
55+
.systray .unpinned-visibility-btn {} /* Style for the 'collapse unpinned icons' button */
56+
```
57+
58+
##Example CSS
59+
```css
60+
.systray {
61+
background:transparent;
62+
border:None;
63+
margin:0;
64+
}
65+
66+
.systray.unpinned-container {
67+
background:darkblue;
68+
border-radius:8px;
69+
}
70+
71+
.systray.pinned-container {
72+
background:transparent;
73+
}
74+
75+
.systray.pinned-container[forceshow=true] {
76+
background:red;
77+
}
78+
79+
.systray.button {
80+
border-radius:4px;
81+
padding:2px2px;
82+
}
83+
84+
.systray.button:hover {
85+
background:#727272;
86+
}
87+
88+
.systray.button[dragging=true] {
89+
background:orange;
90+
border-color:#FF8800;
91+
}
92+
93+
.systray.unpinned-visibility-btn {
94+
border-radius:4px;
95+
height:20px;
96+
width:16px;
97+
}
98+
99+
.systray.unpinned-visibility-btn:checked {
100+
background:darkblue;
101+
}
102+
103+
.systray.unpinned-visibility-btn:hover {
104+
border:1pxsolid#AAAAAA;
105+
border-radius:4px;
106+
border-color:#AAAAAA;
107+
}
108+
```

‎src/core/tray.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def remove_tray_icon(self):
167167
Remove the tray icon from the system tray.
168168
"""
169169
try:
170-
self.hide()
171170
self.deleteLater()
172171
exceptExceptionase:
173172
logging.error(f"Error removing tray icon:{e}")
@@ -345,4 +344,4 @@ def _show_info(self):
345344
info_box.exec()
346345

347346
def_open_logs(self):
348-
WindowShellDialog().exec()
347+
WindowShellDialog().exec()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp