fix(bar): use truncated labels for titles

This commit introduces a new wrapper, CustomUi, which is used to
implement custom methods on top of eframe::egui::Ui.

The default ui::add_sized method always has the text in a label
centered, which is not desirable for a status bar where the layout
should be ltr.

A new function CustomUi::add_sized_left_to_right has been added to
ensure that labels can be truncated with a custom width (which requires
allocate_ui_with_layout), while also retaining the ability for the text
to be aligned to the left rather than the center of the allocated
layout.
This commit is contained in:
LGUG2Z
2024-09-21 10:20:26 -07:00
parent 1080159e68
commit 3720ce42d0
7 changed files with 114 additions and 26 deletions

View File

@@ -408,6 +408,11 @@
]
}
},
"max_label_width": {
"description": "Max label width before text truncation (default: 400.0)",
"type": "number",
"format": "float"
},
"monitor": {
"description": "Monitor options",
"type": "object",