mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 00:57:26 +00:00
ui-patterns: hosted New Guide Layout and New Guide take the host's answers only in a real run
This commit is contained in:
@@ -713,8 +713,10 @@ impl StackDialog for HostedGuideLayoutDialog {
|
||||
}
|
||||
|
||||
fn show(&mut self, ui: &mut Ui, _: &DialogStack) -> Option<DialogResult<GuideLayoutResult>> {
|
||||
let measuring = crate::runtime::measure::active(ui.ctx());
|
||||
let answers = if measuring { Vec::new() } else { self.requests.take_answers() };
|
||||
let shown = (self.build)(Bind::bound(&mut self.values))
|
||||
.answers(self.requests.take_answers())
|
||||
.answers(answers)
|
||||
.opened(Bind::bound(&mut self.open))
|
||||
.preview(Bind::bound(&mut self.preview_on))
|
||||
.show(ui);
|
||||
|
||||
@@ -423,7 +423,9 @@ impl StackDialog for HostedNewGuideDialog {
|
||||
|
||||
fn show(&mut self, ui: &mut Ui, _: &DialogStack) -> Option<DialogResult<Guide>> {
|
||||
self.recall(ui.ctx());
|
||||
let mut dialog = (self.build)(Bind::bound(&mut self.values)).answers(self.requests.take_answers()).opened(Bind::bound(&mut self.open));
|
||||
let measuring = crate::runtime::measure::active(ui.ctx());
|
||||
let answers = if measuring { Vec::new() } else { self.requests.take_answers() };
|
||||
let mut dialog = (self.build)(Bind::bound(&mut self.values)).answers(answers).opened(Bind::bound(&mut self.open));
|
||||
dialog.recalled = true;
|
||||
if self.error.is_some() {
|
||||
dialog.error = self.error.clone();
|
||||
|
||||
Reference in New Issue
Block a user