diff --git a/resources/data/hints.ini b/resources/data/hints.ini index 384d62673..a5dc01c55 100644 --- a/resources/data/hints.ini +++ b/resources/data/hints.ini @@ -62,17 +62,17 @@ # Weight must be larger or equal to 1. Default weight is 1. # Weight defines probability as weight : sum_of_all_weights. -[hint:3D Scene Operations] -text = 3D Scene Operations\nDid you know how to control view and object/part selection with mouse and touchpanel in the 3D scene? +[hint:How to use keyboard shortcuts] +text = How to use keyboard shortcuts\nBambuStudio offers a wide range of keyboard shortcuts and 3D scene operations. documentation_link = https://wiki.bambulab.com/en/software/bambu-studio/3d-scene-operations -image = images/dailytips_3DScene.PNG [hint:Cut Tool] text = Cut Tool\nDid you know that you can cut a model at any angle and position with the cutting tool? documentation_link = https://wiki.bambulab.com/en/software/bambu-studio/cut-tool +image = images/dailytips_CutTool.PNG [hint:Fix Model] -text = Fix Model\nDid you know that you can fix a corrupted 3D model to avoid a lot of slicing problems? +text = Fix Model\nDid you know that you can fix a corrupted 3D model to avoid a lot of slicing problems on the Windows system? documentation_link = https://wiki.bambulab.com/en/software/bambu-studio/fix-model [hint:Timelapse] @@ -180,6 +180,9 @@ text = Improve strength\nDid you know that you can use more wall loops and highe text = When need to print with the printer door opened\nOpening the printer door can reduce the probability of extruder/hotend clogging when printing lower temperature filament with a higher enclosure temperature. More info about this in the Wiki. documentation_link= https://wiki.bambulab.com/en/filament-acc/filament/heat-creep +[hint:Avoid warping] +text = Avoid warping\nWhen printing materials that are prone to warping such as ABS, appropriately increasing the heatbed temperature can reduce the probability of warping. + #[hint:] #text = #hypertext = diff --git a/resources/images/dailytips_3DScene.PNG b/resources/images/dailytips_CutTool.PNG similarity index 100% rename from resources/images/dailytips_3DScene.PNG rename to resources/images/dailytips_CutTool.PNG diff --git a/resources/images/dailytips_placeholder.png b/resources/images/dailytips_placeholder.png index 17b613721..ef9bf6fe7 100644 Binary files a/resources/images/dailytips_placeholder.png and b/resources/images/dailytips_placeholder.png differ diff --git a/resources/images/notification_arrow_left.svg b/resources/images/notification_arrow_left.svg index 376e6f66c..f4b4616c1 100644 --- a/resources/images/notification_arrow_left.svg +++ b/resources/images/notification_arrow_left.svg @@ -1,10 +1,3 @@ - - - - - - - - + diff --git a/resources/images/notification_arrow_left_hovered.svg b/resources/images/notification_arrow_left_hovered.svg deleted file mode 100644 index f59a1f60b..000000000 --- a/resources/images/notification_arrow_left_hovered.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/resources/images/notification_arrow_right.svg b/resources/images/notification_arrow_right.svg index 4a49293fc..c6784277e 100644 --- a/resources/images/notification_arrow_right.svg +++ b/resources/images/notification_arrow_right.svg @@ -1,10 +1,3 @@ - - - - - - - - + diff --git a/resources/images/notification_arrow_right_hovered.svg b/resources/images/notification_arrow_right_hovered.svg deleted file mode 100644 index 0745ac2b2..000000000 --- a/resources/images/notification_arrow_right_hovered.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/resources/images/notification_expand.svg b/resources/images/notification_expand.svg index 66177698b..91ac2a55b 100644 --- a/resources/images/notification_expand.svg +++ b/resources/images/notification_expand.svg @@ -1,3 +1,3 @@ - + diff --git a/src/slic3r/GUI/DailyTips.cpp b/src/slic3r/GUI/DailyTips.cpp index d5eb9a034..c469f6ec9 100644 --- a/src/slic3r/GUI/DailyTips.cpp +++ b/src/slic3r/GUI/DailyTips.cpp @@ -24,6 +24,7 @@ public: void update_data(const DailyTipsData& data); void render(const ImVec2& pos, const ImVec2& size) const; bool has_image() const; + void on_change_color_mode(bool is_dark); protected: void load_texture_from_img_url(const std::string url); @@ -36,6 +37,7 @@ private: DailyTipsData m_data; GLTexture* m_texture{ nullptr }; GLTexture* m_placeholder_texture{ nullptr }; + bool m_is_dark{ false }; }; DailyTipsDataRenderer::~DailyTipsDataRenderer() { @@ -98,12 +100,17 @@ bool DailyTipsDataRenderer::has_image() const return !m_data.img_url.empty(); } +void DailyTipsDataRenderer::on_change_color_mode(bool is_dark) +{ + m_is_dark = is_dark; +} + void DailyTipsDataRenderer::render_img(const ImVec2& start_pos, const ImVec2& size) const { if (has_image()) - ImGui::Image((ImTextureID)(intptr_t)m_texture->get_id(), size); + ImGui::Image((ImTextureID)(intptr_t)m_texture->get_id(), size, ImVec2(0, 0), ImVec2(1, 1), m_is_dark ? ImVec4(0.8, 0.8, 0.8, 1) : ImVec4(1, 1, 1, 1)); else { - ImGui::Image((ImTextureID)(intptr_t)m_placeholder_texture->get_id(), size); + ImGui::Image((ImTextureID)(intptr_t)m_placeholder_texture->get_id(), size, ImVec2(0, 0), ImVec2(1, 1), m_is_dark ? ImVec4(0.8, 0.8, 0.8, 1) : ImVec4(1, 1, 1, 1)); } } @@ -200,6 +207,11 @@ void DailyTipsPanel::set_size(const ImVec2& size) m_content_height = m_height - m_header_height - m_footer_height; } +void DailyTipsPanel::set_can_expand(bool can_expand) +{ + m_can_expand = can_expand; +} + ImVec2 DailyTipsPanel::get_size() { return ImVec2(m_width, m_height); @@ -315,6 +327,12 @@ void DailyTipsPanel::set_scale(float scale) m_scale = scale; } +void DailyTipsPanel::on_change_color_mode(bool is_dark) +{ + m_is_dark = is_dark; + m_dailytips_renderer->on_change_color_mode(is_dark); +} + void DailyTipsPanel::render_header(const ImVec2& pos, const ImVec2& size) { ImGuiWrapper& imgui = *wxGetApp().imgui(); @@ -378,6 +396,7 @@ void DailyTipsPanel::render_controller_buttons(const ImVec2& pos, const ImVec2& ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f)); + ImGui::PushStyleColor(ImGuiCol_Text, m_is_dark ? ImColor(230, 230, 230).Value : ImColor(38, 46, 48).Value); // for bold font text, split text and icon-font button imgui.push_bold_font(); @@ -385,7 +404,6 @@ void DailyTipsPanel::render_controller_buttons(const ImVec2& pos, const ImVec2& imgui.pop_bold_font(); ImVec2 expand_btn_size = ImGui::CalcTextSize((_u8L("Daily Tips")).c_str()); ImGui::SetCursorScreenPos(ImVec2(btn_pos.x + expand_btn_size.x + ImGui::CalcTextSize(" ").x, btn_pos.y)); - std::wstring button_text; button_text = ImGui::ExpandArrowIcon; imgui.button(button_text.c_str()); expand_btn_size.x += 19.0f * m_scale; @@ -397,13 +415,13 @@ void DailyTipsPanel::render_controller_buttons(const ImVec2& pos, const ImVec2& lineEnd.y -= 2; ImVec2 lineStart = lineEnd; lineStart.x = ImGui::GetItemRectMin().x - expand_btn_size.x; - ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, ImColor(38, 46, 48)); + ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, m_is_dark ? ImColor(230, 230, 230) : ImColor(38, 46, 48)); if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) expand(); } - ImGui::PopStyleColor(3); + ImGui::PopStyleColor(4); ImGui::EndChild(); return; @@ -426,33 +444,38 @@ void DailyTipsPanel::render_controller_buttons(const ImVec2& pos, const ImVec2& ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(.0f, .0f, .0f, .0f)); - ImGui::PushStyleColor(ImGuiCol_Text, ImColor(255, 255, 255).Value);// for icon-font button // prev button + ImColor button_text_color = m_is_dark ? ImColor(228, 228, 228) : ImColor(38, 46, 48); ImVec2 prev_button_pos = pos + size + ImVec2(-button_margin_x - button_size.x * 2, -size.y); ImGui::SetCursorScreenPos(prev_button_pos); button_text = ImGui::PrevArrowBtnIcon; if (ImGui::IsMouseHoveringRect(prev_button_pos, prev_button_pos + button_size, true)) { - button_text = ImGui::PrevArrowHoverBtnIcon; + button_text_color = ImColor(0, 174, 66); if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) retrieve_data_from_hint_database(HintDataNavigation::Prev); } + ImGui::PushStyleColor(ImGuiCol_Text, button_text_color.Value);// for icon-font button imgui.button(button_text.c_str()); + ImGui::PopStyleColor(); // next button + button_text_color = m_is_dark ? ImColor(228, 228, 228) : ImColor(38, 46, 48); ImVec2 next_button_pos = pos + size + ImVec2(-button_size.x, -size.y); ImGui::SetCursorScreenPos(next_button_pos); button_text = ImGui::NextArrowBtnIcon; if (ImGui::IsMouseHoveringRect(next_button_pos, next_button_pos + button_size, true)) { - button_text = ImGui::NextArrowHoverBtnIcon; + button_text_color = ImColor(0, 174, 66); if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) retrieve_data_from_hint_database(HintDataNavigation::Next); } + ImGui::PushStyleColor(ImGuiCol_Text, button_text_color.Value);// for icon-font button imgui.button(button_text.c_str()); - - ImGui::PopStyleColor(5); + ImGui::PopStyleColor(); + + ImGui::PopStyleColor(4); } ImGui::EndChild(); } @@ -555,6 +578,7 @@ void DailyTipsWindow::set_scale(float scale) void DailyTipsWindow::on_change_color_mode(bool is_dark) { m_is_dark = is_dark; + m_panel->on_change_color_mode(is_dark); } }} \ No newline at end of file diff --git a/src/slic3r/GUI/DailyTips.hpp b/src/slic3r/GUI/DailyTips.hpp index afb181d62..e548db1c4 100644 --- a/src/slic3r/GUI/DailyTips.hpp +++ b/src/slic3r/GUI/DailyTips.hpp @@ -18,6 +18,7 @@ public: DailyTipsPanel(const ImVec2& pos, const ImVec2& size, bool can_expand = true); void set_position(const ImVec2& pos); void set_size(const ImVec2& size); + void set_can_expand(bool can_expand); ImVec2 get_size(); void render(); void retrieve_data_from_hint_database(HintDataNavigation nav); @@ -25,6 +26,7 @@ public: void collapse(); bool is_expanded(); void set_scale(float scale); + void on_change_color_mode(bool is_dark); protected: void render_header(const ImVec2& pos, const ImVec2& size); @@ -47,6 +49,7 @@ private: int m_uid; bool m_first_enter{ false }; float m_scale = 1.0f; + bool m_is_dark{ false }; }; class DailyTipsWindow { diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 1034aa592..2912946e6 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -124,9 +124,7 @@ static const std::map font_icons_large = { //{ImGui::DocumentationHoverDarkButton, "notification_documentation_hover_dark"}, {ImGui::BlockNotifErrorIcon, "block_notification_error" }, {ImGui::PrevArrowBtnIcon, "notification_arrow_left" }, - {ImGui::PrevArrowHoverBtnIcon, "notification_arrow_left_hovered" }, {ImGui::NextArrowBtnIcon, "notification_arrow_right" }, - {ImGui::NextArrowHoverBtnIcon, "notification_arrow_right_hovered" }, {ImGui::CompleteIcon, "notification_slicing_complete" }, }; diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index f86b9ec2f..af8b17309 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -415,7 +415,7 @@ private: // set start of notification to now. Used by delayed notifications void reset_timer() { m_notification_start = GLCanvas3D::timestamp_now(); m_state = EState::Shown; } void set_Multiline(bool Multi) { m_multiline = Multi; } - void on_change_color_mode(bool is_dark); + virtual void on_change_color_mode(bool is_dark); void set_scale(float scale) { m_scale = scale; } protected: diff --git a/src/slic3r/GUI/SlicingProgressNotification.cpp b/src/slic3r/GUI/SlicingProgressNotification.cpp index 4d6133168..8dbff8862 100644 --- a/src/slic3r/GUI/SlicingProgressNotification.cpp +++ b/src/slic3r/GUI/SlicingProgressNotification.cpp @@ -20,6 +20,12 @@ namespace { static constexpr int BEFORE_COMPLETE_DURATION = 3000; //ms static constexpr int REFRESH_TIMEOUT = 100; //ms +void NotificationManager::SlicingProgressNotification::on_change_color_mode(bool is_dark) +{ + PopNotification::on_change_color_mode(is_dark); + m_dailytips_panel->on_change_color_mode(is_dark); +} + void NotificationManager::SlicingProgressNotification::init() { if (m_sp_state == SlicingProgressState::SP_PROGRESS) { @@ -413,6 +419,10 @@ void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_bar(c void NotificationManager::SlicingProgressNotification::render_dailytips_panel(const ImVec2& pos, const ImVec2& size) { + if (m_sp_state == SlicingProgressState::SP_BEFORE_COMPLETED) + m_dailytips_panel->set_can_expand(false); + else + m_dailytips_panel->set_can_expand(true); m_dailytips_panel->set_scale(m_scale); m_dailytips_panel->set_position(pos); m_dailytips_panel->set_size(size); diff --git a/src/slic3r/GUI/SlicingProgressNotification.hpp b/src/slic3r/GUI/SlicingProgressNotification.hpp index 544e3783e..8d6916baf 100644 --- a/src/slic3r/GUI/SlicingProgressNotification.hpp +++ b/src/slic3r/GUI/SlicingProgressNotification.hpp @@ -48,6 +48,7 @@ public: // Switch between technology to provide correct text. void set_fff(bool b) { m_is_fff = b; } void set_export_possible(bool b) { m_export_possible = b; } + void on_change_color_mode(bool is_dark) override; protected: void init() override; void render(GLCanvas3D& canvas, float initial_y, bool move_from_overlay, float overlay_width, float right_margin) override;