Skip to content

Commit

Permalink
Add widget for bg brightness
Browse files Browse the repository at this point in the history
Signed-off-by: John Strunk <[email protected]>
  • Loading branch information
JohnStrunk committed May 12, 2023
1 parent eff2e84 commit 9479b94
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,36 @@ def _appearance(self, parent: Widget) -> Widget:

bgframelabels = ttk.Frame(mainframe)
bgframelabels.pack(side="top", fill="x")
ttk.Label(bgframelabels, text="Background image:", anchor="e").pack(
side="left", fill="both"
bgframelabels.columnconfigure(1, weight=1)
ttk.Label(bgframelabels, text="Image brightness:", anchor="e").grid(
column=0, row=0, sticky="news"
)
bg_bgight_spin = ttk.Spinbox(
bgframelabels,
from_=0,
to=100,
increment=5,
width=4,
textvariable=self._vm.brightness_bg,
)
bg_bgight_spin.grid(column=1, row=0, sticky="nws", pady=_PADDING)
ToolTip(bg_bgight_spin, "Brightness of the background image (percent: 0-100)")
ttk.Label(bgframelabels, text="Background image:", anchor="e").grid(
column=0, row=1, sticky="news"
)
self._bg_img_label = StringVar()
ttk.Label(
bg_img_label = ttk.Label(
bgframelabels, textvariable=self._bg_img_label, anchor="w", relief="sunken"
).pack(side="left", fill="both", expand=1)
)
bg_img_label.grid(column=1, row=1, sticky="news")
ToolTip(bg_img_label, "Scoreboard background image - Recommended: 1280x720")
self._vm.image_bg.trace_add(
"write",
lambda *_: self._bg_img_label.set(
os.path.basename(self._vm.image_bg.get())[-20:]
),
)
self._vm.image_bg.set(self._vm.image_bg.get())
ToolTip(bgframelabels, "Scoreboard background image - Recommended: 1280x720")

bgframebtns = ttk.Frame(mainframe)
bgframebtns.pack(side="top", fill="x")
Expand Down

0 comments on commit 9479b94

Please sign in to comment.