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 <[email protected]>
This commit is contained in:
JonathanandCopilot committed 2026-09-08 09:26:28 +02:00
1 parent 92ac3f60e5
commit 725a7b3e7e
1 file changed
+13 -2
+13 -2
View File
@@ -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 {