mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 12:32:10 +01:00
Help gives the help line's Text, which its callers show
This commit is contained in:
1 parent
6c72055339
commit
282d45bb28
2 files changed
+7
-7
No files matched your search
@@ -183,7 +183,7 @@ pub(super) fn show_row<H: PreferencesModel + ?Sized>(ui: &mut Ui, host: &mut H,
|
||||
Stack::new().id_salt(key).enabled(row.enabled).show(ui, |ui, _| {
|
||||
host.custom_row(ui, key);
|
||||
if let Some(help) = &row.help {
|
||||
Help::Text(help.clone()).show(ui);
|
||||
Help::Text(help.clone()).text().show(ui);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ pub enum Help {
|
||||
}
|
||||
|
||||
impl Help {
|
||||
/// Shows the help line as a field shows it under its control.
|
||||
pub fn show(&self, ui: &mut Ui) {
|
||||
/// The help line as a field shows it under its control.
|
||||
pub fn text(&self) -> Text {
|
||||
match self {
|
||||
Help::Text(text) => Text::new(text.clone()).role(TypeRole::Caption).shade(Shade::Muted).show(ui),
|
||||
Help::Status(tone, text) => Text::new(text.clone()).role(TypeRole::Caption).tone(*tone).show(ui),
|
||||
};
|
||||
Help::Text(text) => Text::new(text.clone()).role(TypeRole::Caption).shade(Shade::Muted),
|
||||
Help::Status(tone, text) => Text::new(text.clone()).role(TypeRole::Caption).tone(*tone),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ impl Container for Field {
|
||||
return;
|
||||
}
|
||||
if let Some(help) = &self.help {
|
||||
help.show(ui);
|
||||
help.text().show(ui);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user