aboutsummaryrefslogtreecommitdiff
path: root/srb_tk.py
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-05-02 15:20:54 -0400
committerB. Stack <bgstack15@gmail.com>2024-05-02 15:20:54 -0400
commite13ec405e8a1d022a7674d18ecffb5853cb034d8 (patch)
tree71278c90212b0f9c766be39313c8ee771e724747 /srb_tk.py
parenttk: add tooltip for breakables (diff)
downloadsrb_lib-e13ec405e8a1d022a7674d18ecffb5853cb034d8.tar.gz
srb_lib-e13ec405e8a1d022a7674d18ecffb5853cb034d8.tar.bz2
srb_lib-e13ec405e8a1d022a7674d18ecffb5853cb034d8.zip
tk: add background color for levelsets
Diffstat (limited to 'srb_tk.py')
-rwxr-xr-xsrb_tk.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/srb_tk.py b/srb_tk.py
index 7f64e87..58b83f2 100755
--- a/srb_tk.py
+++ b/srb_tk.py
@@ -53,6 +53,15 @@ SPDX-License-Identifier: GPL-3.0-only
Icon courtesy of https://icons8.com/icon/9336/aircraft
"""
+# muted colors for backgrounds of levels within a levelset whose balloon is this color.
+colors = {
+ "blue": 0xccffff,
+ "green": 0xccff99,
+ "red": 0xffcccc,
+ "orange": 0xffcc99,
+ "yellow": 0xffff99,
+}
+
def get_srb_image(filename, sizex, sizey, resample=Image.Resampling.LANCZOS, photoImage = True):
""" helper function that returns an ImageTk from the named file from the configured images directory, resized for you. """
global IMAGE_FAILURES
@@ -296,6 +305,7 @@ class App(tk.Frame):
self.lbl_levelsets.append(tk.Label(self.frm_levels,text=tl["name"]))
self.lbl_levelsets[i].grid(row=x,column=0,sticky="EW",columnspan=2)
if "c" in tl and tl["c"] != "none":
+ tk.Label(self.frm_levels,background="#" + hex(colors[tl["c"]])[2:]).grid(row=x,column=0,rowspan=tl["l"],columnspan=17,sticky="NESW")
tk.Label(self.frm_levels,image=self.img_balloons[-1]).grid(row=x,column=2,columnspan=2)
self.spn_levelsets.append(stk.Spinbox(self.frm_levels,textvariable=self.levelset_status_ints[i],from_=0,to=tl["l"],width=2))
self.spn_levelsets[i].grid(row=x+1,column=0)
bgstack15