From 577feeeb0d5759c2df34648885e3a07c56e0c8ec Mon Sep 17 00:00:00 2001 From: QwertyChouskie Date: Wed, 8 May 2024 22:19:21 -0700 Subject: [PATCH] Make Connected/Disconnected label background colored Closes https://github.com/unofficial-rev-port/REVHubInterface/issues/17 --- REVHubInterface/__main__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/REVHubInterface/__main__.py b/REVHubInterface/__main__.py index d8f85bc..2edaed9 100644 --- a/REVHubInterface/__main__.py +++ b/REVHubInterface/__main__.py @@ -517,8 +517,6 @@ def __init__(self, root): true = True self.Main_window = tkinter.ttk.Frame(root) style = tkinter.ttk.Style() - style.configure("Red.Label", foreground="red") - style.configure("Green.Label", foreground="green") style.configure("Quit.TButton", foreground='red') self.Tab_frame = tkinter.ttk.Notebook(self.Main_window) self.Connected_Label = tkinter.ttk.Label(self.Main_window) @@ -553,7 +551,7 @@ def __init__(self, root): self.Tab_frame.grid(column=0, columnspan=3, padx=5, pady=5, row=1, sticky=(N, S, E, W)) self.Connected_Label.grid(row=0, sticky=E) - self.Connected_Label.config(text='Disconnected', style='Red.Label') + self.Connected_Label.config(text=' Disconnected ', background='red', foreground='white') self.Top_Banner.grid(row=0, sticky=W) @@ -619,9 +617,9 @@ def send_all_KA(self): isAlive = module.sendKA() if isAlive == False: self.on_quit_button_callback() - self.Connected_Label.config(text='Disconnected', style='Red.Label') + self.Connected_Label.config(text=' Disconnected ', background='red', foreground='white') else: - self.Connected_Label.config(text='Connected', style='Green.Label') + self.Connected_Label.config(text=' Connected ', background='green', foreground='white') module.getStatus() def speedMotorSlider(self, speed, moduleNumber, motorNumber, *args): @@ -989,7 +987,7 @@ def on_quit_button_callback(self): self.repetitiveFunctions = [] self.commMod.closeActivePort() self.Quit_button.config(state='disabled') - self.Connected_Label.config(text='Disconnected', style='Red.Label') + self.Connected_Label.config(text=' Disconnected ', background='red', foreground='white') for i in range(0, len(self.Tab_frame.tabs())): if i < 4: self.Tab_frame.tab(i, state='disabled')