From 566a4e72a5acb53839f5ffb161859e795313354e Mon Sep 17 00:00:00 2001 From: omigamedev Date: Mon, 9 Sep 2019 17:53:31 +0200 Subject: [PATCH] move clear presets to the panel popup menu --- data/layout.xml | 8 ++++---- src/app_layout.cpp | 18 +++--------------- src/node_panel_brush.cpp | 12 ++++++++++++ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/data/layout.xml b/data/layout.xml index e9eaa1e..869673c 100644 --- a/data/layout.xml +++ b/data/layout.xml @@ -193,6 +193,10 @@ + + + + @@ -1656,10 +1660,6 @@ Here's a list of what's available in this release. - - - - diff --git a/src/app_layout.cpp b/src/app_layout.cpp index 37878fc..5f70062 100644 --- a/src/app_layout.cpp +++ b/src/app_layout.cpp @@ -546,7 +546,7 @@ void App::init_menu_file() if (auto b = popup->find("file-open")) b->on_click = [this, popup](Node*) { //dialog_open(); - pick_file({"ppi","PPI"}, [this](std::string path){ + pick_file({"ppi"}, [this](std::string path){ open_document(path); }); popup->mouse_release(); @@ -978,20 +978,8 @@ void App::init_menu_tools() popup_exp->mouse_release(); popup_exp->destroy(); }; - - popup_exp->find("clear-presets")->on_click = [this, popup_exp](Node*) { - auto mb = message_box("Clear Presets", "Do you want to remove all the Brush Presets?", true); - mb->btn_ok->m_text->set_text("Yes"); - mb->btn_cancel->m_text->set_text("No"); - mb->btn_ok->on_click = mb->on_submit = [this, mb](Node*) { - presets->clear_brushes(); - presets->save(); - mb->destroy(); - }; - popup_exp->mouse_release(); - popup_exp->destroy(); - }; -}; + + }; } } diff --git a/src/node_panel_brush.cpp b/src/node_panel_brush.cpp index eb310e1..f72ffac 100644 --- a/src/node_panel_brush.cpp +++ b/src/node_panel_brush.cpp @@ -514,6 +514,18 @@ void NodePanelBrushPreset::init() break; case 3: // upload break; + case 4: // clear presets + { + auto mb = App::I->message_box("Clear Presets", "Do you want to remove all the Brush Presets?", true); + mb->btn_ok->m_text->set_text("Yes"); + mb->btn_cancel->m_text->set_text("No"); + mb->btn_ok->on_click = mb->on_submit = [this, mb](Node*) { + App::I->presets->clear_brushes(); + App::I->presets->save(); + mb->destroy(); + }; + break; + } } popup->destroy(); };