Help gives the help line's Text, which its callers show

This commit is contained in:
aiongg
2026-11-21 11:19:46 +00:00
parent 6c72055339
commit 282d45bb28
2 changed files with 7 additions and 7 deletions
@@ -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);
}
});
}
+6 -6
View File
@@ -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);
}
}
}