aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material
Commit message (Collapse)AuthorAgeFilesLines
* Material: prevent ElevationEffect access out of boundsJ-P Nurmi2016-05-271-1/+1
| | | | | | | | | | | | | | The elevation shadows are defined in a JS array for elevations between 0-24. Clamp the user-defined elevation number to prevent access out of bounds: Button { Material.elevation: 100 // ElevationEffect.qml: TypeError: // Cannot read property '0' of undefined } Change-Id: I6b5a915042081be54101fd700b52c8eea96aa05d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* 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-243-3/+12
| | | | | | Change-Id: I6fbfde582723632c9b955a6e7ee380179b7b6a32 Task-number: QTBUG-53519 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/imports/controls/doc/qtlabscontrols.qdocconf src/imports/controls/doc/qtquickcontrols2.qdocconf src/imports/controls/material/qtlabsmaterialstyleplugin.cpp src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp src/imports/controls/qtlabscontrolsplugin.cpp src/imports/controls/qtquickcontrols2plugin.cpp src/imports/templates/qtlabstemplatesplugin.cpp src/imports/templates/qtquicktemplates2plugin.cpp Change-Id: I6159e681b77e4a0a293b6bd7fb11a46d58873da0
| * Cleanup QQmlExtensionInterface usageJ-P Nurmi2016-05-061-1/+1
| | | | | | | | | | | | | | | | Use the pre-defined macro. Change-Id: Ie2b5a93f0b6ed16276b80fcb9e118a49a055194c Task-number: QTBUG-53208 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Controls: update all paddings to relative value with paddingLiang Qi2016-05-194-14/+11
| | | | | | | | | | Change-Id: I7bf3a7fb9ca97e5c7ddf34f8f921d5d4be733861 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Don't use QFont::exactMatch() for fonts comparisonNikita Krupenko2016-05-181-3/+7
| | | | | | | | | | | | | | | | | | This function can return false even if the font found. Compare fonts by QFontInfo::family() instead. Change-Id: I519dd11ef7cba7395ca5b815d3973ddf585c439a Task-number: QTBUG-53377 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Make SwipeDelegate look like an ordinary delegateJ-P Nurmi2016-05-181-3/+10
| | | | | | | | | | | | | | | | | | | | | | Sync background colors with the ItemDelegate implementation of each style, so SwipeDelegate won't look out of place when mixed with other delegates like on the Delegates page in Gallery. Material and Universal styles need an extra Rectangle to fill the background, because their press colors etc. are translucent. Change-Id: If3bc545a2c12430f79cf538cf610bd2106f9660c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add support for flat ButtonsJ-P Nurmi2016-05-181-9/+5
| | | | | | | | | | | | | | Task-number: QTBUG-51054 Change-Id: Ib4b23b624bc34d16c5acc1568881b609d3fd64b8 Reviewed-by: Nikita Krupenko <krnekit@gmail.com> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: visualize Button::checked stateJ-P Nurmi2016-05-131-1/+1
| | | | | | | | | | | | | | | | It's not very well visible, but better than completely missing visuals. Task-number: QTBUG-53348 Change-Id: I16067bfb4f9f118ad5765f2831018b2fd89337f7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Menu: remove the extra marginsJ-P Nurmi2016-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since 0935e65, popup margins are negative by default. 0px or larger margins have to be set to keep a popup within the window bounds. In the same change, Menu gained also default margins. This seemed ok with context menus positioned at mouse coordinates, but doesn't look so nice in the Gallery example where the options menu was pushed too far out of top right corner. This change restores the old behavior that menus are kept within the window bounds with 0 margins. Change-Id: Ib728c22ebbdc2b9fa2d402eb4d4a11a638331a02 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Popup: sync content padding with PaneJ-P Nurmi2016-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | Pane paddings were increased in 6322aed. Increase also Popup paddings for the same reason that 6px is a very small default padding on high DPI. This is well visible in the About dialog of the Gallery example, for instance, where the text is very near the popup edges. Change-Id: I7b9478a509936ace2ad540207ee18dac2cf10306 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: correct check indicator sizeNikita Krupenko2016-05-103-6/+8
| | | | | | | | | | | | | | In design guidelines it is 18x18. Change-Id: I922d96f3208475d2a248659ec384af510058186f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | ComboBox: restore the old popup behaviorJ-P Nurmi2016-05-101-1/+1
| | | | | | | | | | | | | | | | Make the Popup follow ComboBox outside the horizontal screen bounds. Setting an explicit width instead of implicit width does exactly this. Change-Id: I46f4e5e40d5012929badf39d50d70b9a7811f455 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Popup: use margins to determine whether to push inside window boundsJ-P Nurmi2016-05-102-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we were planning to introduce complex policy flags to make it possible to specify whether a Popup is allowed to go outside the screen or not. Using margins for that purpose avoids the need of introducing such dedicated API just for that. From now on, margins are used to determine whether a popup is pushed to fit inside the window bounds (margins removed), and implicit size is used to determined whether a popup is resized to fit inside the window. In other words, a popup with negative margins and no implicit size is allowed to move outside the window bounds. Change-Id: Ife1665755e4dae434751977ae3289eb1aa4f3c6d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: fix SwitchDelegate press colorJ-P Nurmi2016-05-103-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | Elevation is required to get a shadow for the indicator, but it also affects the press color, which is undesired. To avoid a darker press color than the other delegates have, elevate only the indicator instead of the whole delegate. Unfortunately, this results to two Material attached object instances for the delegate, so it must be blacklisted in tst_sanity... Change-Id: I8b607ba8f7493fd34a4bdc131a5bfdc5a39159ae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Material: corrected height for delegatesNikita Krupenko2016-05-103-0/+8
| | | | | | | | | | | | | | Made delegate's height be 48 by default. Change-Id: Ic240474eb3a1137bf033d17af1e38230c89ccf29 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Material: fix flat button colorsNikita Krupenko2016-05-093-11/+11
| | | | | | | | | | | | | | | | 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-093-0/+40
| | | | | | | | | | | | | | | | | | | | 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-092-9/+17
| | | | | | | | | | 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: remove obsolete imports of QtGraphicalEffectsNikita Krupenko2016-05-067-7/+0
| | | | | | | | | | | | | | They are no needed anymore, as shadow implemented by an ElevationEffect. Change-Id: I75deb8fba69c96dfb82fc400ac24da543497a635 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Material: add implicitHeight to MenuItemNikita Krupenko2016-05-041-0/+1
| | | | | | | | | | Change-Id: I57dde9c0a35ccedace308dab4a1905770a4efde0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Material: Add proper elevation supportMichael Spencer2016-05-0422-114/+554
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | Material: made MenuItem not grow above 48 px by defaultNikita Krupenko2016-05-041-0/+2
| | | | | | | | | | Change-Id: I9770bf11f12be915f46809957f480c6369a58e8d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Allow Menu to grow bigger than implicitHeight of the backgroundNikita Krupenko2016-05-041-3/+3
| | | | | | | | | | | | | | Also, empty menu has now size of one MenuItem (+ paddings). Change-Id: I5738d1312594941b5c57a02800665caa8a7cfba6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Adding type information for Material and Universal styleThomas Hartmann2016-05-041-0/+92
| | | | | | | | | | Change-Id: Ia9b244be969e8ae3aff601170bf86e8bf6b61a05 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Improve Tumbler's delegate opacity for all stylesMitch Curtis2016-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the fade-out effect more gradual: Before: http://i.imgur.com/gNyHh1y.png After: http://i.imgur.com/fsC17UE.png With: import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 2.0 Window { width: 300 height: 300 visible: true Tumbler { model: 15 visibleItemCount: 5 anchors.centerIn: parent } } Change-Id: I7774b7a59eb2e6c15299325780f13afbc220a374 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Revert Tumbler::displacement to position changesJ-P Nurmi2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commits 150d8fcc7f97e4a5d56bdcf608fa22533d807677 and 0905066bcbb967d3344d399383d0ea4b30e1d489 that broke Tumbler. The normalized position calculation did not work in some corner cases (eg. when the total amount of model items is just 2). Therefore, just go back to "displacement"; and if we ever get this working correctly, we can call it position and deprecate displacement. Task-number: QTBUG-53061 Change-Id: Ic721f8a96c250dd5d40f881ff991fae687311996 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Remove unnecessary TODO commentsMitch Curtis2016-04-292-5/+0
| | | | | | | | | | | | | | It's OK to have approximations of color values and easing curves. Change-Id: Id0cb5cd80e5086ba1a8b35ac2f6c569b3c4002d0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Material: add top and bottom paddings for MenuNikita Krupenko2016-04-281-0/+3
| | | | | | | | | | Change-Id: Ie764f7f3efd2bf14ad9156a1bc3d16b9cb8a9278 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | ComboBox: separate indicatorJ-P Nurmi2016-04-281-9/+14
| | | | | | | | | | | | | | | | This makes it possible to hide or replace either ComboBox background or content item without losing the built-in indicator. Change-Id: I308bbaa8190eba04ff3048a20c2d2ed0431a24f2 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-04-272-1/+3
|\| | | | | | | Change-Id: Ifb2d12d09994f3970b117ee76522c7d9c7152587
| * Material: fix ProgressBar heightNikita Krupenko2016-04-261-1/+1
| | | | | | | | | | | | | | The 1px padding at the top and at the bottom are unnecessary. Change-Id: I0d6d2a5753cf987ab2782afa5d5dd2bb2c739568 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * 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>
* | Tumbler: normalize position to [-1.0..1.0]J-P Nurmi2016-04-271-1/+1
| | | | | | | | | | Change-Id: Id47f3b938e4d2e6ce27fadc47d4aa7437f2bc085 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Tumbler: rename displacement to positionJ-P Nurmi2016-04-271-1/+1
| | | | | | | | | | Change-Id: Ifd44408b896343bdf77ea7b890360917944e2018 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Material: fix CheckIndicator focus againJ-P Nurmi2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | Missing activeKeyFocus check was added in df16eac, but then it was renamed to visualFocus at the same time in 345fb09. Change-Id: Ic5d866e94c48c5a35084a4e2cb9e362b9a30a4c6 Task-number: QTBUG-51257 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Popup: separate modal and modeless background dimmingJ-P Nurmi2016-04-271-1/+6
| | | | | | | | | | | | | | | | | | | | iOS generally has white popups on white background, so it must dim the overlay background also for modeless popups to make them stand out. Make it possible to have modal and modeless background dimming separately, because both might be visible at the same time (eg. in Gallery settings). Change-Id: Id990675c8d06ceb8f8a26e6505d4bd020069f297 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Material: Set default height for one-line item delegatesKonstantin Ritt2016-04-264-0/+8
| | | | | | | | | | | | | | | | accordingly to the Material Design specs. Change-Id: I035fbd3e19f27f30b457cdedf3418cce1175b895 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Fix SwipeDelegate spacing to match other delegatesMitch Curtis2016-04-261-2/+2
| | | | | | | | | | Change-Id: I759ce627d1ec2d7ecd0bea2ea0fdc40e9a7be1c3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Control: rename activeKeyFocus to visualFocusJ-P Nurmi2016-04-267-8/+8
| | | | | | | | | | | | | | | | | | This is a bit more flexible, because the name is not strictly coupled with key focus. We can even add a (re)setter later if we want. This change only renames the property. Change-Id: I6707e44040f584480a8712df1af0915ae2829d57 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Allow attaching TextArea to a FlickableJ-P Nurmi2016-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | It is not always possible to let TextArea grow infinitely, but in some cases it should be scrollable on its own. Even though it is not a built-in feature of TextArea like in Qt Quick Controls 1, this change makes it straight-forward to attach TextArea to a Flickable. This makes TextArea behave like a standalone scrollable editor. Change-Id: I8181e8ebe0edbcdfef2c30c9e102db7cbe4ff705 Task-number: QTBUG-51677 Task-number: QTBUG-52169 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Material: revise ComboBox looksJ-P Nurmi2016-04-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | Increase the default height to 48dip, which is also the height of ItemDelegate. Open the popup on top instead of below the button, and sync paddings with ItemDelegate so that ComboBox and ItemDelegate contents match. Also, visualize the current item by highlighting its text with accent color. Change-Id: Iabbcb07e5c4fd1f811857f3c04aadcf87accb41f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Use ToolTip font from themeNikita Krupenko2016-04-262-0/+7
| | | | | | | | | | Change-Id: I9a95bcd02a48528bc3e3315c7aa730a2d43bb002 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Fix Q_INIT_RESOURCE() for static buildsJ-P Nurmi2016-04-261-1/+1
| | | | | | | | | | | | Change-Id: Ibf864c5c145065fe13dfb958bc4f5fa6a887a1be Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Material: fix CheckIndicator focusJ-P Nurmi2016-04-261-1/+1
| | | | | | | | | | | | Change-Id: Ib42a638ab25f724a78b9b576947b828eb36944b6 Task-number: QTBUG-51257 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | ToolTip: enable font inheritanceJ-P Nurmi2016-04-251-1/+1
| | | | | | | | | | Change-Id: Id8ca0f6212edc7c773b312ec7632a9d559aef68d Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>