Compare commits

..

No commits in common. "21c22692a582bda49b8b67a4850c35eb9bb7233b" and "a1c105dba1cffeaf3cdcbcd3b888b6e0a2a5e525" have entirely different histories.

2 changed files with 14 additions and 12 deletions

View File

@ -15,16 +15,16 @@ ICRS is a small Tkinter tool for analysing colour ranges in images. You load a p
- [uv](https://github.com/astral-sh/uv) for dependency management - [uv](https://github.com/astral-sh/uv) for dependency management
- Tkinter (install separately on some Linux distros) - Tkinter (install separately on some Linux distros)
## Setup with uv (Windows PowerShell) ## Setup with uv
```powershell ```bash
git clone https://git.lukasmahler.de/lm/ICRS.git git clone https://git.lukasmahler.de/lm/ICRS.git
cd ICRS cd ICRS
uv venv uv venv
.\.venv\Scripts\Activate source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install . uv pip install . # install ICRS and dependencies
uv run icrs uv run icrs # launches the GUI
``` ```
The launcher copies Tcl/Tk resources into the virtualenv on first run, so no manual environment tweaks are needed. On macOS/Linux replace the activate step with `source .venv/bin/activate`. The launcher copies Tcl/Tk resources into the virtualenv on first run, so no manual environment tweaks are needed.
## Workflow ## Workflow
1. Load an image (`๐Ÿ“‚`) or a folder (`๐Ÿ“`). 1. Load an image (`๐Ÿ“‚`) or a folder (`๐Ÿ“`).

View File

@ -169,16 +169,18 @@ class UIBuilderMixin:
def _add_palette_swatch(self, parent, name: str, hex_code: str) -> None: def _add_palette_swatch(self, parent, name: str, hex_code: str) -> None:
swatch = tk.Canvas( swatch = tk.Canvas(
parent, parent,
width=24, width=26,
height=24, height=26,
highlightthickness=0, highlightthickness=1,
background=hex_code, highlightbackground="#b1b1b6",
background="#ffffff",
bd=0, bd=0,
relief="flat", relief="flat",
takefocus=1, takefocus=1,
cursor="hand2", cursor="hand2",
) )
swatch.pack(side=tk.LEFT, padx=4, pady=2) 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): def trigger(_event=None, colour=hex_code, label=name):
self.apply_sample_colour(colour, label) self.apply_sample_colour(colour, label)
@ -186,8 +188,8 @@ class UIBuilderMixin:
swatch.bind("<Button-1>", trigger) swatch.bind("<Button-1>", trigger)
swatch.bind("<space>", trigger) swatch.bind("<space>", trigger)
swatch.bind("<Return>", trigger) swatch.bind("<Return>", trigger)
swatch.bind("<Enter>", lambda _e: swatch.configure(highlightthickness=1, highlightbackground="#71717a")) swatch.bind("<Enter>", lambda _e: swatch.configure(highlightbackground="#71717a"))
swatch.bind("<Leave>", lambda _e: swatch.configure(highlightthickness=0)) swatch.bind("<Leave>", lambda _e: swatch.configure(highlightbackground="#b1b1b6"))
def _add_toolbar_button(self, parent, text: str, command) -> None: def _add_toolbar_button(self, parent, text: str, command) -> None:
font = tkfont.Font(root=self.root, family="Segoe UI", size=9) font = tkfont.Font(root=self.root, family="Segoe UI", size=9)