From 21c22692a582bda49b8b67a4850c35eb9bb7233b Mon Sep 17 00:00:00 2001 From: lm Date: Fri, 17 Oct 2025 13:54:28 +0200 Subject: [PATCH] Make palette swatches borderless --- app/gui/ui.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/gui/ui.py b/app/gui/ui.py index 7f0f9f2..f5d7b24 100644 --- a/app/gui/ui.py +++ b/app/gui/ui.py @@ -169,18 +169,16 @@ class UIBuilderMixin: def _add_palette_swatch(self, parent, name: str, hex_code: str) -> None: swatch = tk.Canvas( parent, - width=26, - height=26, - highlightthickness=1, - highlightbackground="#b1b1b6", - background="#ffffff", + width=24, + height=24, + highlightthickness=0, + background=hex_code, bd=0, relief="flat", takefocus=1, cursor="hand2", ) swatch.pack(side=tk.LEFT, padx=4, pady=2) - swatch.create_rectangle(3, 3, 23, 23, outline="#4a4a4a", fill=hex_code) def trigger(_event=None, colour=hex_code, label=name): self.apply_sample_colour(colour, label) @@ -188,8 +186,8 @@ class UIBuilderMixin: swatch.bind("", trigger) swatch.bind("", trigger) swatch.bind("", trigger) - swatch.bind("", lambda _e: swatch.configure(highlightbackground="#71717a")) - swatch.bind("", lambda _e: swatch.configure(highlightbackground="#b1b1b6")) + swatch.bind("", lambda _e: swatch.configure(highlightthickness=1, highlightbackground="#71717a")) + swatch.bind("", lambda _e: swatch.configure(highlightthickness=0)) def _add_toolbar_button(self, parent, text: str, command) -> None: font = tkfont.Font(root=self.root, family="Segoe UI", size=9)