Loading src/gui/include/gui/ui.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ static const float mode_toolbar_width = 275.0f; static const float mode_toolbar_height = 40.0f; static const float build_toolbar_width = 400.0f; static const float build_toolbar_button_width = 90.0f; static const float build_toolbar_height = 40.0f; void show_ui(const osi::Window &window, edit::UIData &data, const double ¤t_second); Loading src/gui/src/ui.cpp +13 −7 Original line number Diff line number Diff line Loading @@ -402,9 +402,15 @@ void mode_II_build_selection_ui(const osi::Window &window, edit::UIData &data) void build_toolbar_ui(const osi::Window &window, edit::UIData &data) { auto window_pos_x =window.size().x * 0.5f - build_toolbar_width * 0.5f; ImGui::SetNextWindowPos(ImVec2(window_pos_x, window.size().y - build_toolbar_height)); ImGui::SetNextWindowSize(ImVec2( build_toolbar_width, build_toolbar_height)); // auto window_pos_x =window.size().x * 0.5f - build_toolbar_width * 0.5f; if (data.allowed_components.empty()) return; float size_x = static_cast<float>(window.size().x); float size_y = static_cast<float>(window.size().y); ImGui::SetNextWindowPos(ImVec2(size_x * 0.5f, size_y), ImGuiCond_Always, ImVec2(0.5f, 1.0f)); ImGui::SetNextWindowSize(ImVec2(build_toolbar_button_width * data.allowed_components.size(), build_toolbar_height)); ImGuiWindowFlags window_flags = 0 | ImGuiWindowFlags_NoTitleBar Loading @@ -429,11 +435,11 @@ void build_toolbar_buttons(edit::UIData &data) set_build_toolbar_button_colors(data); std::map<component, const char*> buttons = { {component::voxel, "Voxel"}, {component::voxel, "Cube"}, {component::fixed_con, "Fixed"}, {component::open_con, "Open"}, {component::rotation_con, "Rot"}, {component::shared_rotation_con, "Shrd Rot"} {component::open_con, "RoFICoM"}, {component::rotation_con, "Shoe"}, {component::shared_rotation_con, "Body Joint"} }; for (auto &comp : data.allowed_components) Loading Loading
src/gui/include/gui/ui.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ static const float mode_toolbar_width = 275.0f; static const float mode_toolbar_height = 40.0f; static const float build_toolbar_width = 400.0f; static const float build_toolbar_button_width = 90.0f; static const float build_toolbar_height = 40.0f; void show_ui(const osi::Window &window, edit::UIData &data, const double ¤t_second); Loading
src/gui/src/ui.cpp +13 −7 Original line number Diff line number Diff line Loading @@ -402,9 +402,15 @@ void mode_II_build_selection_ui(const osi::Window &window, edit::UIData &data) void build_toolbar_ui(const osi::Window &window, edit::UIData &data) { auto window_pos_x =window.size().x * 0.5f - build_toolbar_width * 0.5f; ImGui::SetNextWindowPos(ImVec2(window_pos_x, window.size().y - build_toolbar_height)); ImGui::SetNextWindowSize(ImVec2( build_toolbar_width, build_toolbar_height)); // auto window_pos_x =window.size().x * 0.5f - build_toolbar_width * 0.5f; if (data.allowed_components.empty()) return; float size_x = static_cast<float>(window.size().x); float size_y = static_cast<float>(window.size().y); ImGui::SetNextWindowPos(ImVec2(size_x * 0.5f, size_y), ImGuiCond_Always, ImVec2(0.5f, 1.0f)); ImGui::SetNextWindowSize(ImVec2(build_toolbar_button_width * data.allowed_components.size(), build_toolbar_height)); ImGuiWindowFlags window_flags = 0 | ImGuiWindowFlags_NoTitleBar Loading @@ -429,11 +435,11 @@ void build_toolbar_buttons(edit::UIData &data) set_build_toolbar_button_colors(data); std::map<component, const char*> buttons = { {component::voxel, "Voxel"}, {component::voxel, "Cube"}, {component::fixed_con, "Fixed"}, {component::open_con, "Open"}, {component::rotation_con, "Rot"}, {component::shared_rotation_con, "Shrd Rot"} {component::open_con, "RoFICoM"}, {component::rotation_con, "Shoe"}, {component::shared_rotation_con, "Body Joint"} }; for (auto &comp : data.allowed_components) Loading