improve reload ui

This commit is contained in:
2019-04-22 10:05:13 +02:00
parent a8d475fbfb
commit 042ad503d2
7 changed files with 23 additions and 7 deletions

View File

@@ -238,6 +238,7 @@ void App::init_sidebar()
fp->destroy();
}
layout[main_id]->add_child(stroke);
stroke->SetSize(350, YGUndefined);
auto tick = layout[main_id]->add_child<NodeImage>();
tick->SetPositioning(YGPositionTypeAbsolute);
tick->SetSize(32, 16);
@@ -251,7 +252,7 @@ void App::init_sidebar()
stroke->m_mouse_ignore = false;
stroke->mouse_capture();
auto scroll = stroke->find<NodeScroll>("scroller");
scroll->SetMaxHeight(glm::max(100.f, screen.y - pos.y - 200.f));
scroll->SetHeight(glm::max(100.f, screen.y - pos.y - 200.f));
layout[main_id]->update();
stroke->on_popup_close = [this, tick](Node*) {
@@ -1179,6 +1180,11 @@ void App::initLayout()
NodeIcon::static_init();
NodeStrokePreview::static_init();
layout.on_reloading = [&] {
ui_save();
NodeStrokePreview::empty_queue();
};
layout.on_loaded = [&] {
LOG("initializing layout updating after load");
layout[main_id]->update(width, height, zoom);