From 047b889ba63ae4e9d836c0be59be64ec846c7251 Mon Sep 17 00:00:00 2001 From: Ocraftyone Date: Tue, 27 Feb 2024 09:03:59 -0500 Subject: [PATCH] ENH: Better Scrolling Over Multiline Fields (#4218) * Improve scrolling over multiline fields * Fix text control scrolling --- src/slic3r/GUI/Field.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 65cac2cc5e..aa366e20ec 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -588,6 +588,14 @@ void TextCtrl::BUILD() { EnterPressed enter(this); propagate_value(); }), text_ctrl->GetId()); + } else { + // Orca: adds logic that scrolls the parent if the text control doesn't have focus + text_ctrl->Bind(wxEVT_MOUSEWHEEL, [text_ctrl](wxMouseEvent& event) { + if (text_ctrl->HasFocus() && text_ctrl->GetScrollRange(wxVERTICAL) != 1) + event.Skip(); // don't consume the event so that the text control will scroll + else + text_ctrl->GetParent()->ScrollLines((event.GetWheelRotation() > 0 ? -1 : 1) * event.GetLinesPerAction()); + }); } text_ctrl->Bind(wxEVT_LEFT_DOWN, ([temp](wxEvent &event)