implement brush preset import

This commit is contained in:
2019-08-31 07:50:05 +02:00
parent 56bba88c14
commit eaa20c0270

View File

@@ -463,6 +463,24 @@ void NodePanelBrushPreset::init()
root()->update();
auto bounds = root()->GetSize() - zw(popup->get_children_rect());
popup->SetPosition(glm::clamp(popup->m_pos, { 0, 0 }, bounds));
popup->on_select = [this, popup] (Node* target, int index) {
switch (index)
{
case 0: // download
break;
case 1: // import
App::I->pick_file({".abr", ".ABR"}, [] (std::string path) {
std::thread([path] {
BT_SetTerminate();
App::I->stroke->import_abr(path);
}).detach();
});
break;
case 2: // export
break;
}
popup->destroy();
};
};
if (Asset::exist(App::I->data_path + "/settings/presets.bin") && !restore())