move clear presets to the panel popup menu
This commit is contained in:
@@ -193,6 +193,10 @@
|
|||||||
<button-custom id="share" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
<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"/>
|
<text text="Share to Cloud" grow="1" margin="0 0 0 5"/>
|
||||||
</button-custom>
|
</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>
|
</popup-menu>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
||||||
@@ -1656,10 +1660,6 @@ Here's a list of what's available in this release.
|
|||||||
<icon icon="bin" width="20"/>
|
<icon icon="bin" width="20"/>
|
||||||
<text text="Clear Guides" margin="0 0 0 5"/>
|
<text text="Clear Guides" margin="0 0 0 5"/>
|
||||||
</button-custom>
|
</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">
|
<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"/>
|
<icon icon="arrow_rotate_clockwise" width="20"/>
|
||||||
<text id="menu-label" text="Reset Camera" margin="0 0 0 5"/>
|
<text id="menu-label" text="Reset Camera" margin="0 0 0 5"/>
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ void App::init_menu_file()
|
|||||||
if (auto b = popup->find<NodeButtonCustom>("file-open"))
|
if (auto b = popup->find<NodeButtonCustom>("file-open"))
|
||||||
b->on_click = [this, popup](Node*) {
|
b->on_click = [this, popup](Node*) {
|
||||||
//dialog_open();
|
//dialog_open();
|
||||||
pick_file({"ppi","PPI"}, [this](std::string path){
|
pick_file({"ppi"}, [this](std::string path){
|
||||||
open_document(path);
|
open_document(path);
|
||||||
});
|
});
|
||||||
popup->mouse_release();
|
popup->mouse_release();
|
||||||
@@ -979,19 +979,7 @@ void App::init_menu_tools()
|
|||||||
popup_exp->destroy();
|
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;
|
break;
|
||||||
case 3: // upload
|
case 3: // upload
|
||||||
break;
|
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();
|
popup->destroy();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user