aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/universal/qquickuniversalstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-231-24/+37
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/material/qquickmaterialstyle.cpp src/imports/controls/universal/qquickuniversalstyle.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquicktooltip.cpp tests/auto/auto.pro Change-Id: I88b347dd85278e14f7b2ca468e30648c6432b6f2
| * Universal: document the attached style propertiesMitch Curtis2016-08-191-0/+3
| | | | | | | | | | Change-Id: I390d3f9107f9e38e755f98060f74d63becba60cb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Universal: ensure setting background/foreground worksMitch Curtis2016-08-191-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add HasGlobalForeground and HasGlobalBackground. These are set to true when a foreground/background color is specified via settings (qtquickcontrols2.conf file or environment variables), and then used to initialize each attached style object's m_hasForeground and m_hasBackground property. - Add tst_qquickuniversalstyleconf auto test to ensure that global settings are respected. Task-number: QTBUG-55366 Change-Id: I7a8b219506f9528c4ae323bd890b418ba056ed23 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Universal: rename DefaultX variables to GlobalXMitch Curtis2016-08-191-20/+20
| | | | | | | | | | | | | | | | | | For example, DefaultAccent will become GlobalAccent. This better reflects the reality that these are not true defaults because they can be overridden by settings and makes it easier to read the code. Change-Id: I2a7afa3ec8fd6db620d054b6e1f6860b2d3e1d02 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Introduce a 'System' theme to the styles.Friedemann Kleint2016-05-261-1/+11
|/ | | | | | | | | | | | | | | | Setting the theme to System chooses either the light or dark theme based on the system theme colors. However, when reading the value of the theme property, the value is never System, but the actual theme. [ChangeLog][Controls][Material] Added Material.System theme enum value, that can be used to let the Material style choose either the light or dark theme based on the system theme colors. [ChangeLog][Controls][Universal] Added Universal.System theme enum value, that can be used to let the Universal style choose either the light or dark theme based on the system theme colors. Change-Id: Ibfc9f01953cb8322b64d59413cfbaef9d4bb28fd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Universal: notify foreground and background changes on theme changeJ-P Nurmi2016-04-231-0/+4
| | | | | | | | This fixes the theme switch in testbench. Change-Id: I601b40a3b1a9983cf1bbc8e12f5e8dcb9419521d Task-number: QTBUG-52738 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename env vars (QT_LABS_CONTROLS_XXX -> QT_QUICK_CONTROLS_XXX)J-P Nurmi2016-04-221-4/+4
| | | | | Change-Id: Ie903d3491b03d4ec05dd28462a19ee464331d2a2 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Universal: add foreground and background attached propertiesJ-P Nurmi2016-04-181-1/+141
| | | | | | | | | | | | | | Same as b51e520f for Material. This has been a common request on the mailing lists and forums. Users want to customize the text color of various controls without having to replace whole delegates. This change makes it possible to specify both foreground (eg. Button text) and background (eg. ApplicationWindow, Page and Pane background) colors so that they propagate to children in the same way than accent and theme do. Change-Id: I55084c58f0c62e8088b270ed98437241e382ca15 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add QQuickUniversalStyle::variantToRgba()J-P Nurmi2016-04-181-20/+27
| | | | | | | Extracted from setAccent() - same as 8ed4c6c for QQuickMaterialStyle. Change-Id: Iadd791f3c2d9e5820a94bc8e84ce5d4c17156ae2 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add invokable Universal.color() methodJ-P Nurmi2016-04-161-0/+5
| | | | | | | Material has it also. It's useful for getting the actual color values. Change-Id: I36de2e5802b3721179be95503b8b516d31682065 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickUniversalStyle: rename getColor() to systemColor()J-P Nurmi2016-04-161-25/+25
| | | | | Change-Id: I6b4799e929d032a3ddb5430acdbf6d816698d47a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Rename QQuickUniversalStyle::Accent to ColorJ-P Nurmi2016-04-161-5/+5
| | | | | | | | The same enum will be supported by the upcoming foreground and background attributes and is no longer accent -specific. Change-Id: Id579a1f08bdee1d92fb94a22e68c0fab0dc4e7a5 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Universal: revise the internal light and dark color helper methodsJ-P Nurmi2016-04-161-5/+5
| | | | | | | | This makes it possible to use the helper methods for fetching default values for the upcoming foreground and background attributes. Change-Id: I5c1371ca1f8022b5f97ca4496ffa597bc3dd88f6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Universal: rename member variablesJ-P Nurmi2016-04-161-9/+9
| | | | | | | | | | Prepare for foreground/background support, which needs both "explicit" and "has" flags separately. The former describes better the effect on inheritance (explicitly set attributes override inherited values) vs. the latter describes whether a value has been set (in any ancestor). Change-Id: I0a9c91b3b24221d7286cb10fb63a00c71eae9791 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Align QQuickUniversalStyle::SystemColor valuesJ-P Nurmi2016-04-161-1/+1
| | | | | | | Unlike BaseHigh, the others didn't have any Color-suffix. Change-Id: Iacd797c86330f3ad1eff8f83735172d7475c00e4 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Controls: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. Change-Id: Ib653135662bfd353a73290539995e8e5be211587 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Controls: rename the C++ module to qtquickcontrols2J-P Nurmi2016-04-131-1/+1
| | | | | Change-Id: I087a39baebc296a340739161874636926adaa56c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add support for specifying theme, accent & primary via envJ-P Nurmi2016-03-241-20/+28
| | | | | | | | Environment values take presedence over the default values requested in qtquickcontrols.conf, the same way than style name. Change-Id: I4641317bdce320c33a89f3614f3c782883c9c843 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename Qt Labs Controls to Qt Quick Controls 2 - build systemMitch Curtis2016-03-181-1/+1
| | | | | | | | | The imports will be done later, as we don't want to change them until the module is releasable (which requires things like selection handles, etc.). Change-Id: I2140cff7058fc3b696e92ca8c0e5e06dca9a7c9c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Rename QQuickStyle to QQuickStyleAttachedJ-P Nurmi2016-03-161-7/+7
| | | | | | | | Make room for a public QQuickStyle class for configuring the style. Task-number: QTBUG-50787 Change-Id: I2a43436dd1815e3acd7e896a5847e41db42af5c4 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Universal: follow the Qt coding styleJ-P Nurmi2016-02-201-32/+38
| | | | | | | | Return early to keep the indentation low. This style was already used in many areas, so now the same style is consistently used everywhere. Change-Id: I6db941be07b153c7448dd418256c792186f71e58 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devJ-P Nurmi2016-01-191-13/+15
|\ | | | | | | | | | | | | Conflicts: src/controls/qquickstyle.cpp Change-Id: I1c8273012b01726072e5cbfd4369453a780ff03e
| * Improve Material & Universal warningsJ-P Nurmi2016-01-141-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: QQuickMaterialStyle: unknown accent "foo" After: qrc:/main.qml:28:9: QML CheckBox: unknown Material.accent value: foo Furthermore, before invalid values in :/qtlabscontrols.conf were silently ignored. Now it gives a clear warning: :/qtlabscontrols.conf: unknown Material theme value: foo Change-Id: I0be4eb26ffe23643e282197dc76a091801ab2f4d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Imports: replace foreach with range-based forAnton Kudryavtsev2016-01-151-2/+4
|/ | | | | Change-Id: I31bc93c2b3f6ecbd0680dc9d626626c4fe57eec8 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Universal: add support for user-defined accent colorsJ-P Nurmi2015-12-251-48/+70
| | | | | | Change-Id: I23863519269deddb3a6007657fc93e83f33be842 Task-number: QTBUG-50103 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Universal style: read theme & accent from qtlabscontrols.confJ-P Nurmi2015-12-141-3/+33
| | | | | Change-Id: Ie41bf8a3b375835a07229eff49e6d10e3ff79992 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add QQuickStyleJ-P Nurmi2015-12-021-57/+37
| | | | | | | | | Now that we have a good place for it, we can share a common base class for QQuickMaterialStyle and QQuickUniversalStyle. QQuickStyle implements the inheritance pattern for attached styles, in one place. Change-Id: I459d98f96ce7c6de1ce7ef716e859f459278d8ad Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Universal: move to QQuickProxyTheme way for font settingsLiang Qi2015-12-011-15/+0
| | | | | Change-Id: I90d91ceaea245dc19d2c0de683cb7c1172e1042e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Universal: use QRgb instead of color namesJ-P Nurmi2015-11-281-73/+73
| | | | | | | | Constructing colors from QRgb (typedef unsigned int) is a million times faster than parsing named color strings. Change-Id: I01453c6d6c500e32736f3e331569e7034140c644 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Add Universal styleJ-P Nurmi2015-11-121-0/+412
https://dev.windows.com/design Change-Id: I1d8c633ae246724649a6ed71b300a56ba9572405 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>