Skip to content

Commit b70f58f

Browse files
committed
add frame-based colors
1 parent 4be6639 commit b70f58f

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

config/application_configuration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
# plugin
2222
SERIAL_RATE: int = 115200
2323
SERIAL_SECONDS: int = 5
24+
FRAME_BTN_COLOR_ERASE: str = 'red'
25+
FRAME_BTN_COLOR_INFORMATION: str = 'green'
26+
FRAME_BTN_COLOR_PLUGINS: str = 'plum4'

ui/frame_device_information.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from logging import getLogger, debug
22
from customtkinter import CTkFrame, CTkLabel, CTkButton
3-
from config.application_configuration import FONT_CATEGORY
3+
from config.application_configuration import FONT_CATEGORY, FRAME_BTN_COLOR_INFORMATION
44

55

66
logger = getLogger(__name__)
@@ -27,14 +27,14 @@ def __init__(self, master, *args, **kwargs):
2727
self.label.pack(padx=10, pady=10)
2828
self.label.configure(font=FONT_CATEGORY)
2929

30-
self.chip_info_btn = CTkButton(self, text='Chip ID')
30+
self.chip_info_btn = CTkButton(self, text='Chip ID', fg_color=FRAME_BTN_COLOR_INFORMATION)
3131
self.chip_info_btn.pack(padx=10, pady=5)
3232

33-
self.memory_info_btn = CTkButton(self, text='Flash ID')
33+
self.memory_info_btn = CTkButton(self, text='Flash ID', fg_color=FRAME_BTN_COLOR_INFORMATION)
3434
self.memory_info_btn.pack(padx=10, pady=5)
3535

36-
self.mac_info_btn = CTkButton(self, text='MAC Address')
36+
self.mac_info_btn = CTkButton(self, text='MAC Address', fg_color=FRAME_BTN_COLOR_INFORMATION)
3737
self.mac_info_btn.pack(padx=10, pady=5)
3838

39-
self.flash_status_btn = CTkButton(self, text='Flash Status')
39+
self.flash_status_btn = CTkButton(self, text='Flash Status', fg_color=FRAME_BTN_COLOR_INFORMATION)
4040
self.flash_status_btn.pack(padx=10, pady=5)

ui/frame_erase_device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from logging import getLogger, debug
22
from customtkinter import CTkFrame, CTkLabel, CTkButton
3-
from config.application_configuration import FONT_CATEGORY
3+
from config.application_configuration import FONT_CATEGORY, FRAME_BTN_COLOR_ERASE
44

55

66
logger = getLogger(__name__)
@@ -27,5 +27,5 @@ def __init__(self, master, *args, **kwargs):
2727
self.label.pack(padx=10, pady=10)
2828
self.label.configure(font=FONT_CATEGORY)
2929

30-
self.erase_btn = CTkButton(self, text='Erase Flash', fg_color='red')
30+
self.erase_btn = CTkButton(self, text='Erase Flash', fg_color=FRAME_BTN_COLOR_ERASE)
3131
self.erase_btn.pack(padx=10, pady=5)

ui/frame_plugins.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from logging import getLogger, debug
22
from customtkinter import CTkFrame, CTkLabel, CTkButton
3-
from config.application_configuration import FONT_CATEGORY, SERIAL_SECONDS
3+
from config.application_configuration import FONT_CATEGORY, SERIAL_SECONDS, FRAME_BTN_COLOR_PLUGINS
44

55

66
logger = getLogger(__name__)
@@ -27,11 +27,11 @@ def __init__(self, master, *args, **kwargs):
2727
self.label.pack(padx=10, pady=10)
2828
self.label.configure(font=FONT_CATEGORY)
2929

30-
self.mp_debug_btn = CTkButton(self, text=f'{SERIAL_SECONDS}s Debug', fg_color='green')
30+
self.mp_debug_btn = CTkButton(self, text=f'{SERIAL_SECONDS}s Debug', fg_color=FRAME_BTN_COLOR_PLUGINS)
3131
self.mp_debug_btn.pack(padx=10, pady=5)
3232

33-
self.mp_version_btn = CTkButton(self, text='Version', fg_color='green')
33+
self.mp_version_btn = CTkButton(self, text='Version', fg_color=FRAME_BTN_COLOR_PLUGINS)
3434
self.mp_version_btn.pack(padx=10, pady=5)
3535

36-
self.mp_structure_btn = CTkButton(self, text='File Structure', fg_color='green')
36+
self.mp_structure_btn = CTkButton(self, text='File Structure', fg_color=FRAME_BTN_COLOR_PLUGINS)
3737
self.mp_structure_btn.pack(padx=10, pady=5)

0 commit comments

Comments
 (0)