diff --git a/crates/ui-egui/src/panes.rs b/crates/ui-egui/src/panes.rs index c72c86035d..b426d09f33 100644 --- a/crates/ui-egui/src/panes.rs +++ b/crates/ui-egui/src/panes.rs @@ -5209,7 +5209,8 @@ fn symbol_editor(app: &mut RustGisApp, ui: &mut Ui, s: Symbol, g: GeometryType, }); egui::Grid::new("symbol_grid").num_columns(2).spacing(vec2(10.0, 6.0)).show(ui, |ui| { if g != GeometryType::Polyline { - ui.label(tl!("Color")); + // The same name as the ribbon's Drawing group gives this `layer.color` button. + ui.label(tl!("Fill")); let mut c = c32(s.fill); let resp = crate::widgets::color_button(ui, &mut c); if resp.changed() { diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index e1fe525e09..3a37b4cb50 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -4402,7 +4402,9 @@ fn drawing_group(app: &mut RustGisApp, ui: &mut Ui, layer: &rustgis_engine::map: crate::widgets::one_step_per_press(app, &resp); let _ = app.run("layer.color", json!({"color": crate::theme::rgba(c).hex8()})); } - ui.label(egui::RichText::new(tl!("Color")).size(11.5)); + // A line has no inside: its colour is the line's (the outline is the "Outline" width below). + let name = if layer.geometry_type() == GeometryType::Polyline { tl!("Color") } else { tl!("Fill") }; + ui.label(egui::RichText::new(name).size(11.5)); }); let mut w = layer.renderer.base_symbol().stroke_width; ui.horizontal(|ui| { @@ -5291,6 +5293,17 @@ mod tests { assert!(h.query_by_label("No Fill").is_some()); } + #[test] + fn drawing_names_the_colour_by_what_it_changes() { + let mut h = drawing_harness(); + for (layer, fill) in [("Countries", true), ("Cities", true), ("Rivers", false)] { + h.state_mut().run("layer.select", json!({"layer": layer})).unwrap(); + h.run(); + // The colour well itself is also labelled "Color", so only "Fill" tells the two apart. + assert_eq!(h.query_by_label("Fill").is_some(), fill, "{layer}"); + } + } + /// Drags a number of the harness from `at` by 16, 32 and 48 points, calling `each` between. fn drag_by(h: &mut egui_kittest::Harness<'static, RustGisApp>, at: egui::Pos2, mut each: impl FnMut(&RustGisApp)) { h.hover_at(at);