add ppbr export dialog, implement text input focus

This commit is contained in:
2019-09-12 19:10:42 +02:00
parent c875323516
commit 61bcd86d2c
10 changed files with 97 additions and 16 deletions

View File

@@ -502,19 +502,7 @@ void NodePanelBrushPreset::init()
});
break;
case 1: // export file
#if __IOS__
App::I->pick_file_save("ppbr", [this] (std::string path) {
export_ppbr(path, {});
});
#else
App::I->pick_file_save({ "ppbr" }, [this] (std::string path) {
std::thread([this, path] {
BT_SetTerminate();
export_ppbr(path, {});
App::I->message_box("Export PPBR", "Brushes exported to:\n" + path);
}).detach();
});
#endif
App::I->dialog_ppbr_export();
break;
case 2: // download
break;
@@ -732,7 +720,7 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path, const Image& hea
info.props["num_brush_patt"] = std::make_shared<Serializer::Integer>(img_patterns.size());
info.props["num_brushes"] = std::make_shared<Serializer::Integer>(m_container->m_children.size());
auto pb = App::I->show_progress("Exporting ABR", 1 + img_brushes.size() +
auto pb = App::I->show_progress("Exporting PPBR", 1 + img_brushes.size() +
img_patterns.size() + m_container->m_children.size() * 2);
sw << info;
@@ -833,7 +821,7 @@ bool NodePanelBrushPreset::import_ppbr(const std::string& path)
std::string info_dump = info.str(0, "Info");
LOG("%s", info_dump.c_str());
auto pb = App::I->show_progress("Importing ABR", 1 + num_brush_patt + num_brush_tips + num_brushes * 2);
auto pb = App::I->show_progress("Importing PPBR", 1 + num_brush_patt + num_brush_tips + num_brushes * 2);
// header image
Image header_image;