move clear presets to the panel popup menu

This commit is contained in:
2019-09-09 17:53:31 +02:00
parent 096930b02e
commit 566a4e72a5
3 changed files with 19 additions and 19 deletions

View File

@@ -193,6 +193,10 @@
<button-custom id="share" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<text text="Share to Cloud" grow="1" margin="0 0 0 5"/>
</button-custom>
<button-custom id="clear-all" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<icon icon="bin" width="20"/>
<text text="Delete all presets" grow="1" margin="0 0 0 5"/>
</button-custom>
</popup-menu>
</layout>
@@ -1656,10 +1660,6 @@ Here's a list of what's available in this release.
<icon icon="bin" width="20"/>
<text text="Clear Guides" margin="0 0 0 5"/>
</button-custom>
<button-custom id="clear-presets" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<icon icon="bin" width="20"/>
<text text="Clear Presets" margin="0 0 0 5"/>
</button-custom>
<button-custom id="camera-reset" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<icon icon="arrow_rotate_clockwise" width="20"/>
<text id="menu-label" text="Reset Camera" margin="0 0 0 5"/>

View File

@@ -546,7 +546,7 @@ void App::init_menu_file()
if (auto b = popup->find<NodeButtonCustom>("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<NodeButtonCustom>("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();
};
};
};
}
}

View File

@@ -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();
};