rename Experimental menu to Tools and merge with Edit
This commit is contained in:
@@ -1429,18 +1429,6 @@ Here's a list of what's available in this release.
|
|||||||
<!-- MENU EDIT -->
|
<!-- MENU EDIT -->
|
||||||
<layout id="edit-menu">
|
<layout id="edit-menu">
|
||||||
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
||||||
<button-custom id="clear-grids" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
|
||||||
<icon icon="bin" width="20"/>
|
|
||||||
<text text="Clear Guides" margin="0 0 0 5"/>
|
|
||||||
</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">
|
|
||||||
<icon icon="arrow_rotate_clockwise" width="20"/>
|
|
||||||
<text id="menu-label" text="Reset Camera" margin="0 0 0 5"/>
|
|
||||||
</button-custom>
|
|
||||||
</popup-menu>
|
</popup-menu>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
||||||
@@ -1462,37 +1450,49 @@ Here's a list of what's available in this release.
|
|||||||
</popup-menu>
|
</popup-menu>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
||||||
<!-- MENU EXPERIMENTAL -->
|
<!-- MENU TOOLS -->
|
||||||
<layout id="experimental-menu">
|
<layout id="tools-menu">
|
||||||
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
||||||
<node dir="row">
|
<node dir="row">
|
||||||
<button-custom id="experimental-timelapse" height="40" align="center" color=".2" pad="0 0 0 10" dir="row" grow="1">
|
<button-custom id="tools-timelapse" height="40" align="center" color=".2" pad="0 0 0 10" dir="row" grow="1">
|
||||||
<text text="Timelapse" grow="1" margin="0 0 0 5"/>
|
<text text="Timelapse" grow="1" margin="0 0 0 5"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
<button-custom id="experimental-timelapse-tick" height="40" width="40" align="center" justify="center" color=".2" dir="row">
|
<button-custom id="tools-timelapse-tick" height="40" width="40" align="center" justify="center" color=".2" dir="row">
|
||||||
<icon icon="resultset_next" width="20"/>
|
<icon icon="resultset_next" width="20"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
</node>
|
</node>
|
||||||
<node dir="row">
|
<node dir="row">
|
||||||
<button-custom id="experimental-panels" height="40" align="center" color=".2" pad="0 0 0 10" dir="row" grow="1">
|
<button-custom id="tools-panels" height="40" align="center" color=".2" pad="0 0 0 10" dir="row" grow="1">
|
||||||
<text text="Panels" grow="1" margin="0 0 0 5"/>
|
<text text="Panels" grow="1" margin="0 0 0 5"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
<button-custom id="experimental-panels-tick" height="40" width="40" align="center" justify="center" color=".2" dir="row">
|
<button-custom id="tools-panels-tick" height="40" width="40" align="center" justify="center" color=".2" dir="row">
|
||||||
<icon icon="resultset_next" width="20"/>
|
<icon icon="resultset_next" width="20"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
</node>
|
</node>
|
||||||
<button-custom id="experimental-rtl" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
<button-custom id="tools-rtl" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||||
<checkbox id="experimental-rtl-check" width="20" height="20"/>
|
<checkbox id="tools-rtl-check" width="20" height="20"/>
|
||||||
<text text="Left-handed UI" margin="0 0 0 5"/>
|
<text text="Left-handed UI" margin="0 0 0 5"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
<button-custom id="experimental-vr" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
<button-custom id="tools-vr" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||||
<checkbox id="experimental-vr-check" width="20" height="20"/>
|
<checkbox id="tools-vr-check" width="20" height="20"/>
|
||||||
<text text="Enable VR" margin="0 0 0 5"/>
|
<text text="Enable VR" margin="0 0 0 5"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
|
<button-custom id="clear-grids" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||||
|
<icon icon="bin" width="20"/>
|
||||||
|
<text text="Clear Guides" margin="0 0 0 5"/>
|
||||||
|
</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">
|
||||||
|
<icon icon="arrow_rotate_clockwise" width="20"/>
|
||||||
|
<text id="menu-label" text="Reset Camera" margin="0 0 0 5"/>
|
||||||
|
</button-custom>
|
||||||
</popup-menu>
|
</popup-menu>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
||||||
<!-- MENU EXPERIMENTAL > TIMELAPSE -->
|
<!-- MENU TOOLS > TIMELAPSE -->
|
||||||
<layout id="timelapse-menu">
|
<layout id="timelapse-menu">
|
||||||
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
||||||
<button-custom id="timelapse-start" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
<button-custom id="timelapse-start" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||||
@@ -1510,7 +1510,7 @@ Here's a list of what's available in this release.
|
|||||||
</popup-menu>
|
</popup-menu>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
||||||
<!-- MENU EXPERIMENTAL > PANELS -->
|
<!-- MENU TOOLS > PANELS -->
|
||||||
<layout id="panels-menu">
|
<layout id="panels-menu">
|
||||||
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
<popup-menu positioning="absolute" position="100 100" width="150" thickness="1" border-color=".1" color=".4 .4 .4 .8" dir="col">
|
||||||
<button-custom id="panel-presets" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
<button-custom id="panel-presets" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
|
||||||
@@ -1642,14 +1642,16 @@ Here's a list of what's available in this release.
|
|||||||
<button-custom id="menu-file" width="50" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
<button-custom id="menu-file" width="50" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
||||||
<text text="File"/>
|
<text text="File"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
|
<!--
|
||||||
<button-custom id="menu-edit" width="50" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
<button-custom id="menu-edit" width="50" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
||||||
<text text="Edit"/>
|
<text text="Edit"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
|
-->
|
||||||
<button-custom id="menu-layers" width="60" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
<button-custom id="menu-layers" width="60" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
||||||
<text text="Layers"/>
|
<text text="Layers"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
<button-custom id="menu-experimental" width="100" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
<button-custom id="menu-tools" width="60" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
||||||
<text text="Experimental"/>
|
<text text="Tools"/>
|
||||||
</button-custom>
|
</button-custom>
|
||||||
<button-custom id="menu-about" width="60" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
<button-custom id="menu-about" width="60" height="100%" margin="0 0 0 0" justify="center" align="center" pad="8" color=".1">
|
||||||
<text text="About"/>
|
<text text="About"/>
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public:
|
|||||||
void init_menu_file();
|
void init_menu_file();
|
||||||
void init_menu_edit();
|
void init_menu_edit();
|
||||||
void init_menu_layer();
|
void init_menu_layer();
|
||||||
void init_menu_experimental();
|
void init_menu_tools();
|
||||||
void init_menu_about();
|
void init_menu_about();
|
||||||
void dialog_usermanual();
|
void dialog_usermanual();
|
||||||
void dialog_changelog();
|
void dialog_changelog();
|
||||||
|
|||||||
@@ -697,45 +697,19 @@ void App::init_menu_edit()
|
|||||||
popup->m_mouse_ignore = false;
|
popup->m_mouse_ignore = false;
|
||||||
popup->m_flood_events = true;
|
popup->m_flood_events = true;
|
||||||
popup->m_capture_children = false;
|
popup->m_capture_children = false;
|
||||||
|
|
||||||
popup->find<NodeButtonCustom>("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<NodeButtonCustom>("camera-reset")->on_click = [this, popup](Node*) {
|
|
||||||
canvas->reset_camera();
|
|
||||||
popup->mouse_release();
|
|
||||||
popup->destroy();
|
|
||||||
};
|
|
||||||
|
|
||||||
popup->find<NodeButtonCustom>("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();
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::init_menu_experimental()
|
void App::init_menu_tools()
|
||||||
{
|
{
|
||||||
auto main = layout[main_id];
|
auto main = layout[main_id];
|
||||||
|
|
||||||
if (auto menu_exp = main->find<NodeButtonCustom>("menu-experimental"))
|
if (auto menu_exp = main->find<NodeButtonCustom>("menu-tools"))
|
||||||
{
|
{
|
||||||
menu_exp->on_click = [this, menu_exp, main](Node*) {
|
menu_exp->on_click = [this, menu_exp, main](Node*) {
|
||||||
glm::vec2 pos = menu_exp->m_pos + glm::vec2(0, menu_exp->m_size.y);
|
glm::vec2 pos = menu_exp->m_pos + glm::vec2(0, menu_exp->m_size.y);
|
||||||
auto popup_exp = (NodePopupMenu*)layout[const_hash("experimental-menu")]->m_children[0]->clone();
|
auto popup_exp = (NodePopupMenu*)layout[const_hash("tools-menu")]->m_children[0]->clone();
|
||||||
popup_exp->update();
|
popup_exp->update();
|
||||||
if (YGNodeStyleGetDirection(layout[main_id]->y_node) == YGDirectionRTL)
|
if (YGNodeStyleGetDirection(layout[main_id]->y_node) == YGDirectionRTL)
|
||||||
pos.x = pos.x - popup_exp->m_size.x + menu_exp->m_size.x;
|
pos.x = pos.x - popup_exp->m_size.x + menu_exp->m_size.x;
|
||||||
@@ -748,9 +722,9 @@ void App::init_menu_experimental()
|
|||||||
popup_exp->m_flood_events = true;
|
popup_exp->m_flood_events = true;
|
||||||
popup_exp->m_capture_children = false;
|
popup_exp->m_capture_children = false;
|
||||||
|
|
||||||
if (auto tick = popup_exp->find<NodeButtonCustom>("experimental-timelapse-tick")) tick->on_click = [this, popup_exp](Node* b)
|
if (auto tick = popup_exp->find<NodeButtonCustom>("tools-timelapse-tick")) tick->on_click = [this, popup_exp](Node* b)
|
||||||
{
|
{
|
||||||
if (auto menu_time = popup_exp->find<NodePopupMenu>("experimental-timelapse"))
|
if (auto menu_time = popup_exp->find<NodePopupMenu>("tools-timelapse"))
|
||||||
{
|
{
|
||||||
glm::vec2 pos = b->m_pos + glm::vec2(b->m_size.x, 0);
|
glm::vec2 pos = b->m_pos + glm::vec2(b->m_size.x, 0);
|
||||||
auto popup_time = (NodePopupMenu*)layout[const_hash("timelapse-menu")]->m_children[0]->clone();
|
auto popup_time = (NodePopupMenu*)layout[const_hash("timelapse-menu")]->m_children[0]->clone();
|
||||||
@@ -794,9 +768,9 @@ void App::init_menu_experimental()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (auto tick = popup_exp->find<NodeButtonCustom>("experimental-panels-tick")) tick->on_click = [this, popup_exp](Node* b)
|
if (auto tick = popup_exp->find<NodeButtonCustom>("tools-panels-tick")) tick->on_click = [this, popup_exp](Node* b)
|
||||||
{
|
{
|
||||||
if (auto menu_time = popup_exp->find<NodePopupMenu>("experimental-panels"))
|
if (auto menu_time = popup_exp->find<NodePopupMenu>("tools-panels"))
|
||||||
{
|
{
|
||||||
glm::vec2 pos = b->m_pos + glm::vec2(b->m_size.x, 0);
|
glm::vec2 pos = b->m_pos + glm::vec2(b->m_size.x, 0);
|
||||||
auto popup_time = (NodePopupMenu*)layout[const_hash("panels-menu")]->m_children[0]->clone();
|
auto popup_time = (NodePopupMenu*)layout[const_hash("panels-menu")]->m_children[0]->clone();
|
||||||
@@ -955,37 +929,37 @@ void App::init_menu_experimental()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (auto rtl_btn = popup_exp->find<NodeButtonCustom>("experimental-rtl"))
|
if (auto rtl_btn = popup_exp->find<NodeButtonCustom>("tools-rtl"))
|
||||||
{
|
{
|
||||||
auto ui = main->find("central-row");
|
auto ui = main->find("central-row");
|
||||||
NodeCheckBox* cb = rtl_btn->find<NodeCheckBox>("experimental-rtl-check");
|
NodeCheckBox* cb = rtl_btn->find<NodeCheckBox>("tools-rtl-check");
|
||||||
cb->set_value(ui->GetRTL() == YGDirectionRTL, false);
|
cb->set_value(ui->GetRTL() == YGDirectionRTL, false);
|
||||||
|
|
||||||
rtl_btn->on_click = [this, popup_exp, rtl_btn](Node* b)
|
rtl_btn->on_click = [this, popup_exp, rtl_btn](Node* b)
|
||||||
{
|
{
|
||||||
NodeCheckBox* cb = rtl_btn->find<NodeCheckBox>("experimental-rtl-check");
|
NodeCheckBox* cb = rtl_btn->find<NodeCheckBox>("tools-rtl-check");
|
||||||
cb->set_value(!cb->checked, true);
|
cb->set_value(!cb->checked, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
rtl_btn->find<NodeCheckBox>("experimental-rtl-check")->on_value_changed = [this, main](Node*, bool checked)
|
rtl_btn->find<NodeCheckBox>("tools-rtl-check")->on_value_changed = [this, main](Node*, bool checked)
|
||||||
{
|
{
|
||||||
auto ui = main->find("central-row");
|
auto ui = main->find("central-row");
|
||||||
ui->SetRTL(checked ? YGDirectionRTL : YGDirectionLTR);
|
ui->SetRTL(checked ? YGDirectionRTL : YGDirectionLTR);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto vr_btn = popup_exp->find<NodeButtonCustom>("experimental-vr"))
|
if (auto vr_btn = popup_exp->find<NodeButtonCustom>("tools-vr"))
|
||||||
{
|
{
|
||||||
NodeCheckBox* cb = vr_btn->find<NodeCheckBox>("experimental-vr-check");
|
NodeCheckBox* cb = vr_btn->find<NodeCheckBox>("tools-vr-check");
|
||||||
cb->set_value(has_vr);
|
cb->set_value(has_vr);
|
||||||
|
|
||||||
vr_btn->on_click = [this, popup_exp, vr_btn](Node* b)
|
vr_btn->on_click = [this, popup_exp, vr_btn](Node* b)
|
||||||
{
|
{
|
||||||
NodeCheckBox* cb = vr_btn->find<NodeCheckBox>("experimental-vr-check");
|
NodeCheckBox* cb = vr_btn->find<NodeCheckBox>("tools-vr-check");
|
||||||
cb->set_value(!cb->checked, true);
|
cb->set_value(!cb->checked, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
vr_btn->find<NodeCheckBox>("experimental-vr-check")->on_value_changed = [this, main](Node* target, bool checked)
|
vr_btn->find<NodeCheckBox>("tools-vr-check")->on_value_changed = [this, main](Node* target, bool checked)
|
||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
@@ -1002,7 +976,33 @@ void App::init_menu_experimental()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
popup_exp->find<NodeButtonCustom>("clear-grids")->on_click = [this, popup_exp](Node*) {
|
||||||
|
CanvasModeGrid* mode = (CanvasModeGrid*)Canvas::modes[(int)kCanvasMode::Grid][0];
|
||||||
|
mode->clear();
|
||||||
|
popup_exp->mouse_release();
|
||||||
|
popup_exp->destroy();
|
||||||
|
};
|
||||||
|
|
||||||
|
popup_exp->find<NodeButtonCustom>("camera-reset")->on_click = [this, popup_exp](Node*) {
|
||||||
|
canvas->reset_camera();
|
||||||
|
popup_exp->mouse_release();
|
||||||
|
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();
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1234,7 +1234,7 @@ void App::initLayout()
|
|||||||
init_menu_file();
|
init_menu_file();
|
||||||
init_menu_edit();
|
init_menu_edit();
|
||||||
init_menu_layer();
|
init_menu_layer();
|
||||||
init_menu_experimental();
|
init_menu_tools();
|
||||||
init_menu_about();
|
init_menu_about();
|
||||||
|
|
||||||
// set version string
|
// set version string
|
||||||
|
|||||||
Reference in New Issue
Block a user