From bbf60535444c486c3ed49d51c3bccc609c1a2acd Mon Sep 17 00:00:00 2001 From: Lukasz Kozakiewicz Date: Thu, 19 Oct 2017 15:13:06 +0200 Subject: [PATCH] =?UTF-8?q?Viewport:=20=20=20enable=20=E2=80=9Cscroll=20on?= =?UTF-8?q?=20drag=E2=80=9D=20mode=20by=20default=20on=20Android=20and=20i?= =?UTF-8?q?OS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BREAKING-CHANGES.txt | 23 +++++++++++++++++++ .../juce_gui_basics/layout/juce_Viewport.cpp | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/BREAKING-CHANGES.txt b/BREAKING-CHANGES.txt index 3b89431975..87f6a4e652 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -1,5 +1,28 @@ JUCE breaking changes ===================== + +develop +============= + +Change +------ +Viewport now enables "scroll on drag" mode by default on Android and iOS. + +Possible Issues +--------------- +Any code relying on "scroll on drag" mode being turned off by default, should disable +it manually. + +Workaround +---------- +None. + +Rationale +--------- +It is expected on mobile devices to be able to scroll a list by just a drag, +rather than using a dedicated scrollbar. The scrollbar is still available though if +needed. + Version 5.1.2 ============= diff --git a/modules/juce_gui_basics/layout/juce_Viewport.cpp b/modules/juce_gui_basics/layout/juce_Viewport.cpp index e1b940a49a..632fb11605 100644 --- a/modules/juce_gui_basics/layout/juce_Viewport.cpp +++ b/modules/juce_gui_basics/layout/juce_Viewport.cpp @@ -38,6 +38,10 @@ Viewport::Viewport (const String& name) : Component (name) setInterceptsMouseClicks (false, true); setWantsKeyboardFocus (true); + #if JUCE_ANDROID || JUCE_IOS + setScrollOnDragEnabled (true); + #endif + recreateScrollbars(); }