mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 17:58:03 -06:00
FIX: switch dark mode bug
1.selected tool item in support,seam,mmu will be invalid after swich dark mode 2.add reset direction button in mmu 3.if don't switch dark mode in prepare page,toolbar doesn't change color Change-Id: Ibaaaee5c0cc03f66682f5eb0daafcd143b9d9edc
This commit is contained in:
parent
14417bf176
commit
cfafbc812f
7 changed files with 118 additions and 73 deletions
|
@ -207,20 +207,21 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit)
|
|||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
m_imgui->text(m_desc.at("cursor_type"));
|
||||
std::array<wchar_t, 2> tool_ids = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon };
|
||||
bool dark_mode = wxGetApp().app_config->get("dark_color_mode") == "1";
|
||||
std::array<wchar_t, 2> tool_icons;
|
||||
std::array<wchar_t, 2> icons;
|
||||
if (dark_mode)
|
||||
tool_icons = { ImGui::CircleButtonDarkIcon, ImGui::SphereButtonDarkIcon};
|
||||
icons = { ImGui::CircleButtonDarkIcon, ImGui::SphereButtonDarkIcon};
|
||||
else
|
||||
tool_icons = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon};
|
||||
icons = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon };
|
||||
std::array<wxString, 2> tool_tips = { _L("Circle"), _L("Sphere")};
|
||||
for (int i = 0; i < tool_icons.size(); i++) {
|
||||
for (int i = 0; i < tool_ids.size(); i++) {
|
||||
std::string str_label = std::string("##");
|
||||
std::wstring btn_name = tool_icons[i] + boost::nowide::widen(str_label);
|
||||
std::wstring btn_name = icons[i] + boost::nowide::widen(str_label);
|
||||
|
||||
if (i != 0) ImGui::SameLine((empty_button_width + m_imgui->scaled(1.75f)) * i + m_imgui->scaled(1.3f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0);
|
||||
if (m_current_tool == tool_icons[i]) {
|
||||
if (m_current_tool == tool_ids[i]) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, dark_mode ? ImVec4(43 / 255.0f, 64 / 255.0f, 54 / 255.0f, 1.00f) : ImVec4(0.86f, 0.99f, 0.91f, 1.00f)); // r, g, b, a
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, dark_mode ? ImVec4(43 / 255.0f, 64 / 255.0f, 54 / 255.0f, 1.00f) : ImVec4(0.86f, 0.99f, 0.91f, 1.00f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, dark_mode ? ImVec4(43 / 255.0f, 64 / 255.0f, 54 / 255.0f, 1.00f) : ImVec4(0.86f, 0.99f, 0.91f, 1.00f));
|
||||
|
@ -229,14 +230,14 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit)
|
|||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 1.0);
|
||||
}
|
||||
bool btn_clicked = ImGui::Button(into_u8(btn_name).c_str());
|
||||
if (m_current_tool == tool_icons[i])
|
||||
if (m_current_tool == tool_ids[i])
|
||||
{
|
||||
ImGui::PopStyleColor(4);
|
||||
ImGui::PopStyleVar(2);
|
||||
}
|
||||
ImGui::PopStyleVar(1);
|
||||
if (btn_clicked && m_current_tool != tool_icons[i]) {
|
||||
m_current_tool = tool_icons[i];
|
||||
if (btn_clicked && m_current_tool != tool_ids[i]) {
|
||||
m_current_tool = tool_ids[i];
|
||||
for (auto& triangle_selector : m_triangle_selectors) {
|
||||
triangle_selector->seed_fill_unselect_all_triangles();
|
||||
triangle_selector->request_update_render_data();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue