Add subtle theme-aware hover backgrounds to shared menus
Gitea/canvas-pilot/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-11-16 22:14:32 +01:00
parent a5ff96348b
commit f8ff13d1f5
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
5 changed files with 17 additions and 4 deletions

2
Cargo.lock generated
View File

@ -548,7 +548,7 @@ dependencies = [
[[package]]
name = "canvas-pilot"
version = "0.9.8"
version = "0.9.9"
dependencies = [
"base64",
"craft-dwg",

View File

@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"]
resolver = "3"
[workspace.package]
version = "0.9.8"
version = "0.9.9"
edition = "2024"
license = "MIT"
repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot"

View File

@ -4482,7 +4482,11 @@ fn toolbar_menu<R>(
let widgets = &mut ui.style_mut().visuals.widgets;
for (visuals, fill, border) in [
(&mut widgets.inactive, palette.field, palette.line),
(&mut widgets.hovered, palette.panel, palette.cyan),
(
&mut widgets.hovered,
original.visuals.widgets.hovered.bg_fill,
palette.cyan,
),
(&mut widgets.active, palette.purple, palette.cyan),
(&mut widgets.open, palette.panel, palette.cyan),
] {

View File

@ -306,12 +306,14 @@ impl Theme {
} else {
Color32::LIGHT_RED
};
// A small contrast shift makes borderless menu hover visible too.
let hover_fill = p.panel.lerp_to_gamma(p.text, 0.08);
v.selection.bg_fill = p.purple;
v.selection.stroke = Stroke::new(1.0_f32, p.text);
for (widget, fill, border) in [
(&mut v.widgets.noninteractive, p.panel, p.line),
(&mut v.widgets.inactive, p.field, p.line),
(&mut v.widgets.hovered, p.panel, p.cyan),
(&mut v.widgets.hovered, hover_fill, p.cyan),
(&mut v.widgets.active, p.purple, p.cyan),
(&mut v.widgets.open, p.panel, p.cyan),
] {

View File

@ -4,6 +4,13 @@
## Unreleased
### v0.9.9
- Added a subtle background shift to shared hover styling, including borderless
menus and toolbar menus. The colour adapts to each theme without animation,
extra drawing passes or changes to control sizes. Native dark/light screenshots
confirmed stationary rows; required checks passed with 91.38% line coverage.
### v0.9.8
- Fixed hover/focus outlines changing selectable-row widths and moving surrounding