move clear presets to the panel popup menu
This commit is contained in:
@@ -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();
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user