diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 3109ae7c9..e5aaad822 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2382,7 +2382,7 @@ void GLCanvas3D::on_size(wxSizeEvent& evt) { m_dirty = true; } - + void GLCanvas3D::on_idle(wxIdleEvent& evt) { if (!m_initialized) @@ -2395,7 +2395,7 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt) m_dirty |= notification_mgr->requires_render(); #endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT - + // FIXME m_dirty |= m_main_toolbar.update_items_state(); m_dirty |= m_undoredo_toolbar.update_items_state(); m_dirty |= wxGetApp().plater()->get_view_toolbar().update_items_state(); @@ -2404,23 +2404,17 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt) m_dirty |= mouse3d_controller_applied; #if ENABLE_NEW_NOTIFICATIONS_FADE_OUT - if (!m_dirty) { - if (notification_mgr->requires_update()) - evt.RequestMore(); - return; + if (notification_mgr->requires_update()) { + evt.RequestMore(); } -#else +#endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT + if (!m_dirty) return; -#endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT _refresh_if_shown_on_screen(); -#if ENABLE_NEW_NOTIFICATIONS_FADE_OUT - if (m_extra_frame_requested || mouse3d_controller_applied || notification_mgr->requires_update()) { -#else if (m_extra_frame_requested || mouse3d_controller_applied) { -#endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT m_dirty = true; m_extra_frame_requested = false; evt.RequestMore(); diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index 46371b037..79e7ea1c6 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -70,8 +70,8 @@ bool GLToolbarItem::update_visibility() bool ret = (m_data.visible != visible); if (ret) m_data.visible = visible; - - return ret; + // Return false for separator as it would always return true. + return is_separator() ? false : ret; } bool GLToolbarItem::update_enabled_state() diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 1adf984d7..aff72c136 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -20,6 +20,8 @@ static constexpr float GAP_WIDTH = 10.0f; static constexpr float SPACE_RIGHT_PANEL = 10.0f; #if ENABLE_NEW_NOTIFICATIONS_FADE_OUT static constexpr float FADING_OUT_DURATION = 2.0f; +// Time in Miliseconds after next render is requested +static constexpr int FADING_OUT_TIMEOUT = 100; #endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT namespace Slic3r { @@ -781,7 +783,7 @@ void NotificationManager::PopNotification::update_state() wxMilliClock_t curr_time = wxGetLocalTimeMillis() - m_fading_start; wxMilliClock_t no_render_time = wxGetLocalTimeMillis() - m_last_render_fading; m_current_fade_opacity = std::clamp(1.0f - 0.001f * static_cast<float>(curr_time.GetValue()) / FADING_OUT_DURATION, 0.0f, 1.0f); - if (no_render_time > 100) { + if (no_render_time > FADING_OUT_TIMEOUT) { m_last_render_fading = wxGetLocalTimeMillis(); m_state = EState::FadingOutRender; }