Improve message ordering to use a stack (#707)

* Improve message ordering

* Resovle bug with widgets

* Less code duplication for UpdateOpenDocumentsList

* Fix layer panel
This commit is contained in:
0HyperCube
2022-07-01 19:11:15 +01:00
committed by Keavon Chambers
parent d12d805e2f
commit b2eae904d8
4 changed files with 39 additions and 44 deletions

View File

@@ -75,6 +75,7 @@ impl MessageHandler<LayoutMessage, ()> for LayoutMessageHandler {
self.send_layout(layout_target, responses);
}
UpdateLayout { layout_target, widget_id, value } => {
self.send_layout(layout_target, responses);
let layout = &mut self.layouts[layout_target as usize];
let widget_holder = layout.iter_mut().find(|widget| widget.widget_id == widget_id);
if widget_holder.is_none() {
@@ -183,7 +184,6 @@ impl MessageHandler<LayoutMessage, ()> for LayoutMessageHandler {
}
Widget::TextLabel(_) => {}
};
self.send_layout(layout_target, responses);
}
}
}