Skip to content

Commit 259f6f0

Browse files
committed
fix gui theme for macos
1 parent e41c741 commit 259f6f0

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

Source/GUI/Main.py

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,21 @@
1616
from tkinter import ttk as ttk_gui # Avoid conflict with existing ttk
1717
from tkintermapview import TkinterMapView
1818

19-
#from PIL import Image, ImageTk
19+
import platform
20+
21+
os_name = platform.system()
22+
23+
'''
24+
if os_name == "Darwin":
25+
# macOS specific code
26+
print("Running on macOS")
27+
elif os_name == "Windows":
28+
# Windows specific code
29+
print("Running on Windows")
30+
elif os_name == "Linux":
31+
# Linux specific code
32+
print("Running on Linux")
33+
'''
2034

2135
# Shared Queue for incoming complete messages
2236
from queue import Queue
@@ -62,15 +76,15 @@ def resource_path(relative_path):
6276
,"CMD:Settings:APRS:Comment:<alphanumeric 99 char max>"
6377
,"CMD:Settings:APRS:Message:<alphanumeric 99 char max>"
6478
,"CMD:Settings:APRS:Recipient Callsign:<alphanumeric 6 char max>"
65-
,"CMD:Settings:APRS:Recipient SSID:<alphanumeric 1 char max>"
79+
,"CMD:Settings:APRS:Recipient SSID:<alphanumeric 2 char max>"
6680
,"CMD:Settings:APRS:My Callsign:<alphanumeric 6 char max>"
67-
,"CMD:Settings:APRS:Callsign SSID:<alphanumeric 1 char max>"
81+
,"CMD:Settings:APRS:Callsign SSID:<alphanumeric 2 char max>"
6882
,"CMD:Settings:APRS:Dest Callsign:<alphanumeric 6 char max>"
69-
,"CMD:Settings:APRS:Dest SSID:<alphanumeric 1 char max>"
83+
,"CMD:Settings:APRS:Dest SSID:<alphanumeric 2 char max>"
7084
,"CMD:Settings:APRS:PATH1 Callsign:<alphanumeric 6 char max>"
71-
,"CMD:Settings:APRS:PATH1 SSID:<alphanumeric 1 char max>"
85+
,"CMD:Settings:APRS:PATH1 SSID:<alphanumeric 2 char max>"
7286
,"CMD:Settings:APRS:PATH2 Callsign:<alphanumeric 6 char max>"
73-
,"CMD:Settings:APRS:PATH2 SSID:<alphanumeric 1 char max>"
87+
,"CMD:Settings:APRS:PATH2 SSID:<alphanumeric 2 char max>"
7488
,"CMD:Settings:APRS:Symbol:<alphanumeric 1 char max>"
7589
,"CMD:Settings:APRS:Table:<alphanumeric 1 char max>"
7690
,"CMD:Settings:APRS:Automatic ACK:<True/False>"
@@ -356,7 +370,6 @@ def resource_path(relative_path):
356370
"default": "📍",
357371
}
358372

359-
360373
# ---------- Config Functions ----------
361374
def load_config():
362375
global config
@@ -784,8 +797,10 @@ def change_filter_mode(*args):
784797
open_log_btn = tk.Button(control_frame, text="Open Log", command=open_log_file)
785798
open_log_btn.grid(row=0, column=7, padx=(10, 0))
786799

787-
theme_toggle_btn = tk.Button(control_frame, text="Theme: Dark", command=toggle_theme)
788-
theme_toggle_btn.grid(row=0, column=8, padx=(10, 0))
800+
# MacOS handles the theme so we dont do it here
801+
if platform.system() != "Darwin":
802+
theme_toggle_btn = tk.Button(control_frame, text="Theme: Dark", command=toggle_theme)
803+
theme_toggle_btn.grid(row=0, column=8, padx=(10, 0))
789804

790805
# Quick Commands
791806
quick_frame = tk.Frame(root)
@@ -886,5 +901,9 @@ def show_raw_data(raw: str, marker):
886901
refresh_ports()
887902
if config.get("port"):
888903
port_var.set(config["port"])
889-
apply_theme()
904+
905+
# MacOS handles the theme so we dont do it here
906+
if platform.system() != "Darwin":
907+
apply_theme()
908+
890909
root.mainloop()

0 commit comments

Comments
 (0)