From 725a7b3e7e18a67acbb2004fd804c993a7d7ecad Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 8 Sep 2026 09:26:28 +0200 Subject: [PATCH] Align ByLayer property dropdowns consistently in Properties panel Use SELECTOR_PAD_V (calculated from ROW_H and FONT_SZ) instead of hardcoded [3, 6] padding for color selector buttons. This matches the padding used by combo_box widgets for Lineweight and Linetype, ensuring all three ByLayer dropdowns align vertically and have consistent height. Fixes #1047 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ui/color_select.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ui/color_select.rs b/src/ui/color_select.rs index 054d80812..82a41c6f8 100644 --- a/src/ui/color_select.rs +++ b/src/ui/color_select.rs @@ -5,11 +5,17 @@ use crate::app::Message; use crate::ui::properties::acad_color_display; +use crate::ui::ROW_H; use acadrust::types::Color as AcadColor; use iced::widget::{button, column, container, row, text}; -use iced::{Background, Border, Color, Element, Length, Theme}; +use iced::{Background, Border, Color, Element, Length, Padding, Theme}; use crate::t; +/// Font size for color selector buttons (matches combo_box styling). +const FONT_SZ: f32 = ROW_H * 0.42; +/// Vertical padding for color selector buttons (matches combo_box styling). +const SELECTOR_PAD_V: f32 = (ROW_H - FONT_SZ * 1.3 - 2.0) / 2.0; + /// Which "logical" entries the colour list offers besides the standard ACI /// colours. #[derive(Clone, Copy, Default)] @@ -222,7 +228,12 @@ fn color_selector_with_indicator<'a>( .align_y(iced::Center), ) .on_press(on_toggle) - .padding([3, 6]) + .padding(Padding { + top: SELECTOR_PAD_V, + bottom: SELECTOR_PAD_V, + left: 6.0, + right: 6.0, + }) .width(Length::Fill); if !open {