This commit is contained in:
2019-09-23 09:09:18 +02:00
5 changed files with 3 additions and 57 deletions

View File

@@ -661,7 +661,6 @@ void App::update_rec_frames()
{
txt->set_text("");
}
layout[main_id]->update();
}
}

View File

@@ -85,7 +85,6 @@ void App::cloud_browse()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
dialog->btn_ok->on_click = [this, dialog](Node*)
{

View File

@@ -69,7 +69,6 @@ void App::dialog_usermanual()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
}
void App::dialog_changelog()
@@ -81,7 +80,6 @@ void App::dialog_changelog()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
}
void App::dialog_about()
@@ -93,7 +91,6 @@ void App::dialog_about()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
}
void App::dialog_newdoc()
@@ -107,7 +104,6 @@ void App::dialog_newdoc()
dialog->input->set_text("name");
layout[main_id]->add_child(dialog);
layout[main_id]->update();
App::I->showKeyboard();
@@ -215,7 +211,6 @@ void App::dialog_open()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
dialog->btn_ok->on_click = [this, dialog](Node*)
{
@@ -281,7 +276,6 @@ void App::dialog_browse()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
dialog->btn_ok->on_click = [this, dialog](Node*)
{
@@ -426,7 +420,6 @@ void App::dialog_save()
};
layout[main_id]->add_child(dialog);
layout[main_id]->update();
}
}
@@ -518,7 +511,6 @@ void App::dialog_resize()
dialog->loaded();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
dialog->btn_ok->on_click = [this,dialog](Node*)
{
@@ -559,7 +551,6 @@ void App::dialog_layer_rename()
App::I->showKeyboard();
layout[main_id]->add_child(dialog);
layout[main_id]->update();
dialog->btn_ok->on_click = [this,dialog](Node*)
{

View File

@@ -78,8 +78,6 @@ void App::resize(float w, float h)
redraw = true;
width = w;
height = h;
if (auto* main = layout[main_id])
main->update(w , h, zoom);
}
void App::show_cursor()
@@ -335,10 +333,7 @@ bool App::mouse_down(int button, float x, float y, float pressure, kEventSource
e.m_eraser = eraser;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::mouse_move(float x, float y, float pressure, kEventSource source, bool eraser)
@@ -366,10 +361,7 @@ bool App::mouse_up(int button, float x, float y, kEventSource source, bool erase
e.m_eraser = eraser;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::mouse_scroll(float x, float y, float delta)
@@ -381,10 +373,7 @@ bool App::mouse_scroll(float x, float y, float delta)
e.m_scroll_delta = delta;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::mouse_cancel(int button)
@@ -394,10 +383,7 @@ bool App::mouse_cancel(int button)
e.m_type = kEventType::MouseCancel;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::gesture_start(const glm::vec2& p0, const glm::vec2& p1)
@@ -412,10 +398,7 @@ bool App::gesture_start(const glm::vec2& p0, const glm::vec2& p1)
gesture_p1 = p1;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::gesture_move(const glm::vec2& p0, const glm::vec2& p1)
@@ -430,10 +413,7 @@ bool App::gesture_move(const glm::vec2& p0, const glm::vec2& p1)
e.m_pos_delta = p - glm::lerp(gesture_p0, gesture_p1, 0.5f);
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::gesture_end()
@@ -443,10 +423,7 @@ bool App::gesture_end()
e.m_type = kEventType::GestureEnd;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::key_down(kKey key)
@@ -460,10 +437,7 @@ bool App::key_down(kKey key)
e.m_key = key;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::key_up(kKey key)
@@ -475,10 +449,7 @@ bool App::key_up(kKey key)
e.m_key = key;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}
bool App::key_char(char key)
@@ -489,10 +460,7 @@ bool App::key_char(char key)
e.m_char = key;
kEventResult ret = kEventResult::Available;
if (auto* main = layout[main_id])
{
ret = main->on_event(&e);
main->update();
}
return ret == kEventResult::Consumed;
}

View File

@@ -76,7 +76,6 @@ void App::init_toolbar_main()
msgbox->m_manager = &layout;
msgbox->init();
layout[main_id]->add_child(msgbox);
layout[main_id]->update();
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-settings"))
@@ -86,7 +85,6 @@ void App::init_toolbar_main()
settings->m_manager = &layout;
settings->init();
layout[main_id]->add_child(settings);
layout[main_id]->update();
};
}
}
@@ -267,7 +265,6 @@ void App::init_sidebar()
stroke->mouse_capture();
auto scroll = stroke->find<NodeScroll>("scroller");
//scroll->SetHeight(glm::max(100.f, screen.y - pos.y - 200.f));
layout[main_id]->update();
stroke->on_popup_close = [this, tick](Node*) {
tick->destroy();
@@ -310,7 +307,6 @@ void App::init_sidebar()
color->m_capture_children = false;
color->m_mouse_ignore = false;
color->mouse_capture();
layout[main_id]->update();
color->on_popup_close = [this, tick](Node*) {
tick->destroy();
@@ -347,7 +343,6 @@ void App::init_sidebar()
layers->mouse_capture();
auto scroll = layers->find<NodeScroll>("layers-container");
scroll->SetMaxHeight(glm::max(100.f, screen.y - pos.y - 200.f));
layout[main_id]->update();
layers->on_popup_close = [this, tick](Node*) {
tick->destroy();
@@ -384,7 +379,6 @@ void App::init_sidebar()
grid->mouse_capture();
auto scroll = grid->find<NodeScroll>("scroller");
scroll->SetMaxHeight(glm::max(100.f, screen.y - pos.y - 250.f));
layout[main_id]->update();
grid->on_popup_close = [this, tick](Node*) {
tick->destroy();
@@ -525,7 +519,6 @@ void App::init_menu_file()
popup->SetPositioning(YGPositionTypeAbsolute);
popup->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup);
layout[main_id]->update();
if (auto b = popup->find<NodeButtonCustom>("file-newdoc"))
b->on_click = [this, popup](Node*) {
@@ -609,7 +602,6 @@ void App::init_menu_file()
subpopup->SetPositioning(YGPositionTypeAbsolute);
subpopup->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(subpopup);
layout[main_id]->update();
subpopup->find<NodeButtonCustom>("file-submenu-export-png")->on_click = [this, subpopup, popup](Node*) {
dialog_export(".png");
subpopup->mouse_release();
@@ -687,7 +679,6 @@ void App::init_menu_edit()
popup->SetPositioning(YGPositionTypeAbsolute);
popup->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup);
layout[main_id]->update();
};
}
}
@@ -707,7 +698,6 @@ void App::init_menu_tools()
popup_exp->SetPositioning(YGPositionTypeAbsolute);
popup_exp->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup_exp);
layout[main_id]->update();
if (auto tick = popup_exp->find<NodeButtonCustom>("tools-timelapse-tick")) tick->on_click = [this, popup_exp](Node* b)
{
@@ -721,7 +711,6 @@ void App::init_menu_tools()
popup_time->SetPositioning(YGPositionTypeAbsolute);
popup_time->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup_time);
layout[main_id]->update();
if (auto item = popup_time->find<NodeButtonCustom>("timelapse-start"))
{
@@ -763,7 +752,6 @@ void App::init_menu_tools()
popup_time->SetPositioning(YGPositionTypeAbsolute);
popup_time->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup_time);
layout[main_id]->update();
auto visible = [this](Node* panel) {
if (!panel)
@@ -1041,7 +1029,6 @@ void App::init_menu_about()
popup->SetPositioning(YGPositionTypeAbsolute);
popup->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup);
layout[main_id]->update();
popup->find<NodeButtonCustom>("about-app")->on_click = [this, popup](Node*) {
dialog_about();
@@ -1158,7 +1145,6 @@ void App::init_menu_layer()
popup->SetPositioning(YGPositionTypeAbsolute);
popup->SetPosition(pos.x, pos.y);
layout[main_id]->add_child(popup);
layout[main_id]->update();
popup->find<NodeButtonCustom>("layer-clear")->on_click = [this, popup](Node*) {
canvas->m_canvas->clear();
@@ -1507,7 +1493,10 @@ void App::ui_restore()
set_ui_rtl(Settings::value<Serializer::Integer>("ui-rtl"));
if (!Settings::has("ui"))
{
timeline->SetVisibility(false);
return;
}
timeline->SetVisibility(Settings::value_or<Serializer::Boolean>("timeline-visible", false));