diff --git a/data/layout.xml b/data/layout.xml
index 76c1ee4..fad33e0 100644
--- a/data/layout.xml
+++ b/data/layout.xml
@@ -1429,17 +1429,17 @@ Here's a list of what's available in this release.
@@ -1451,10 +1451,6 @@ Here's a list of what's available in this release.
-
-
-
-
@@ -1463,10 +1459,6 @@ Here's a list of what's available in this release.
-
-
-
-
@@ -1650,11 +1642,9 @@ Here's a list of what's available in this release.
-
@@ -1734,7 +1724,7 @@ Here's a list of what's available in this release.
-
+
diff --git a/src/app_layout.cpp b/src/app_layout.cpp
index 438e77c..1b4913e 100644
--- a/src/app_layout.cpp
+++ b/src/app_layout.cpp
@@ -697,6 +697,32 @@ void App::init_menu_edit()
popup->m_mouse_ignore = false;
popup->m_flood_events = true;
popup->m_capture_children = false;
+
+ popup->find("clear-grids")->on_click = [this, popup](Node*) {
+ CanvasModeGrid* mode = (CanvasModeGrid*)Canvas::modes[(int)kCanvasMode::Grid][0];
+ mode->clear();
+ popup->mouse_release();
+ popup->destroy();
+ };
+
+ popup->find("camera-reset")->on_click = [this, popup](Node*) {
+ canvas->reset_camera();
+ popup->mouse_release();
+ popup->destroy();
+ };
+
+ popup->find("clear-presets")->on_click = [this, popup](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->mouse_release();
+ popup->destroy();
+ };
};
}
}
@@ -1107,18 +1133,6 @@ void App::init_menu_layer()
popup->m_mouse_ignore = false;
popup->m_flood_events = true;
popup->m_capture_children = false;
- popup->find("clear-grids")->on_click = [this, popup](Node*) {
- CanvasModeGrid* mode = (CanvasModeGrid*)Canvas::modes[(int)kCanvasMode::Grid][0];
- mode->clear();
- popup->mouse_release();
- popup->destroy();
- };
-
- popup->find("camera-reset")->on_click = [this, popup](Node*) {
- canvas->reset_camera();
- popup->mouse_release();
- popup->destroy();
- };
popup->find("layer-clear")->on_click = [this, popup](Node*) {
canvas->m_canvas->clear();
diff --git a/src/node_panel_brush.cpp b/src/node_panel_brush.cpp
index f242b1b..e44ebf5 100644
--- a/src/node_panel_brush.cpp
+++ b/src/node_panel_brush.cpp
@@ -361,6 +361,11 @@ bool NodePanelBrush::restore()
return false;
}
+void NodePanelBrush::clear()
+{
+ m_container->remove_all_children();
+}
+
void NodePanelBrush::added(Node* parent)
{
m_interacted = false;
@@ -604,6 +609,11 @@ void NodePanelBrushPreset::add_brush(std::shared_ptr brush)
b->on_click = std::bind(&NodePanelBrushPreset::handle_click, this, std::placeholders::_1);
}
+void NodePanelBrushPreset::clear_brushes()
+{
+ m_container->remove_all_children();
+}
+
void NodePanelBrushPreset::added(Node* parent)
{
m_interacted = false;
diff --git a/src/node_panel_brush.h b/src/node_panel_brush.h
index e6f3891..5d1886f 100644
--- a/src/node_panel_brush.h
+++ b/src/node_panel_brush.h
@@ -52,6 +52,7 @@ public:
std::string get_thumb_path(int index) const;
bool save();
bool restore();
+ void clear();
};
// -----------------------------------------------------------------------
@@ -92,5 +93,6 @@ public:
bool save();
bool restore();
void add_brush(std::shared_ptr brush);
+ void clear_brushes();
};