diff --git a/src/slic3r/GUI/ImageGrid.cpp b/src/slic3r/GUI/ImageGrid.cpp index 036f79efa2..7b0cf287f0 100644 --- a/src/slic3r/GUI/ImageGrid.cpp +++ b/src/slic3r/GUI/ImageGrid.cpp @@ -368,14 +368,17 @@ void ImageGrid::resize(wxSizeEvent& event) void ImageGrid::mouseWheelMoved(wxMouseEvent &event) { - auto delta = event.GetWheelRotation() < 0 ? 1 : -1; - int off = m_row_offset + delta; - if (off >= 0 && off < m_row_count) { - m_row_offset = off; - m_timer.StartOnce(4000); // Show position bar - UpdateFocusRange(); - Refresh(); - } + auto delta = -event.GetWheelRotation(); + m_scroll_offset += delta; + int max = m_row_count * m_cell_size.GetHeight() / 4; + if (m_scroll_offset < 0) + m_scroll_offset = 0; + else if (m_scroll_offset >= max) + m_scroll_offset = max - 1; + m_row_offset = m_scroll_offset * 4 / m_cell_size.GetHeight(); + m_timer.StartOnce(4000); // Show position bar + UpdateFocusRange(); + Refresh(); } void Slic3r::GUI::ImageGrid::changedEvent(wxCommandEvent& evt) diff --git a/src/slic3r/GUI/ImageGrid.h b/src/slic3r/GUI/ImageGrid.h index 5a742d5817..8aef8a5e9d 100644 --- a/src/slic3r/GUI/ImageGrid.h +++ b/src/slic3r/GUI/ImageGrid.h @@ -122,6 +122,7 @@ private: int m_hit_type = HIT_NONE; size_t m_hit_item = size_t(-1); + int m_scroll_offset = 0; int m_row_offset = 0; // 1/4 row height int m_row_count = 0; // 1/4 row height int m_col_count = 1; diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index 7d6f9dd8c5..fd464498cd 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -432,7 +432,7 @@ void DropDown::mouseMove(wxMouseEvent &event) void DropDown::mouseWheelMoved(wxMouseEvent &event) { - auto delta = event.GetWheelRotation() > 0 ? rowSize.y : -rowSize.y; + auto delta = event.GetWheelRotation(); wxPoint pt2 = offset + wxPoint{0, delta}; if (pt2.y > 0) pt2.y = 0; diff --git a/src/slic3r/GUI/Widgets/WebView.cpp b/src/slic3r/GUI/Widgets/WebView.cpp index 251dfe007f..c835f3cfb0 100644 --- a/src/slic3r/GUI/Widgets/WebView.cpp +++ b/src/slic3r/GUI/Widgets/WebView.cpp @@ -110,7 +110,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url) webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) Mozilla/5.0 (Windows NT 10.0; Win64; x64) " "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.52", SLIC3R_VERSION, Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light")); - webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize); + webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); // We register the wxfs:// protocol for testing purposes webView->RegisterHandler(wxSharedPtr(new wxWebViewArchiveHandler("bbl"))); // And the memory: file system @@ -120,7 +120,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url) webView->RegisterHandler(wxSharedPtr(new wxWebViewArchiveHandler("wxfs"))); // And the memory: file system webView->RegisterHandler(wxSharedPtr(new wxWebViewFSHandler("memory"))); - webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize); + webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE); webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)", SLIC3R_VERSION, Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light")); #endif