aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollbar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ScrollBar: react immediately when using a mouseJ-P Nurmi2017-04-101-0/+1
| | | | | | | | | | | | | | | The initial drag threshold is a necessary evil on touch to avoid conflicting with flickables, but leads to bad experience (QTBUG-47081) when using a mouse. Now that we have separate mouse and touch handling, we can apply immediate moves when using a mouse, but keep the old behavior on touch. [ChangeLog][Important Behavior Changes] ScrollBar now reacts immediately when using a mouse. Task-number: QTBUG-58667 Change-Id: I51759fc01dc8b8536834a8a3cca635ff512f7dc9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: handle touch eventsJ-P Nurmi2017-04-101-0/+52
| | | | | Change-Id: I0521eb36ee01abc72edc869d92910e823f00a2f2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Set explicit cursors on all interactive controlsJ-P Nurmi2017-04-051-2/+11
| | | | | | | | | | | | For example, if you have a floating button on top of a text editor, hovering the button must change the cursor from the editor's ibeam cursor to an arrow cursor. This applies to all interactive controls that call setAcceptedMouseButtons(). If a control blocks mouse events, it should not use some random cursor from another control underneath. Task-number: QTBUG-59629 Change-Id: I8a6ae306bbc76a9b22377361cb19cf9c3a872d31 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: set implicit Cursor as Qt::ArrowCursorKarol Polak2017-04-041-0/+3
| | | | | | | | Scrollbar over TextArea had Qt::IBeamCursor, although the textarea would not be activated when clicked. Task-number: QTBUG-59629 Change-Id: Ie96ba03360fcfb5872f5bb6345e168c987978aca Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Port from QT_NO_ACCESSIBILITY to QT_CONFIG(accessibility)J-P Nurmi2017-02-241-1/+1
| | | | | Change-Id: I03deebff661746d49e537af5b1c8899b938efb0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add "hover support" configure featureJ-P Nurmi2017-02-061-1/+8
| | | | | | | | | | ./configure -no-feature-quicktemplates2-hover [...] Qt Quick Templates 2: Hover support .......................... no Change-Id: I0509a1a9ac3ffe2cbfe4f2016ce0345708860b84 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ScrollViewJ-P Nurmi2017-01-271-2/+13
| | | | | | | | [ChangeLog][Controls][ScrollView] Added ScrollView. Change-Id: I5d68799f0246e04b519bf6a0ec7bc7e5625f50e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQuickScrollBarAttached: fix change listener removalJ-P Nurmi2017-01-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before bb2a6c6 QQuickScrollBarAttached called flickable->updateOrAddGeometryChangeListener(Size) when attaching to a Flickable, and flickable->removeItemChangeListener(Geometry) when detaching from a Flickable. In bb2a6c6 the latter was changed to flickable->updateOrRemoveGeometryChangeListener(listener, Size) to make the attach and detach operations nice and symmetric. Now the problem is that updateOrRemoveGeometryChangeListener(Size) doesn't actually remove the listener, but just resets the geometry types it listens to. Thus, upon destruction of QQuickScrollBarAttached, it leaves behind a dangling pointer in Flickable's list of change listeners. We can call either of these to fix the problem: flickable->updateOrRemoveGeometryChangeListener(Nothing) flickable->removeItemChangeListener(Geometry) The former does essentially the latter with some extra overhead, so we'll just revert back to how it was before bb2a6c6. I added a warning note, also to ScrollIndicator since it's using the same approach, to avoid the same pitfall in the future. Change-Id: Ibdce15b22edf549491426d769b74b18daf0500ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Keep track whether ScrollBar::interactive is explicitly setJ-P Nurmi2017-01-261-7/+22
| | | | | | | | | | The upcoming ScrollView toggles between interactive and non-interactive scroll bars depending on whether it is interacted via touch or a mouse device. This allows ScrollView to check whether the user or style explicitly requested a specific mode and respect it. Change-Id: I69d21652b3a91cb9db0f76ba52adc35ccd612ab1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickScrollBarAttachedPrivate::setFlickable()J-P Nurmi2017-01-231-48/+108
| | | | | | | | | | QQuickScrollBarAttached was assuming that a QQuickFlickable instance was passed to the constructor. This patch allows specifying it after the construction, making it possible for the upcoming ScrollView to use attached scrollbars. Change-Id: I7c434734f74df65af86263f09da6a46fa68fc946 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: fix overshootJ-P Nurmi2017-01-201-8/+11
| | | | | | | | | | | | ScrollBar should not always force a range of 0.0-1.0, but only when interacted with. This way, the scrollbar stops at bounds when dragged, but flicking the attached Flickable respects its boundsBehavior and overshoots if appropriate. The logic and test is adapted from QQuickScrollIndicator commit 8d093a. Change-Id: Ida720d4cc2bb1de06ba0c02dfb25be51dd3108fc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ScrollBar::policyJ-P Nurmi2017-01-201-1/+33
| | | | | | | | [ChangeLog][Controls][ScrollBar] Added a policy-property, which holds whether the scroll bar is shown always/never/as needed (default). Change-Id: Ibe25edaef04a7926bc12c59913efa7a3d43a5ccf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Move QQuickScrollBar(Attached)Private to a private headerJ-P Nurmi2017-01-201-74/+19
| | | | | | | To make the private classes accessible for the upcoming ScrollView. Change-Id: Iae1d7f9b136a99ac5892418c52071a902e665476 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: fix layouting on implicit size changesJ-P Nurmi2017-01-201-6/+24
| | | | | Change-Id: I1816926e7f23324e6143db40d7352524737c0168 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ScrollBar: fix memory leak when attached to a non-FlickableJ-P Nurmi2017-01-201-13/+10
| | | | | | | | We must pass the attachee QObject as a parent instead of passing a qobject_casted QQuickFlickable, which may be a null pointer. Change-Id: If3c785beac76ad989d12579e6d41062f4754ba2e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ScrollBar::interactiveJ-P Nurmi2017-01-201-1/+32
| | | | | | | | | | | [ChangeLog][Controls][ScrollBar] Added an interactive-property. A non-interactive ScrollBar is visually and behaviorally similar to ScrollIndicator. This property is useful for switching between typical mouse- and touch-orientated UIs with interactive and non- interactive scroll bars, respectively. Change-Id: Ie98bfa0b5bba94a9751baf3c65f17b850b58fd1f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-4/+4
| | | | | | | | | | | It was a bit inconsistent before. Admittedly the colon at the end was the most commonly used style in the quicktemplates2 code base, but some had a line-break before the colon. This is now chosen as the one true coding style of QQC2. ;) It makes the initializer list aligned so that it stands out from the constructor body. Change-Id: I66835e088df90d7219af04915176006d2a934ddc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Format initializer listsJ-P Nurmi2017-01-191-4/+16
| | | | | | | | Initialize one member per line. Allow empty constructors with one initialized member on a single line. Change-Id: Ie115802561ebd19efd4dacda1fa868b64d279109 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQuickControls2: Use the newly-introduced qmlWarning instead of qmlInfoRobin Burchell2017-01-131-1/+1
| | | | | | | | qmlInfo will shortly be returning info-level messages (as the name hints), rather than warning level messages. Change-Id: I94123464b12b30a4ba085cfb7b606bc26df9b76e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add ScrollBar::snapModeJ-P Nurmi2017-01-101-4/+61
| | | | | | | | | | | | | | | | | | [ChangeLog][Controls][ScrollBar] Added snapMode property incremental or discrete scrolling. Task-number: QTBUG-56569 Change-Id: Id0d463b85063a62b7df6307af8fe8b203155a5de Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Revise QScrollBar internalsJ-P Nurmi2017-01-101-10/+47
|/ | | | | | | | Move the press/move/release/ungrab logic from mouse event handlers to QQuickScrollBarPrivate methods that can be re-used for touch events. Change-Id: Id0b0f225a4f86a9d9cc8b77c9253001dd6c40bf4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Prepare for a change to itemGeometryChangedErik Verbruggen2016-11-091-0/+8
| | | | | | | | | In an upcoming patch for qtdeclarative, the rectangle passed to itemGeometryChanged will be the old geometry instead of the difference between the old an the new geometry. Change-Id: If096d4986900fea6ada10b18088de12490c9171b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-031-2/+49
|\ | | | | | | | | | | | | Conflicts: tests/auto/accessibility/tst_accessibility.cpp Change-Id: I8c3ccb301730ecdc0acdcb75de607cdd4f753e15
| * ScrollBar: Fix documentation review findingsMitch Curtis2016-11-031-2/+49
| | | | | | | | | | | | Change-Id: I83703bf0188aa52b873f717b3470ceba4a4d670e Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/Drawer.qml src/imports/controls/Frame.qml src/imports/controls/GroupBox.qml src/imports/controls/Page.qml src/imports/controls/Pane.qml src/imports/controls/ToolBar.qml src/imports/controls/Tumbler.qml src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickpopup.cpp tests/auto/accessibility/data/busyindicator.qml tests/auto/accessibility/data/button.qml tests/auto/accessibility/data/checkbox.qml tests/auto/accessibility/data/control.qml tests/auto/accessibility/data/dial.qml tests/auto/accessibility/data/label.qml tests/auto/accessibility/data/menu.qml tests/auto/accessibility/data/pageindicator.qml tests/auto/accessibility/data/popup.qml tests/auto/accessibility/data/progressbar.qml tests/auto/accessibility/data/radiobutton.qml tests/auto/accessibility/data/rangeslider.qml tests/auto/accessibility/data/scrollbar.qml tests/auto/accessibility/data/scrollindicator.qml tests/auto/accessibility/data/slider.qml tests/auto/accessibility/data/spinbox.qml tests/auto/accessibility/data/switch.qml tests/auto/accessibility/data/tabbar.qml tests/auto/accessibility/data/tabbutton.qml tests/auto/accessibility/data/textarea.qml tests/auto/accessibility/data/textfield.qml tests/auto/accessibility/data/toolbar.qml tests/auto/accessibility/data/toolbutton.qml tests/auto/accessibility/tst_accessibility.cpp Change-Id: Ibc3f592162e97bef9147b35da8c9a79e73a907e6
| * Doc: revise brief descriptionsJ-P Nurmi2016-11-021-1/+1
| | | | | | | | | | | | Change-Id: If7bdd4c11aaeb2df87622c769b1a65ac82ac7e73 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-311-3/+30
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/CheckIndicator.qml src/imports/controls/RadioIndicator.qml src/imports/controls/RangeSlider.qml src/imports/controls/Slider.qml src/imports/controls/SwitchIndicator.qml Change-Id: I32612d2f905ffa02dbaedbb1f84c8237fbd66db3
| * Scrollers: give control over layouting if parent != flickableJ-P Nurmi2016-10-281-3/+30
| | | | | | | | | | | | | | | | | | This allows utilizing the convenient attached properties of ScrollBar and ScrollIndicator, but positioning the scrollers outside of a clipping Flickable. Change-Id: I46fe79110658f4797469d042c56f51548eef6c70 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-2/+4
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * ScrollBar::increase/decrease(): remember the previous active statusJ-P Nurmi2016-10-171-2/+4
| | | | | | | | | | | | | | | | | | These methods toggle the active status to flash the scrollbar. The active status must not be inactivated if the scrollbar was already active while increasing or decreasing eg. via buttons. Change-Id: I2902f58a26ab5e56ff89aa921cae7a7ae8404ee3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | ScrollBar: keep active while hoveredJ-P Nurmi2016-10-171-4/+16
| | | | | | | | | | | | | | Improves usability on desktop, when hover is enabled. Change-Id: Ib67db80e278a9369da73d81946a9001d432376aa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-071-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml src/quicktemplates2/qquickmenu.cpp tests/auto/controls/data/tst_buttongroup.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ib6042a0ad716f557927e7412d17ea8957d06c015
| * ScrollBar: replace PNGs with GIFsMitch Curtis2016-10-061-2/+2
| | | | | | | | | | | | Change-Id: I0c0f23b88c0ce36d43bc31321371508ec63c2903 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Fix missing scroll bars and indicatorsJ-P Nurmi2016-07-141-2/+2
| | | | | | | | | | | | | | | | The layouting code broke in commit aa823b2 that fixed the build after item change listener changes in qtdeclarative. Change-Id: Ife3c598c6aca03f0aebe1fdf32f5ca412de62f0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix build after QQuickItemChangeListener changesJ-P Nurmi2016-07-131-6/+6
|/ | | | | | | | qtdeclarative commit e2c296c changed the itemGeometryChanged() signature. Change-Id: Ibe163e1d6fe8535a4ec01de047d72a0d4863979d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar & Indicator: cleanup item change listenersJ-P Nurmi2016-06-141-6/+16
| | | | | | | | | | It's a bit uncertain how it managed to slip through the CI, but tst_controls is currently crashing consistently on Windows (MSVC 2015) during the cleanup of ScrollBar::test_mirrored(). This patch fixes the crash, which happens due to dangling listener pointers. Change-Id: I0a3640786f01f98e9a2bcb600913a7d5fbfe4823 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: fix layouting of mirrored vertical scrollbarJ-P Nurmi2016-06-131-2/+10
| | | | | Change-Id: I19630dc54f275ba2f8034c1ef45e5243586a8d23 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-2/+0
| | | | | Change-Id: I5b0015476c3ceef8f82b00d99b084b1ce3bfaa6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: rename Qt.labs.controls 1.0 to QtQuick.Controls 2.0J-P Nurmi2016-04-211-11/+11
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* ScrollBar|Indicator: use QQmlInfo and don't crash with non-FlickablesJ-P Nurmi2016-04-151-14/+18
| | | | | | | | | | | | | | Before: ScrollBar must be attached to a Flickable QQuickItem(0x1774640) The program has unexpectedly finished. After: qrc:/main.qml:9:5: QML : ScrollBar must be attached to a Flickable Change-Id: I689d70744f64e209eacb4cb743ad64e904f29cd4 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Templates: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. Change-Id: I39ef9cbb00f55a32b7a43f11ffbdfbb40b84e124 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Doc: add 2-suffix to the image assets and snippetsJ-P Nurmi2016-04-131-2/+2
| | | | | Change-Id: Ib8050cb3baefe07d28c7e2dcec64af155d2d7c9b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-0/+620
Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>