Dialog labels show in full: the label column grows to its longest label (up to 150 px, then wraps) instead of cutting labels off. Feature previews that remove material (Hole, pockets) show the cut's new faces through the body in the cut colour, so the hole is seen from any side
Fixes #18 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7e0618d64b
commit
ce61aef4a6
2 files changed
+29
-5
No files matched your search
@@ -820,13 +820,17 @@ fn hint(inp: &SelInput) -> &'static str {
|
||||
|
||||
/// Width of the label column; longer labels are cut with "…".
|
||||
const LABEL_W: f32 = 92.0;
|
||||
/// The label column grows to fit its labels up to this, then long labels wrap.
|
||||
const LABEL_MAX_W: f32 = 150.0;
|
||||
|
||||
/// A row label in the dialog's label column.
|
||||
/// A row label in the dialog's label column (the grid sizes the column to its widest label).
|
||||
pub(crate) fn row_label(ui: &mut egui::Ui, text: &str) {
|
||||
ROW.with(|r| *r.borrow_mut() = text.to_string());
|
||||
ui.allocate_ui_with_layout(vec2(LABEL_W, 22.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_width(LABEL_W);
|
||||
ui.add(egui::Label::new(text).truncate()).on_hover_text(text);
|
||||
let full = egui::WidgetText::from(text).into_galley(ui, Some(egui::TextWrapMode::Extend), f32::INFINITY, egui::TextStyle::Body).size().x;
|
||||
let w = full.clamp(LABEL_W, LABEL_MAX_W);
|
||||
ui.allocate_ui_with_layout(vec2(w, 22.0), egui::Layout::left_to_right(egui::Align::Center), |ui| {
|
||||
ui.set_width(w);
|
||||
ui.add(egui::Label::new(text).wrap());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user