aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls
Commit message (Collapse)AuthorAgeFilesLines
...
* nativestyle, transitionDuration: make property CONSTANTRichard Moe Gustavsen2020-10-141-1/+1
| | | | | | | | | | | | | | Even if the value of transitionDuration never change, the QML engine will still complain if you use the property in a binding, saying that it's not notifyable. So to silence the engine, make it CONSTANT. Also, in macos/ScrollBar.qml, ensure we actually read the transitionDuration from a styleitem (parent is apparently not). Change-Id: I58e89e8771dd645ecd8a0b75a7e3871845d270be Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* ScrollView: always clip implicitly created FlickableRichard Moe Gustavsen2020-10-141-1/+0
| | | | | | | | | | | | | | We almost always want to clip the flickable so that flickable contents doesn't show up outside the scrollview. The only time this is not really needed, is when the scrollview covers the whole window and the scrollbars are transient. But for that corner case, if this optimization is needed, the user can simply create his own flickable child inside the scrollview, and control clipping on it explicit. [ChangeLog][ScrollView] ScrollView now clips its contents by default. Change-Id: I44bd7a8c397b90e14d0b9d5db8ec6523da205648 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* macOS/ScrollView: don't create contentItem too earlyRichard Moe Gustavsen2020-10-141-5/+0
| | | | | | | | | | | | | | When creating the binding "contentItem.clip:" we accidentally also created the contentItem before the component was completed. Since the contentItem of a ScrollView is a Flickable, it meant that we ended up always creating an internal flickable from QQuickScrollViewPrivate::ensureFlickable, instead of using the Flickable child if there was one. So this binding cannot be used. Change-Id: I2e7ca63f64693adb1b524966fec82aef2b3fb658 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add optional imports for all the styles to controls/qmldirUlf Hermann2020-10-123-0/+23
| | | | | | | | This allows qmllint to find them. Change-Id: I33b8ad4b2a736d914e7522761c2e574e482b9460 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style, macOS: add scrollviewcornerRichard Moe Gustavsen2020-10-121-0/+8
| | | | | | | | | | | | | On macOS (Big Sur), when a ScrollView has both a vertical and a horizontal scrollbar, we should draw a corner item between them so that they look 'connected'. Since we don't have a way to draw that item using QStyle, we simply grab a section of the center of a ScrollBar groove, and use that to create a corner item. Change-Id: I4e4df25b6769e810e6b046f6842f4424450fecb3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: ensure ScrollView contents doesn't go under the scrollbarsRichard Moe Gustavsen2020-10-092-0/+6
| | | | | | | | | On macOS the scrollbars are not transient. The contentItem of a ScrollView should therefore be aligned to the side of the scrollbars, rather than to the side of the ScrollView. Change-Id: Ie58753d61c04c979270995deb6e3b2650fa643db Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style, macOS: clip content view when ScrollView is clippedRichard Moe Gustavsen2020-10-091-0/+5
| | | | | | | | | | | | | On macOS, if a ScrollView has a clip set, we should clip the contentItem as well. This because the scrollbars are semi-transparent and non-transient (doesn't float on top), and in that case, the contents will show through them. So we assume that if the user sets a clip on the ScrollView, he want's to make sure that the contents is not showing outside the area where the contents are supposed to be. Change-Id: I7fff89843c0db38ec1caa6d18464e964788743c1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix static buildEskil Abrahamsen Blomfeldt2020-10-0914-1/+46
| | | | | | | | The register_types() function was optimized away by the linker and the imports would not be found. Change-Id: I3d98602daf78996399630b7b1296cc5dc0d3da05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix typo in Fusion impl's qmldirMitch Curtis2020-10-092-2/+2
| | | | | | | | | | This led to the following error: qtbug86891_qml_plugin_import.cpp:7: undefined reference to `qt_static_plugin_QtQuickControls2FusionStyleImpPlugin()' Change-Id: I5ec6b5c47215944281ce570dcb70a89e1afe72d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-0721-35/+78
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I4a690095fcd4b1141550de86b6820ae2dd579429 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Native style, macOS: handle focus frame special case from c++Richard Moe Gustavsen2020-10-061-7/+1
| | | | | | | | | | Move the expression that finds the correct target for TextArea from QML to C++. Keeping the code in QML simply became to messy when trying to also detect if a TextArea is inside a ScrollView. Change-Id: I3906dd37df73eaceffd60413d2378db7eab5f1bb Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* nativestyle: SpinBox on WindowsJan Arve Sæther2020-10-061-24/+26
| | | | | Change-Id: I334af68282a59099698e46020b0644318eae5cce Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* NativeStyle: add focus frame to the macOS styleRichard Moe Gustavsen2020-09-298-0/+55
| | | | | | | | | | | | | | This patch will add a focus frame to the macOS style. We use one focus frame item that we move around according to changes to the focus object. It's normally the background delegate's responsibility to draw a focus frame, so we take care to only draw the native focus frame for controls with default delegates. (to be consistent with the other styles) Change-Id: Iaa7202675c1aad2fc19682563ac1afb6e686c105 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Implement ScrollView.qml in all stylesRichard Moe Gustavsen2020-09-2922-0/+341
| | | | | | | | | | | | | | | | ScrollView.qml makes use of ScrollBar. While most of the styles override ScrollBar.qml, almost none override ScrollView.qml. This means that the ScrollView in Basic style will be used, and that ScrollView will always use it's own scrollbars, regardless if the overridden style provides another ScrollBar.qml. This patch will override ScrollView.qml for all the internal styles so that the correct scrollbars will be used. Change-Id: I1d9ba17f225a82b2dfaae6caba6ac4519f79a705 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* windows: Add hover animation to Button and CheckBoxJan Arve Sæther2020-09-293-3/+81
| | | | | | | | Move the hover animation handling API from macOS ScrollBar down to QQuickStyleItem. Change-Id: I36c8b173a15d0f4e10a59b7f3ccfe635e05c73e7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* CMake: Regenerate projects before API changeAlexandru Croitor2020-09-254-4/+0
| | | | | | | Task-number: QTBUG-86815 Change-Id: Ie0688d13b1787da3c1fc241a7d864aa014ca1d70 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* NativeStyle: rename 'nativeBackground' to '__nativeBackground'Richard Moe Gustavsen2020-09-253-18/+18
| | | | | | | | | Since all properties that we add to the QML style files will bleed into the API of the control, prepend '__' to nativeBackground to mark it as private. Change-Id: I0cb474e054c3a3824985cf39b4bb675fb57b0696 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Add Qt 6 changes filesPaul Wicking2020-09-242-0/+46
| | | | | | Task-number: QTBUG-84051 Change-Id: Ibfd1750b571f65bf76a3922f89510b6c6fd4eff9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Support compile-time style selectionMitch Curtis2020-09-243-73/+74
| | | | | | | | | | | | | | By allowing importing styles without first importing QtQuick.Controls, which does runtime style selection. [ChangeLog][Styles] It's now possible to select a style at compile-time by importing that style explicitly instead of QtQuick.Controls. This avoids the need to do run-time style selection and hence deploy the QtQuick.Controls plugin with the application. Change-Id: I666d6dc7727fffd2c7b05743855f2086f076465a Fixes: QTBUG-86284 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove QtQuick.Controls imports from styles' QML filesMitch Curtis2020-09-24194-194/+0
| | | | | | | | | | This is necessary to support compile-time style selection. If we don't do this, QtQuickControls2Plugin (which is now only used for run-time style selection) will be loaded unnecessarily. Task-number: QTBUG-86284 Change-Id: Id5338f147e3e97f25574ec98377d26b111f8341a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Rename "Default" style to "Basic"Mitch Curtis2020-09-24125-267/+267
| | | | | | | | | | | | [ChangeLog][Styles] The Default style was renamed to Basic to account for the introduction of the platform styles (macOS, Windows), which will be used by default (where possible) when no style is specified. Fixes: QTBUG-85984 Task-number: QTBUG-68814 Task-number: QTBUG-86403 Change-Id: I22b3199c8662e4ee5d55a1be1a51c9856ac62376 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix fallback styles overwriting themesMitch Curtis2020-09-2417-75/+221
| | | | | | | | | | | | | | | | | | | | | In Qt 5, QtQuickControls2Plugin::registerTypes() was responsible for calling initializeTheme() on each style plugin. Now that we delegate more work to the QML engine, each style plugin calls initializeTheme() via registerTypes(). To avoid fallback styles overwriting font and palette data set by the current style, we need to check if the theme has been intialized before calling initializeTheme(). To do this, we add a static "themeInitialized" bool that QQuickStylePlugin sets to true after calling intializeTheme() for the first time. It checks this value and avoids calling intializeTheme() if it's true. We also need to make QQuickStylePlugin ensure that the theme it's initializing belongs to the current style. Fixes: QTBUG-86303 Change-Id: Ie65e646677c78622829f4949c41cb79204cf5786 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QtQuickControls2Plugin: store style values returned from QQuickStyle APIMitch Curtis2020-09-241-18/+26
| | | | | | | | | | | | | In follow-up commits, QQuickStylePlugin will be reponsible for calling QQuickStylePrivate::reset(), which may happen before ~QtQuickControls2Plugin is called. To avoid issues, we need to store anything we need from QQuickStyle APIs so that we can be sure that it's valid in QtQuickControls2Plugin::unregisterTypes(). This also avoids unnecessary calls to QQuickStyleSpec::resolve(). Change-Id: I7f659b432741b96ee58452c4867b7ecd12c6cfde Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: implement implicit minimum sizeRichard Moe Gustavsen2020-09-171-1/+2
| | | | | | | | | | | | | | | | | | | | QStyle doesn't calculate a sensible minimum implicit size for us, only a implicit size that matches the size of the contents. This means that if the contents is empty (e.g a TextField that has no text), the implicit size will typically be smaller than what a sensible minimum should be. Note that for widgets, a sensible preffered size is set from the widgets themselves, and not QStyle. Which explains why the sizes we get from QStyle can sometimes be too small. Therefore, add a sensible minimum implicit size to all the controls that suffers from this problem. We let QStyle continue to calculate the actual minimum size given the contents as before (which will end up as the StyleItem's implicit size), and instead fix the recommended minimum size directly in the QML style files. Change-Id: Ic4097776e40d0de64312e4099d7fe4c7fc1ca9d1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove "High-DPI Support in Qt Quick Controls" doc pageVolker Hilsheimer2020-09-163-69/+0
| | | | | | | | | | | It is probably wrong enough to require a thorough rewrite. Given that it has nuggest such as "There is currently no available solution for high-DPI support in applications wishing to mix Qt Quick Controls and Qt Quick Controls", starting from scratch seems best. Change-Id: Id1ae9d0bc58da452457cbf4bcdebf658f74cb377 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix more compiler warnings from deprecated application attributesVolker Hilsheimer2020-09-162-2/+0
| | | | | | | | | Also cleanup documentation, with the exception of the "High-DPI Support in Qt Quick Controls" page, which needs to be either removed or rewritten after some fact checking. Change-Id: I3cdf1f8554f8f26627a9a5f17c2ee0038c933468 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix build after qtbase changesVolker Hilsheimer2020-09-151-2/+1
| | | | | Change-Id: I240b7410a409bb2f72213c02f50870f4ed99db9a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build after qtbase API changesLars Knoll2020-09-151-0/+2
| | | | | | | Adjust to API changes in qtbase Change-Id: Ib7d97c9580651077103b8ddeca28c30fb4992cb6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove the subControl property from ProgressBarJan Arve Sæther2020-09-102-36/+2
| | | | | | | | | | It shouldn't be needed in the API anymore, since a progress bar will either paint background and contentItem itself, or it won't paint any of those (therefore a custom progress bar have to provide both a background and a contentItem) Change-Id: Ic44fff97f5fc46453e9bbc9cada094b92fbe2aae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix ProgressBar on WindowsJan Arve Sæther2020-09-093-0/+61
| | | | | | | | | | | | | | Also remove the two custom progress bars from the manual test where one has a custom background, and the other has a custom contentItem. If you want to customize a progress bar, you need to provide customizations for both the background and the contentItem. You cannot provide a custom background (or contentItem) alone, since its almost impossible to create a custom background that fits well with the contentItem of all the other possible styles it might be using. Change-Id: I82a87513e73f319bcecbfaed341ac4949f64c3bb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Use OpenType font weightsJonas Karlsson2020-09-081-6/+5
| | | | | | Task-number: QTBUG-42248 Change-Id: I75f3e0d5ddf847bfb6a4ebb197ab1691909681c4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Native style: call QQuickStylePlugin::registerTypes() from style pluginsMitch Curtis2020-09-072-2/+2
| | | | | | | | This ensures that we received the warning we expect in tst_StyleImports::importStyleWithoutControls when run with native styles. Change-Id: I290f4e72222688e68ae36ace36f1d8be4bedaf31 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Native style: let windows/qmldir report the exact controls it containsRichard Moe Gustavsen2020-09-071-2/+0
| | | | | | | | This will ensure that the customization auto-test will not run for controls that are not available. Change-Id: Ia3164b847115cfb3bd0b34ff60630c06d8095b42 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: don't use signal handlers inside the styleRichard Moe Gustavsen2020-09-072-15/+3
| | | | | | | Using signal handlers will break the sanity test. Change-Id: I1a522520e237a7821162f65f49e7d0e1d501ff94 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Native style: don't use anchors inside the styleRichard Moe Gustavsen2020-09-071-1/+4
| | | | | | | Using anchors will break the sanity test. Change-Id: I6f27e98ae95e811db5063f0bc3866f386dbbb16e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'nativestyle' into devMitch Curtis2020-09-0433-0/+1653
|\ | | | | | | Change-Id: I18a4fd46cf13c65fe6f4c3981b7c61ab52109b8d
| * Native style: fix up qmldir files to comform to the new registration systemRichard Moe Gustavsen2020-08-284-31/+56
| | | | | | | | | | Change-Id: Id28352b397e3fc48423856a7f9322f3475d642ef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Native style: move macOS and Windows into QtQuick/Controls instead of ↵Richard Moe Gustavsen2020-08-284-12/+10
| | | | | | | | | | | | | | QtQuick/Controls.2 Change-Id: I12b0a3846a21cafac29615dbea53d88f9aed8e35 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Native style: remove versioning from importsRichard Moe Gustavsen2020-08-2823-75/+75
| | | | | | | | | | Change-Id: I73319d18ca6540227ce6bf4bdcf217a3c279c64c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Native style: clean-up importsRichard Moe Gustavsen2020-08-2821-21/+0
| | | | | | | | | | Change-Id: Id05edfccb617c72db902f5a7147ed8433be62e7c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-08-26557-5411/+4851
| |\ | | | | | | | | | Change-Id: I9999194551f71abec3731355cd746e69e2e0b187
| * | Native style: add hover effects to ScrollBar on macOSRichard Moe Gustavsen2020-08-261-0/+20
| | | | | | | | | | | | | | | Change-Id: I61bb0c2b1fd4dce2939bc4fe91a498a280802cb9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-08-131-1/+1
| |\ \ | | | | | | | | | | | | Change-Id: Ib1414eac2ad31cbaff6408ba84020a1e5dc064f4
| * | | Native style: add configure optionsRichard Moe Gustavsen2020-08-124-4/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I54521f85aa821369ba3ff57fb037ae4996845c97 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | Native style: support building with cmakeRichard Moe Gustavsen2020-07-302-0/+190
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Idec0507a8bbdfc345e731a9e376ef8dd00534946 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | Native style: remove fusiondesktopRichard Moe Gustavsen2020-07-307-231/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This style is not needed, since the already existing fusion style is working also for desktop. Change-Id: I0f92fdb88dc6173530be0f33b98a6f2d97e65afb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | Merge branch 'dev' into nativestyleRichard Moe Gustavsen2020-07-1735-116/+333
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: I5375ecd1dcbc058806e34fce757df2bf30dac16e
| * | | | Native style: add DialRichard Moe Gustavsen2020-06-262-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iad09b9f6080994528d65dcddc9eda49dbba356f7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | | Don't use 9-patch for Button on WindowsJan Arve Sæther2020-06-171-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the Button has a dotted focus rect on windows, it cannot be stretched by the 9-patch image, so we disable 9-patch for Button on Windows. Change-Id: I7dd7ea238edda8d9e55d65dbe4bd607a06e6ce6c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * | | | Native style: add ProgressBarRichard Moe Gustavsen2020-06-172-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie48002b083615afd4f8f8ab3b1303a8f5c39f81b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>