add iOS and macOS icons

This commit is contained in:
2019-09-23 18:06:20 +02:00
parent 3f28fd9229
commit cfdf428a9b
26 changed files with 173 additions and 38 deletions

View File

@@ -53,9 +53,11 @@ void App::open_document(std::string path)
std::smatch m;
if (!std::regex_search(path, m, r))
return;
std::string base = m[1].str();
std::string name = m[2].str();
std::string ext = m[3].str();
if (str_iequals(m[3].str(), "abr"))
if (str_iequals(ext, "abr"))
{
auto mb = message_box("Import ABR", "Would you like to import the brushes?", true);
mb->on_submit = [this, path] (Node* target) {
@@ -63,7 +65,7 @@ void App::open_document(std::string path)
target->destroy();
};
}
else if (str_iequals(m[3].str(), "ppbr"))
else if (str_iequals(ext, "ppbr"))
{
auto mb = message_box("Import PPBR", "Would you like to import the brushes?", true);
mb->on_submit = [this, path] (Node* target) {
@@ -73,9 +75,9 @@ void App::open_document(std::string path)
}
else
{
auto open_action = [this, path, m] {
doc_name = m[2].str();
doc_dir = m[1].str();
auto open_action = [this, path, base, name] {
doc_name = name;
doc_dir = base;
doc_path = path;
canvas->reset_camera();
layers->clear();

View File

@@ -33,8 +33,11 @@ bool Asset::exist(std::string path)
}
else
{
std::ifstream f(path, std::ios::binary);
return f.is_open();
FILE* fp = fopen(path.c_str(), "rb");
if (!fp)
return false;
fclose(fp);
return true;
}
return false; // useless return for the stupid xcode
}

View File

@@ -19,7 +19,10 @@ void NodeMessageBox::init()
m_title = m_template->find<NodeText>("title");
m_message = m_template->find<NodeText>("message");
btn_ok = m_template->find<NodeButton>("btn-ok");
btn_ok->on_click = [&](Node*) { destroy(); };
btn_ok->on_click = [&](Node*) {
if (on_submit)
on_submit(this);
};
btn_cancel = m_template->find<NodeButton>("btn-cancel");
on_submit = btn_cancel->on_click = [&](Node*) { destroy(); };
m_capture_children = false; // don't capture children events on mouse_capture

View File

@@ -940,17 +940,13 @@ bool NodePanelBrushPreset::import_ppbr(const std::string& path)
return false;
}
bool NodePanelBrushPreset::import_abr(const std::string& path_in)
bool NodePanelBrushPreset::import_abr(const std::string& path)
{
BT_SetTerminate();
ABR abr;
LOG("ABR detected");
std::string path = path_in;
if (path_in.find(".abr") == std::string::npos)
path += ".abr";
std::string name, base, ext;
std::regex r(R"((.*)[\\/]([^\\/]+)\.(\w+)$)");
std::smatch m;