From 1de422e93219ea3913cc47f95723b0ee025e2e1a Mon Sep 17 00:00:00 2001 From: David Kocik Date: Fri, 1 Oct 2021 16:47:19 +0200 Subject: [PATCH] refactor mr. clippy rendering --- src/slic3r/GUI/HintNotification.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp index 4a97f24846..1963e79155 100644 --- a/src/slic3r/GUI/HintNotification.cpp +++ b/src/slic3r/GUI/HintNotification.cpp @@ -917,29 +917,14 @@ void NotificationManager::HintNotification::render_right_arrow_button(ImGuiWrapp } void NotificationManager::HintNotification::render_logo(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y) { - ImVec2 win_size(win_size_x, win_size_y); - ImVec2 win_pos(win_pos_x, win_pos_y); - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f)); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f)); - push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity); - push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f)); - - std::wstring button_text; - button_text = ImGui::ClippyMarker;//LeftArrowButton; std::string placeholder_text; placeholder_text = ImGui::EjectButton; - ImVec2 button_pic_size = ImGui::CalcTextSize(placeholder_text.c_str()); - ImVec2 button_size(button_pic_size.x * 1.25f * 2.f, button_pic_size.y * 1.25f * 2.f); - ImGui::SetCursorPosY(win_size.y / 2 - button_size.y * 1.1f); - ImGui::SetCursorPosX(0); - // shouldnt it render as text? - if (imgui.button(button_text.c_str(), button_size.x, button_size.y)) - { - } - - ImGui::PopStyleColor(5); + std::wstring text; + text = ImGui::ClippyMarker; + ImGui::SetCursorPosX(button_pic_size.x / 3); + ImGui::SetCursorPosY(win_size_y / 2 - button_pic_size.y * 2.f); + imgui.text(text.c_str()); } void NotificationManager::HintNotification::render_documentation_button(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y) {