mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 02:09:00 +00:00
ui-patterns stories: the port's About stories pass upstream's with_mark; rows stories bind through data.bind
This commit is contained in:
@@ -59,7 +59,7 @@ fn about_dialog(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
#[story(AboutDialog<'static>, covers = [], drive = Drive::Never)]
|
||||
fn about_dialog_listed(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let community = *data.value("community_link", true);
|
||||
hosted(ui, data, community, || HostedAbout::new(info(community), CREDITS.clone()).layout(AboutLayout::Listed))
|
||||
hosted(ui, data, community, || HostedAbout::new(info(community, false), CREDITS.clone()).layout(AboutLayout::Listed))
|
||||
}
|
||||
|
||||
/// The dialog with one app tab after Models, open on it.
|
||||
@@ -72,7 +72,7 @@ fn about_dialog_app_tab(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
Text::new("Français 1.2 · 98% translated").show(ui);
|
||||
Text::new("Deutsch 1.1 · 91% translated").show(ui);
|
||||
});
|
||||
HostedAbout::new(info(community), CREDITS.clone()).app_tab(languages).tab(AboutTab::App(0))
|
||||
HostedAbout::new(info(community, false), CREDITS.clone()).app_tab(languages).tab(AboutTab::App(0))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -81,12 +81,10 @@ fn param_rows(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
|
||||
/// The rows of `params` over the story's values, which `setup` may prepare once.
|
||||
fn rows_story(ui: &mut Ui, data: &mut StoryData, params: &[Param], setup: impl FnOnce(&mut DialogFields)) -> StoryOutput {
|
||||
let first = data.present::<DialogFields>("fields").is_none();
|
||||
let fields = data.value("fields", DialogFields::new());
|
||||
if first {
|
||||
setup(fields);
|
||||
if data.present::<DialogFields>("fields").is_none() {
|
||||
setup(data.value("fields", DialogFields::new()));
|
||||
}
|
||||
ParamRows::new("Filter", params, Bind::bound(fields)).show(ui).into()
|
||||
ParamRows::new("Filter", params, data.bind("fields", DialogFields::new())).show(ui).into()
|
||||
}
|
||||
|
||||
/// Rows with a reset dot after their label while the value differs from the default.
|
||||
|
||||
Reference in New Issue
Block a user