Dialogs: the Select chip keeps its size on hover (#1387)

New frame::add_outlined adds a button that draws its own outline with the theme's outline width set to the same width in every state, so its padding no longer drops a pixel on hover. Used by the dialogs' Select chip, Sketch Text's Path chip and the bug report's Open GitHub draft button. New dialog_chip_hover test. Fixes the second point of #1335.
This commit is contained in:
DuBearte authored and GitHub committed 2026-10-15 13:01:09 -04:00
1 parent e382a77350
commit fd422a3fc1
5 files changed
+45 -9

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
//! Hovering a dialog's Select chip doesn't change its size or the panel's (#1335).
use serde_json::json;
use solidcraft_ui_egui::scenario::{Harness, handle_at};
#[test]
fn hovering_the_select_chip_keeps_its_size() {
let mut h = Harness::new();
h.app.home.open = false;
h.app.start("sketch.create");
h.frames(3);
let away = handle_at("dialog:Plane").unwrap();
h.step(&json!({"move":[away.x, away.y]})).unwrap();
h.frames(3);
let hovered = handle_at("dialog:Plane").unwrap();
assert!(away.distance(hovered) < 0.01, "the chip moved on hover: {away:?} -> {hovered:?}");
h.step(&json!({"move":[5.0, 600.0]})).unwrap();
h.frames(3);
assert!(away.distance(handle_at("dialog:Plane").unwrap()) < 0.01);
}