summaryrefslogtreecommitdiffstats
path: root/src/windows
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-11-12 11:53:04 +0100
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-11-18 12:31:12 +0100
commit750b0803feb5604128e0a2e5771b5b8690529838 (patch)
treec1e316fd34e9f88dcbe264153e31cda1b474558b /src/windows
parenta0f85303525825218bedd4c525c5a5ceceeb6667 (diff)
windows: use a better systray default icon
Draw a blue circle as default icon in the systray. Use the same blue color as the one shown in ogCP for an ogClient Windows instance.
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/ogOperations.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/windows/ogOperations.py b/src/windows/ogOperations.py
index fcd6a20..c7161f7 100644
--- a/src/windows/ogOperations.py
+++ b/src/windows/ogOperations.py
@@ -23,20 +23,23 @@ from src.ogRest import ThreadState
def _create_default_image():
"""
Creates a default image for the tray icon. Use in case
- no favicon.ico is found.
+ no favicon.ico is found. The image will be a blue circle.
"""
width = height = 250
- color1 = (255, 255, 255)
- color2 = (255, 0, 255)
+ circle_color = (45, 158, 251)
- image = Image.new('RGB', (width, height), color1)
+ # Create a new image with a transparent background
+ image = Image.new('RGBA', (width, height), (0, 0, 0, 0))
dc = ImageDraw.Draw(image)
- dc.rectangle(
- (width // 2, 0, width, height // 2),
- fill=color2)
- dc.rectangle(
- (0, height // 2, width // 2, height),
- fill=color2)
+
+ # Draw circle
+ circle_radius = min(width, height) // 2 - 10
+ circle_center = (width // 2, height // 2)
+ dc.ellipse(
+ (circle_center[0] - circle_radius, circle_center[1] - circle_radius,
+ circle_center[0] + circle_radius, circle_center[1] + circle_radius),
+ fill=circle_color
+ )
return image