summaryrefslogtreecommitdiff
path: root/src/controls/Slider.qml
Commit message (Collapse)AuthorAgeFilesLines
* Update slider handle position when maximum changesFrederik Gladhorn2017-10-101-2/+2
| | | | | | | | | This is exactly the same as the minimum change, when the maximum is changed, the handle position needs to be re-evaluated. Task-number: QTBUG-63354 Change-Id: I13a67451190a3bb7915afe8e89501097c1dd3301 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Slider: Don't suppress updates by dragThreshold on non-touchscreensUlf Hermann2017-05-101-1/+1
| | | | | | | | | | | | When using a mouse, you want a slider to react immediately to input, not only if you move beyond a certain threshold. With the threshold it is very hard to accurately position the slider. On touchscreens, the threshold is necessary to allow for unrelated events, like flicking views, to not interfere with the value. Change-Id: I6cb8252338f20de559e062e738118593ffc1e099 Task-number: QTBUG-47081 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Prevent wheel events from escaping SliderJason Erb2017-03-021-0/+2
| | | | | | Task-number: QTBUG-42273 Change-Id: I31e77cbb5a149ad160f806529140165baf48c8ac Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-181-2/+4
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/controls/Private/qquickrangemodel.cpp src/controls/Private/qquickrangemodel_p.h src/controls/Private/qquickrangemodel_p_p.h src/layouts/qquicklayout.cpp tests/auto/controls/data/tst_rangemodel.qml Change-Id: I9c8f6326c6edf9ebb18dd538f76830e1b439ba8e
| * Slider: fix the handle's position when minimumValue is not 0Mitch Curtis2016-09-141-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __handlePos (badly named; it should be, e.g. __handleValueForPos) represents the value of the handle based on "fakeHandle"'s position. It is the result of range.valueForPosition() being called. However, the arguments to this function (fakeHandle.x and fakeHandle.y) don't always change when the values of the slider change, which leads to the x calculation for the handle delegate in SliderStyle having outdated information, causing the related bug. The fix for another bug already works around this issue by passing the relevant properties as arguments (which are ignored) to the function call. This is presumably done this way because it should be cheaper than forcing the JavaScript engine to evaluate a more clearly written expression where each related property is on its own line, for example. property real __handlePos: { range.positionAtMinimum, range.positionAtMaximum; return range.valueForPosition(__horizontal ? fakeHandle.x : fakeHandle.y); } In the case of the related bug, minimumValue has been updated, but __handlePos is still using the old value, causing the handle to be positioned incorrectly. So, we continue this tradition and add another property to the list of arguments. Task-number: QTBUG-51765 Change-Id: I40882872e668a867a8f5e5768244e199618bd769 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Revert "Fix Controls 1 types linking to Controls 2"Topi Reinio2016-06-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit b5a8306bf6d4949066872ac2afc8d0a01f716bd7. The incorrect \inherits commands caused property documentation from base types go missing. Task-number: QTBUG-54150 Change-Id: I0bbe604a6fe904d8e6a4596777262255a794ec62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix Controls 1 types linking to Controls 2v5.7.0-rc1v5.7.05.7.0Mitch Curtis2016-05-261-0/+1
| | | | | | | | | | | | Task-number: QTBUG-53529 Change-Id: I4933a03c49dee4e3edc56dd406f67073da341ac1 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Correct scrolling direction when using SlidersMorten Johan Sørvig2016-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Account for OS X "direct"/"inverted"/"australian" scrolling. This ensures that a touchpad right/left/up/down flick will move the slider handle in the same direction as the flick. This takes advantage of the recent addition of QWheelEvent::inverted in qtbase Change-Id: If51ec6f0cbc12a042a92aa55964633c9521469a9 Task-number: QTBUG-35972 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Unify license header usageAntti Kokko2016-02-041-12/+15
|/ | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I3c851bc24da89f6300b94199387d1adf16ca4f48 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Doc: Fix qtdoc warningsCaroline Chao2015-03-061-1/+1
| | | | | | | | | Mostly link errors and missing documentation. And removed useless references to {QtQuick.Controls.Styles} in the doc. Change-Id: Iad211a574c0bd23c84e067e0cbcc18c3e719cde7 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Merge Extras' styling system into Controls'.Mitch Curtis2015-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removes the duplicated style settings functionality in Extras and simplifies the installed styles directory structure. - Extras' Base style is now part of Controls' Base style, eliminating the need for a separate QtQuick.Extras.Styles import. The cost of doing this should be negligible: a few QML files and two images. If we didn't merge Extras' Baste style into Controls', we'd need extras-specific code in qquickcontrolssettings, as the default style search path is: qml/QtQuick/Controls/Styles/ Whereas the Extras Base style would be in: qml/QtQuick/Extras/Styles/ The Extras Base style can't go into Controls' Base style directory, either, because otherwise we'd have two qmldir files there. The Flat style doesn't have this problem because it is all contained in one plugin and gets installed into its own Flat/ folder. - Documentation now lists the Extras controls as \since QtQuick.Extras 1.4. - Adds the customcontrolsstyle auto test to ensure that custom styling is tested. Change-Id: I19ca7a8b7e1c1daa85b272f4ccf9a2f05c76e0d9 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devJ-P Nurmi2015-02-121-3/+6
|\ | | | | | | | | | | | | | | Conflicts: src/controls/TableView.qml tests/auto/controls/data/tst_gridlayout.qml Change-Id: I030bc50dc8fcf7b6b00e183dc3a67c3cd012f3fb
| * Slider: fix handle positionJ-P Nurmi2015-02-101-2/+5
| | | | | | | | | | | | Task-number: QTBUG-41255 Change-Id: I1f5a11659af750daf58410d42c92d3702e8c9f11 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
| * Disable hover on touchJ-P Nurmi2015-02-041-1/+1
| | | | | | | | | | | | Task-number: QTBUG-44267 Change-Id: I467f08ae6c5264b7e858022af9ff293117434018 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* | Controls: update license headersJ-P Nurmi2015-02-111-28/+24
|/ | | | | | | Change-Id: I77e7a218a958d76ac7ef7780f4be52a81f76fa6b Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.4.0Oswald Buddenhagen2014-11-101-5/+6
|\ | | | | | | Change-Id: I278a90bb0049a96008700f4e0128bd95c0fae1fd
| * Slider: don't clamp to the initial press pointJ-P Nurmi2014-11-071-1/+1
| | | | | | | | | | Change-Id: I5115bbab670f534dae44eb19c2208aff21293889 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
| * Slider: fix tap-to-set-value on touch screensJ-P Nurmi2014-11-051-4/+5
| | | | | | | | | | | | Change-Id: I7784b3a8266f889bc2079da4c64096eb9d50d6f5 Task-number: QTBUG-42252 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* | Doc: add a note about the tickmarksEnabled propertyCaroline Chao2014-11-101-0/+2
|/ | | | | Change-Id: I61e6029c813fd0258a24c6ea547190808f42edc9 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix up Slider documentation.Mitch Curtis2014-11-031-6/+6
| | | | | Change-Id: I85022aff7e3618aed49b8fbd4d1a817081a14982 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Slider: Hover only on the handleGabriel de Dietrich2014-10-311-16/+25
| | | | | | | | | | Most styles rely on the handle being hovered, not the whole slider. [ChangeLog][Slider] The hovered property is set only when the handle is hovered, not anymore on the groove Change-Id: I749b076c98fba8e344218e46637ec00d24c0250c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-07-091-1/+3
|\ | | | | | | | | | | | | Conflicts: src/controls/ToolBar.qml Change-Id: I5510496219a4ebe8bfced4192307219238ca9bb6
| * Doc: Added images and missing snippetsVenu2014-06-271-1/+3
| | | | | | | | | | | | Task-number: QTBUG-33799 Change-Id: I582518a73276d47cf63cf31411b5176a90acab6f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-06-251-4/+8
|\ \ | |/ | | | | | | | | | | | | Conflicts: .qmake.conf src/controls/Styles/Desktop/SpinBoxStyle.qml Change-Id: Ia501c1388a2af9f273ec2742abbfc766717ad9e6
| * Slider: fix behavior inside a flickable on touchJ-P Nurmi2014-06-231-4/+8
| | | | | | | | | | | | | | | | | | | | Do not move the handle immediately on press, but delay it until the drag is over the threshold. This makes Slider behave inside a flickable in a sensible way ie. the handle is not prematurely moved when flicking Change-Id: Ie02762717156e75be9db757330a95a3f50451f1a Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Fix Slider increments on keypressFrederik Gladhorn2014-05-261-4/+12
|/ | | | | | | | | Instead of always adding/subtracting 1/10 of the range use the step size when the arrow keys are pressed. In addition add accessible actions to inc/dec the value. Task-number: QTBUG-39099 Change-Id: I4fdf2adc8912ab1fa8838be56af4e798eeb59781 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Bump QtQuick.Controls import version to 1.2J-P Nurmi2014-04-071-1/+1
| | | | | Change-Id: Idc0b93cbfc2fe23e8be3bcaece672d06555a81f6 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Import QtQuick 2.2J-P Nurmi2014-04-071-1/+1
| | | | | Change-Id: Ifc9719ec6fbbd80b866c01eebc471d0ed121bd16 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Slider: don't prevent stealing until drag threshold is exceededShawn Rutledge2014-03-181-1/+9
| | | | | | | | | | | | | | | If a Slider is placed in a Flickable (or ListView, etc.), preventStealing means that you cannot flick the flickable by dragging over the Slider. It's better to postpone setting that until we detect whether the user is really attempting to drag the slider, because we don't want to rule out use cases such as vertical sliders in a horizontal ListView or vice-versa, so that you drag in one direction to move the slider and in another direction to flick. Platform drag threshold is exposed in Settings (from QStyleHints). (reverts/refines c9665f3e2d1eb12f1cc5a569c20f5d569fafde7f) Change-Id: I82feda6028f6effa5b26ad575a1933e48e971453 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Simplify Slider's MouseAreaFrederik Gladhorn2014-03-101-6/+1
| | | | | Change-Id: Ib7bc6a370a4cb2bac34d08f4191cca28b69a7185 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Accessible slider should not have value as nameFrederik Gladhorn2014-02-071-1/+0
| | | | | | | | The value is provided though the value interface which works already. Having the value as name as well leads to the value being read twice. Change-Id: I97483567c120aa149b52ba35f430aa5c63ad08b7 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Fix slider keyboard shortcuts in vertical orientationDavid Edmundson2013-12-041-2/+4
| | | | | Change-Id: Ib886a4bc9254d8e9c91ae52e927e651200b455a4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Doc: Fix links to Qt Quick Controls Styles itemsCaroline Chao2013-10-231-1/+1
| | | | | Change-Id: I406c159fbc573e8b0a999d85fd6fb546b71634ac Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Doc: Changed the \since argument to the Qt version.Jerome Pasion2013-09-261-1/+1
| | | | | | | | | | | | | | -1.0 types were introduced in Qt 5.1 -1.1 types were introduced in Qt 5.2 -The module versions are now taken from the \qmlmodule This change was only applied to \qmltype. For methods, signals, and properties, we keep the \since QtQuick.Controls <version> Task-number: QTBUG-32172 Change-Id: Iefa73d4a489aa285bae873f68ae9a228030f0115 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Update imports to 1.1 and remove version from qmlmodule definitionJens Bache-Wiig2013-09-101-2/+2
| | | | | Change-Id: Icb4c6d78225c072da787e4646a55d8cf71a5db7a Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Add support for drawing tick marks with base styleJens Bache-Wiig2013-08-141-1/+2
| | | | | | | | | | | Before this was simply not implemented. It is still a bit unclear how we should treat stepSize == 0 as the results are somewhat undefined. Task-number: QTBUG-31261 Change-Id: I7a8b877649a945cd6cb303cc034df677b0199a90 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Prevent stealing of mouse events from the slider handleFabian Bumberger2013-07-031-0/+2
| | | | | | | Otherwise it is impossible to add a slider to a horizontally oriented list view Change-Id: I241fb11f3eb1d9e55c4488330af2e1e839504f3d Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Expose hovered to our controls and document it consistentlyJens Bache-Wiig2013-06-061-7/+11
| | | | | | | | | The current solution is messy and we only expose it partially to some of our styles. I think we should simply expose this to all. Change-Id: Ia546d5657ea416df99c9d9d92cc714b7f1c928fe Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
* Fix warning in Slider when stepSize is setJens Bache-Wiig2013-06-041-8/+8
| | | | | | | | | Also adding a new test for stepSize Task-number: QTBUG-31441 Change-Id: Ib8d9cc2188b5f73b6b0ac866ade1a7edb1d662b7 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Docs: fix missing/leftover docs, types, tags...J-P Nurmi2013-05-301-13/+0
| | | | | | Task-number: QTBUG-31262 Change-Id: I6bf48604b9392a2a9c63c344363188a4693a8547 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Revert "Slider: Fix "Binding loop detected" warning"Jens Bache-Wiig2013-05-271-1/+1
| | | | | | | | | This reverts commit 1283dffcae90ace0cd97e10f28082318a3049271 As Tomasz pointed out, this causes a regression when setting value so we need to revise. Change-Id: I965b815b14b7ec7497e1a09d42fd973c74759f2b Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Slider: Fix "Binding loop detected" warningCaroline Chao2013-05-271-1/+1
| | | | | Change-Id: Iffdf1b65a3ac80af73c3567c49bf8f0a9070dccb Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Enable padding as a grouped propertyJens Bache-Wiig2013-05-241-1/+1
| | | | | | | | | We want padding to be a grouped property as the existing Margins property looks rather odd and insconsistent. Change-Id: I9e614f9161aaf01af200b19a1fb46a51beec6fb4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Make QQuickSettings::style a property with a notifier signalJ-P Nurmi2013-05-241-1/+1
| | | | | Change-Id: I9f1690524e29cd7fe0ab35be216aca9a6edd35ca Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Slider: pressing the handle should not change the slider positionJens Bache-Wiig2013-05-231-2/+10
| | | | | | | | | | We have to maintain the handle offset until the drag operation has ended. If the user clicks outside the handle, we center on the cursor position as before. Task-number: QTBUG-31042 Change-Id: I8f23d998774278c6353d31b6fffea54596f7158e Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix various issues with sliderJens Bache-Wiig2013-05-221-20/+31
| | | | | | | | | | | - Fixed missing press appearance of slider handle - Removed drag threshold when pulling handle - Ensure handle stays connected to mouse cursor by giving the fake handle size Task-number: QTBUG-31042 Change-Id: I289a48b5fa67dde2792590645b8630a7ae6518d9 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Refactor and clean up public style APIJens Bache-Wiig2013-05-081-0/+3
| | | | | Change-Id: I10271c860abd9b45a262e3548628e6a3026e1a4f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Doc: correct for compliancy with Writing GuidelinesNico Vertriest2013-05-071-0/+1
| | | | | | | | Task-number: QTBUG-30318 Change-Id: If3916f3250f202a5da4b1f8034ecfba984367af3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Remove hard dependency on widgetsJens Bache-Wiig2013-04-151-2/+1
| | | | | Change-Id: I1fabb4efcc931f12f0a65ac5c66e6e085108269b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Doc fix: Change double to realJan Arve Saether2013-04-121-5/+5
| | | | | Change-Id: Iccb50c20e7a5806bf4a72956eeb7097c1bf0ccc2 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>