changed service checklist style

This commit is contained in:
Blake Harnden 2019-11-13 12:42:16 -08:00
parent 40b2c270e4
commit 08927b180a
2 changed files with 17 additions and 1 deletions

View file

@ -6,6 +6,7 @@ DARK = "black"
class Styles:
tooltip = "Tooltip.TLabel"
tooltip_frame = "Tooltip.TFrame"
service_checkbutton = "Service.TCheckbutton"
class Colors:
@ -20,6 +21,7 @@ class Colors:
selectfg = "#ffffff"
white = "white"
black = "black"
listboxbg = "#f2f1f0"
def load(style):
@ -106,6 +108,12 @@ def load(style):
"configure": {"justify": tk.LEFT, "relief": tk.SOLID, "borderwidth": 0}
},
Styles.tooltip_frame: {"configure": {}},
Styles.service_checkbutton: {
"configure": {
"background": Colors.listboxbg,
"foreground": Colors.black,
}
},
},
)

View file

@ -4,6 +4,7 @@ from functools import partial
from tkinter import ttk
from core.api.grpc import core_pb2
from coretk.themes import Styles
INT_TYPES = {
core_pb2.ConfigOptionType.UINT8,
@ -136,6 +137,7 @@ class ListboxScroll(ttk.LabelFrame):
self.listbox = tk.Listbox(
self, selectmode=tk.SINGLE, yscrollcommand=self.scrollbar.set
)
logging.info("listbox background: %s", self.listbox.cget("background"))
self.listbox.grid(row=0, column=0, sticky="nsew")
self.scrollbar.config(command=self.listbox.yview)
@ -149,5 +151,11 @@ class CheckboxList(FrameScroll):
def add(self, name, checked):
var = tk.BooleanVar(value=checked)
func = partial(self.clicked, name, var)
checkbox = ttk.Checkbutton(self.frame, text=name, variable=var, command=func)
checkbox = ttk.Checkbutton(
self.frame,
text=name,
variable=var,
command=func,
style=Styles.service_checkbutton,
)
checkbox.grid(sticky="w")