aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/qquickmaterialstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-0/+14
|\ | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * Material: introduce an active and disabled icon colorsKonstantin Ritt2016-10-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://material.google.com/style/icons.html#icons-system-icons > The standard opacity for an active icon on a light background is 54% (#000000). An inactive icon, which is lower in the visual hierarchy, should have an opacity of 26% (#000000). > The standard opacity for an active icon on a dark background is 100% (#FFFFFF). An inactive icon, which is lower in the visual hierarchy, should have an opacity of 30% (#FFFFFF). Change-Id: I5916855cd0a4005ee55ac781207ac9cf4d078a34 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-031-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quickcontrols2/gallery/gallery.qrc src/imports/calendar/doc/snippets/qtlabscalendar-calendarmodel.qml src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow.qml src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid.qml src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/doc/qtquickcontrols2.qdocconf src/imports/controls/doc/snippets/qtlabscalendar-calendarmodel.qml src/imports/controls/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-dayofweekrow.qml src/imports/controls/doc/snippets/qtlabscalendar-monthgrid-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-monthgrid.qml src/imports/controls/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-calendarmodel.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/qtquickcontrols2plugin.cpp src/quicktemplates2/qquicktooltip.cpp src/quicktemplates2/qquicktooltip_p.h src/quicktemplates2/qquicktumbler.cpp tests/auto/controls/data/tst_spinbox.qml tests/auto/controls/data/tst_tumbler.qml tests/auto/qquickmaterialstyle/data/tst_material.qml Change-Id: I25b7473b47739043b6f768603bece30b18021318
| * Material: fix dark dialog colorJ-P Nurmi2016-10-021-1/+1
| | | | | | | | | | | | | | | | https://material.google.com/style/color.html#color-themes Task-number: QTBUG-53266 Change-Id: I870d8e4871cae8d4940264c046d6ddf74dbe023f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Material: fix accent update on theme changeJ-P Nurmi2016-09-301-0/+4
| | | | | | | | | | Change-Id: I9cb3fd6bdbedc0e7ca472b815502bce48dca00b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-061-3/+12
|\| | | | | | | Change-Id: Ief98cd56abd13cfa4e30578e150207462a8243b8
| * Material: fix ToolBar to respect Material.backgroundJ-P Nurmi2016-09-061-0/+7
| | | | | | | | | | | | Task-number: QTBUG-55687 Change-Id: I815291847bad72ae58b66dc70b510ce11cd88b8d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Material: fix popups to respect Material.backgroundJ-P Nurmi2016-09-061-0/+4
| | | | | | | | | | | | Task-number: QTBUG-55687 Change-Id: I217ad905cc06228a6a1608c0721dc20a31db6d9b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-021-6/+2
|\| | | | | | | Change-Id: I82da1e547c4ead1181ade19f77c62651c00998a3
| * Material: ignore Material.background unless explicitly setMitch Curtis2016-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing Material.background: "red" in an ApplicationWindow shouldn't affect the background color of e.g. a Button. The background property should still propagate though, so we change buttonColor() to ignore the value of background if it wasn't explicitly set. Change-Id: I09b4df142935b19de35a77bd68c6c062417b74fc Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Cleanup unused QQuickMaterialStyle::drawerBackgroundColorJ-P Nurmi2016-09-021-5/+0
| | | | | | | | | | | | | | Drawer uses Material.dialogColor Change-Id: I4af7c5920a3603685fdca9d39b23f7db9edd09df Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-231-45/+58
|\| | | | | | | | | | | | | | | | | | | | | 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
| * Material: document the attached style propertiesMitch Curtis2016-08-191-0/+5
| | | | | | | | | | Change-Id: I8349ec366c75b9480533bb9b61a3748e09e9560e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Material: ensure setting background/foreground worksMitch Curtis2016-08-191-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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_qquickmaterialstyleconf auto test to ensure that global settings are respected. Change-Id: I436773e355c6d470215fb9cfe8fbff402d2979d9 Task-number: QTBUG-55366 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Material: rename defaultX variables to globalXMitch Curtis2016-08-191-43/+43
| | | | | | | | | | | | | | | | | | For example, defaultPrimary will become globalPrimary. 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: Idf09e5b0c6a2d91663730c00e3d32f2be49e15c6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add ComboBox::flatJ-P Nurmi2016-08-111-1/+3
| | | | | | | | | | | | | | | | | | [ChangeLog][ComboBox] Added a flat property that provides more suitable looks for using ComboBox in a ToolBar. Task-number: QTBUG-54935 Change-Id: Id458a078486aeac5d542a57f3ed247d63d25e95c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: rename ripple color propertiesJ-P Nurmi2016-07-211-5/+5
| | | | | | | | | | | | | | They are no longer specific to CheckBoxes, but used in most controls. Change-Id: I404aeab706479d0b666529ebdb09caa6b8085cae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickMaterialStyle: cleanup several unused colorsJ-P Nurmi2016-07-211-73/+4
| | | | | | | | | | | | | | | | | | These are no longer used now that the hovered and focused states are visualized by the ripple background, and the pressed state by the ripple waves and the elevation shadow. Change-Id: Ia2d315c2d8b31e4fcd77534f6128584b9daeb8d8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: revise Button visualsJ-P Nurmi2016-07-201-16/+1
| | | | | | | | | | | | | | | | | | | | | | Pressed buttons were way too dark, and ripples weren't even visible for highlighted buttons. Now that we have ripples, we don't need to use so many different color shades to present various button states. Also, visualize the checked state with a little accented bar like the Android ToggleButton does. Change-Id: Id717b658bfe70ba211e4da5a6addc6e10a2df3e5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: tweak ScrollBar looks and behaviorJ-P Nurmi2016-07-181-0/+5
| | | | | | | | | | | | | | | | | | | | Model the Material style scroll bar after the Chrome OS scroll bar. This adds a hover effect, and makes the transient timeout much longer to make the scroll bars easier to use on desktop. Task-number: QTBUG-50003 Change-Id: I5b1798e6c6b04482eab21d56e48935e2a9c69250 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-011-2/+15
|\| | | | | | | | | | | | | | | | | | | | | Comparing colors in tst_material.qml works fine now. Conflicts: examples/quickcontrols2/gallery/qtquickcontrols2.conf tests/auto/material/data/tst_material.qml Task-number: QTBUG-53556 Change-Id: I59970442a09bd72bf0ce53fe838c560ca8daf325
| * Material: fix the reset of primary and accentLiang Qi2016-05-261-2/+8
| | | | | | | | | | | | | | | | | | Also fix a test in dev(see 44ac831c). Done-with: J-P Nurmi <jpnurmi@qt.io> Task-number: QTBUG-53556 Change-Id: I0b156727b07ed8c135c4a7bb6bb31fb2b280d4ec Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * SpinBox: disable up and down indicators when appropriateMitch Curtis2016-05-241-0/+7
| | | | | | | | | | | | Change-Id: I6fbfde582723632c9b955a6e7ee380179b7b6a32 Task-number: QTBUG-53519 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Introduce a 'System' theme to the styles.Friedemann Kleint2016-05-261-1/+13
|/ | | | | | | | | | | | | | | | 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>
* Material: fix flat button colorsNikita Krupenko2016-05-091-8/+10
| | | | | | | | As 251afe3eaac3367c5c659dddc1e8854f833d5112 changed the way, how button color are retrieved, use it for flat buttons too. Change-Id: I28448c597b027293b1acac22dad586e0e7156707 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: set correct ToolBar foreground color for built-in primariesJ-P Nurmi2016-05-091-0/+36
| | | | | | | | | | When the primary color is one of the predefined values, we can choose the appropriate light or dark foreground color according to: https://www.google.com/design/spec/style/color.html#color-color-palette Change-Id: I2a25211ec3bc091211ce58b809089acaa32cb960 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Nikita Krupenko <krnekit@gmail.com>
* Material: use proper shade for light and dark themeNikita Krupenko2016-05-091-9/+16
| | | | | Change-Id: I2c93887890113a0ba37ce967349458c4b296a9ed Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: emit paletteChanged() on background color changeNikita Krupenko2016-05-061-0/+1
| | | | | | | | After 251afe3eaac3367c5c659dddc1e8854f833d5112 button color now depends on the background color. Change-Id: I297bf77f1303c07c3fa03e55ac57d8fe3228da4d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: fix raised button color for dark themeNikita Krupenko2016-05-061-1/+1
| | | | | | | | In 251afe3eaac3367c5c659dddc1e8854f833d5112 it became the same as in light theme. Change-Id: Iba5017be5d87ce0d346bcfd1bcdb0371fe650593 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: mark internal darkerShade() function as staticNikita Krupenko2016-05-061-1/+1
| | | | | Change-Id: I1d2e181f411e7337970669fc7a1bb3b8a37e1aed Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Material: Add proper elevation supportMichael Spencer2016-05-041-31/+88
| | | | | | | | | | | | - Added an ElevationEffect component based on elevation shadows from Angular Material - Use it on Button, ToolBar, ComboBox, Drawer, Pane, Popup, Menu, and Switch - Add an elevation property to the Material attached object - Update the button colors based on the elevation property Change-Id: I5152e1a56bdcb1016cc4f945a16ef510e0cdece6 Task-number: QTBUG-51276 Reviewed-by: Nikita Krupenko <krnekit@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Remove unnecessary TODO commentsMitch Curtis2016-04-291-3/+0
| | | | | | | It's OK to have approximations of color values and easing curves. Change-Id: Id0cb5cd80e5086ba1a8b35ac2f6c569b3c4002d0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-04-271-0/+2
|\ | | | | | | Change-Id: Ifb2d12d09994f3970b117ee76522c7d9c7152587
| * Material: update palette on primary/accent color changeNikita Krupenko2016-04-201-0/+2
| | | | | | | | | | | | Task-number: QTBUG-52631 Change-Id: Ib1649f44cdbc14770b1759ef7f4d7ea92f148cc1 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Rename env vars (QT_LABS_CONTROLS_XXX -> QT_QUICK_CONTROLS_XXX)J-P Nurmi2016-04-221-5/+5
| | | | | | | | | | Change-Id: Ie903d3491b03d4ec05dd28462a19ee464331d2a2 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Material: rename internal constants for divider colorNikita Krupenko2016-04-201-6/+6
| | | | | | | | | | Change-Id: If34a0f6db74a8cd3e75fd0fa2217bbb4920d71d2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Material: make highlighted buttons respect explicitly set foregroundJ-P Nurmi2016-04-181-0/+2
| | | | | | | | | | | | | | | | | | Highlighted buttons are special and don't automatically inherit the foreground color from the parent, but this change makes it possible to change the color by setting it explicitly on a highlighted button. Change-Id: I2e2f90ca001cdfffb47e5cf29266715243d7dd18 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Material: add foreground and background attached propertiesJ-P Nurmi2016-04-151-3/+183
| | | | | | | | | | | | | | | | | | | | | | | | 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, primary and theme do. Change-Id: Idae52650ed8620beeff7bf4c8263ffdc1f6ef728 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add QQuickMaterialStyle::variantToRgba()J-P Nurmi2016-04-151-42/+31
| | | | | | | | | | | | | | Extracted from setAccent() and setPrimary() Change-Id: I2dff1d0f605cc210f6b86b5aa1a1f5ff284b20af Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | 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-34/+41
| | | | | | | | | | | | | | | | 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>
* | Introduce ToolTipJ-P Nurmi2016-03-221-0/+5
| | | | | | | | | | | | Change-Id: I917f7e83219788fc63389773eb07ee39757bed7f Task-number: QTBUG-51003 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>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-181-16/+28
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/controls/qquickstyle.cpp src/controls/qquickstyleattached_p.h src/imports/controls/material/qquickmaterialstyle.cpp src/templates/qquickcontrol.cpp src/templates/qquickpopup.cpp Change-Id: I17c3c4d1040b89838f0903e0a17069b835895199
| * Material: use proper shades for dark theme colorsNikita Krupenko2016-03-171-16/+28
| | | | | | | | | | | | | | | | This fixes colors for checked switch dark theme and raised highlighted button in both themes. Change-Id: I3c485fb1b779104d6d7f682921b34cb535312f7c Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Rename QQuickStyle to QQuickStyleAttachedJ-P Nurmi2016-03-161-8/+8
| | | | | | | | | | | | | | | | 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>
* | Add SwipeDelegateMitch Curtis2016-03-151-0/+28
| | | | | | | | | | | | | | | | | | | | SwipeDelegate presents a view item that can be swiped left or right to expose more options or information. It is used as a delegate in views such as ListView. Change-Id: I7533a2b223f652993b6cee730930ea6dc125c869 Task-number: QTBUG-51610 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-02-251-2/+2
|\| | | | | | | | | | | | | Conflicts: src/templates/qquickrangeslider_p.h Change-Id: Ibe8ec18a7e22080f69f316d0394af1d03517ce93
| * Material: tweak the accent color and ripples for the dark themeJ-P Nurmi2016-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | In general, the appropriate shade is 200 in the dark theme. Furthermore, reduce the translucency of the ripple in the dark theme to make it better visible. Change-Id: I6060dfbdb2d291eded56ca648e1356d6228e3b25 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>