mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 06:24:39 +00:00
Clarify shared alignment placement and unit documentation
This commit is contained in:
@@ -167,7 +167,8 @@ pub(crate) fn show(ui: &mut Ui, edit: Edit<'_>) -> Shown {
|
||||
.event_filter(filter)
|
||||
.return_key(if multiline { Some(egui::KeyboardShortcut::new(egui::Modifiers::NONE, egui::Key::Enter)) } else { None })
|
||||
.layouter(&mut layouter)
|
||||
// A laid-out galley sits at the rect's corner, as a painted run does.
|
||||
// A laid-out galley sits at the rect's corner. Other text follows the same logical placement
|
||||
// rule as primitives::text::free_room_before, with the row centred vertically.
|
||||
.align(match (align, rtl) {
|
||||
_ if galley.is_some() => egui::Align2::LEFT_TOP,
|
||||
(HAlign::Center, _) => egui::Align2::CENTER_CENTER,
|
||||
|
||||
@@ -344,7 +344,7 @@ impl<'a, V: NumberValue + 'static> NumberField<'a, V> {
|
||||
}
|
||||
|
||||
/// The unit, measured, then the chevrons: what sits after the text. The unit stands apart at the end of the value
|
||||
/// area, so units line up in a column of fields and the number centres in the room before its unit. A
|
||||
/// area, so units line up in a column of fields; the value's alignment applies within the room before its unit. A
|
||||
/// content-sized field's unit is as wide as the widest of its column group's.
|
||||
fn after_text(&self, cx: &MeasureCx<'_, Self>, chevrons: &[(PartKey, Label)]) -> Vec<Adornment> {
|
||||
let shared = content_sized(cx);
|
||||
|
||||
Reference in New Issue
Block a user