aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/universal
Commit message (Collapse)AuthorAgeFilesLines
* Use Control.activeKeyFocus instead of Item.activeFocusJ-P Nurmi2016-04-114-6/+6
| | | | | | | | | | This makes the controls visualize focus only when interacting with keys, so this basically allows us to set for example Qt.StrongFocus policy by default on buttons and friends. Change-Id: I6c81c58b7acfd2bc592bdd12d804e7e48ee65e95 Task-number: QTBUG-51796 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Universal: fix vertical RangeSliderJ-P Nurmi2016-04-111-1/+1
| | | | | Change-Id: I7b4b34e77c2bee4890871615d31af2f52afb39ac Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add Control::activeKeyFocusJ-P Nurmi2016-04-111-2/+1
| | | | | | | | | | | | | | | This is a convenience property that combines Item::activeFocus and Control::focusReason. This allows us to solve QTBUG-51796 in an elegant way - we can simply set Qt::StrongFocus policy on most of the interactive controls, such as buttons. The only thing we need to make sure is to use activeKeyFocus instead of activeFocus in the styles. This ensures that key focus is only visualized when actually interacting with keys - not when interacting via touch or mouse. This is a generalized version of the solution that was already used in the Universal style ApplicationWindow. Change-Id: Ifbf78e3e412f3791c8f7c369bb2de53af9ac6b0f Task-number: QTBUG-51796 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add internal QQuickStylePluginJ-P Nurmi2016-04-111-12/+18
| | | | | | | | | This is a common base class for QtQuickMaterialStylePlugin and QtQuickUniversalStylePlugin that takes care of the proxy theme installation and manages its life time by using a scoped pointer. Change-Id: I2cbe38287565d284b18fab4265456a41a2dbd8d4 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Simplify the style plugins code a bitKonstantin Ritt2016-04-101-13/+6
| | | | | | | | QQuickProxyTheme's destructor restores platform_theme, so keep proxy theme around and destroy it when we don't need it anymore. Change-Id: I2fef7c295251af1cd944cea27531c1c117d34d51 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Dial: deduplicate binding.Anton Kudryavtsev2016-03-291-1/+1
| | | | | | | Don't evaluate condition twice. Just use result of width. Change-Id: I38152353e7a2a5f60430684d38eb61140075d56f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickUniversalProgressRing: don't recreate rectangle in a loopAnton Kudryavtsev2016-03-291-1/+2
| | | | | | | Just cache it. Change-Id: Ibc1ec94331be6b019834f39c570b9ec43aabbae7 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickUniversalFocusRectangle: optimize string usageAnton Kudryavtsev2016-03-291-2/+4
| | | | | | | | | | Replace QString::arg() chain with multi-arg overloaded function. It's faster because of args are replaced in one pass. While touching the code, also cache width and height of bound. Change-Id: Id8d19143f426ed1998713204dc9c8d4b51e58db5 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QQuickUniversalFocusRectangle: proper construction of vectorAnton Kudryavtsev2016-03-291-1/+1
| | | | | | | | | ... with known size and known value by according ctor. Don't use appending for this case. Change-Id: Ib2bf9703bb03bdfa628d1ae78c6d0353e991b3e4 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Themes: cache result of QFont::family()Anton Kudryavtsev2016-03-281-3/+4
| | | | | Change-Id: I5318a61dbb699e2f251d218e614c1a2ff02d53a7 Reviewed-by: Mitch Curtis <mitch.curtis@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>
* Fix borders for top & bottom drawersJ-P Nurmi2016-03-231-1/+1
| | | | | Change-Id: Ifeb927d7d3edde0b01b4ed666b6a19354171e605 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Inherit QQuickDrawer from QQuickPopupJ-P Nurmi2016-03-232-0/+81
| | | | | | Change-Id: Icf71270e63aedd93ba975ab9743de68c3a54e849 Task-number: QTBUG-51007 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Introduce ToolTipJ-P Nurmi2016-03-222-0/+76
| | | | | | Change-Id: I917f7e83219788fc63389773eb07ee39757bed7f Task-number: QTBUG-51003 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-221-2/+4
|\ | | | | | | | | | | | | Conflicts: src/templates/qquickpopup.cpp Change-Id: Idb43ff6aff692d01e9bc03450a474bf18a7e41fa
| * Popup: fix marginsJ-P Nurmi2016-03-211-2/+4
| | | | | | | | | | | | Change-Id: I09f974a00a5a2a8f14645ff5d9bfbd6bad03d324 Task-number: QTBUG-51990 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Remove RangeSlider::track in favor of Control::backgroundJ-P Nurmi2016-03-211-9/+9
| | | | | | | | | | | | | | In the series of minimalizing the delegate APIs. Change-Id: I11e519f5226bf44d18b42fd31276c5528b18ec46 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Remove Slider::track in favor of Control::backgroundJ-P Nurmi2016-03-211-5/+5
| | | | | | | | | | | | | | In the series of minimalizing the delegate APIs. Change-Id: I664f4227ff55876be2594c8855dacc7c92eddc94 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | ProgressBar: use contentItem instead of indicatorJ-P Nurmi2016-03-212-9/+8
| | | | | | | | | | Change-Id: I8bd21b32b6f3d333c119d77b629b46fe411c06eb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | ScrollBar: use contentItem instead of handleJ-P Nurmi2016-03-211-13/+7
| | | | | | | | | | | | | | | | Thanks to virtual resizeContent() we can finally use contentItem like everywhere else, and cleanup the special handle item. Change-Id: I9e52ec3ff327d19cda3d85d2e2d9b73d80442bbc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | ScrollIndicator: use contentItem instead of indicatorJ-P Nurmi2016-03-211-11/+7
| | | | | | | | | | | | | | | | Thanks to virtual resizeContent() we can finally use contentItem like everywhere else, and cleanup the special indicator item. Change-Id: Ia2bd62684d49a05c199e490750a31c13d2c22182 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Universal: eliminate the extra Rectangle from ProgressBar indicatorJ-P Nurmi2016-03-213-27/+66
| | | | | | | | | | | | | | | | | | Make ProgressStrip capable of presenting non-indeterminate state the same way the Default and Material styles do. This makes the next step, which is to transition to contentItem, easier. Change-Id: I1a7e48cfba963f11764675b6e9a38ff2898b1212 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Rename Qt Labs Controls to Qt Quick Controls 2 - style pluginsJ-P Nurmi2016-03-194-14/+14
| | | | | | | | | | | | | | | | | | 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: Ic43c53ee743c40e168722643dacffb966c066a10 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Cleanup QQuickProxyStyleJ-P Nurmi2016-03-183-18/+6
| | | | | | | | | | | | | | | | | | | | | | Install and remove the proxy theme automatically to eliminate the need for TestTheme do it in tst_applicationwindow. Furthermore, fix some Qt coding conventions, align header guards, remove unneeded empty destructor, and add missing explicit keywords for one-parameter constructors and cleanup somemeaningless ones in paremeterless ctors. Change-Id: Ib95dad003e35e468e941f3a0d2be5b21323fcccd Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Rename Qt Labs Controls to Qt Quick Controls 2 - build systemMitch Curtis2016-03-185-6/+6
| | | | | | | | | | | | | | | | | | 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>
* | Add public API for setting and getting the style from C++J-P Nurmi2016-03-171-3/+2
| | | | | | | | | | | | | | | | TODO: setup QtLabsControls C++ module docs Task-number: QTBUG-50787 Change-Id: I382bad34df88d13fb9a74b3d2f9203280dfb4a66 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Rename QQuickStyle to QQuickStyleAttachedJ-P Nurmi2016-03-162-10/+10
| | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-161-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/controls/qquickstyle.cpp src/templates/qquickcontrol.cpp src/templates/qquickcontrol_p.h src/templates/qquickpopup.cpp tests/auto/controls/data/tst_combobox.qml tests/auto/controls/data/tst_control.qml Change-Id: Ib7853d5ee5c4444872cd5c2d789e20d229c955d1
| * Change style inheritance for popupsJ-P Nurmi2016-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The decision to make popups inherit theme & accent from its parent item was driven by ComboBox. However, in many cases it has an undesired side effect, so we've changed Popup to inherit its style attributes from the parent window instead, just like we did for fonts. The only exception to this is ComboBox, where the popup is an integral part of the control. This special case is now handled in the respective style implementation. A concrete example is that we can now specify dark theme by default for Material style ToolBar to get a better matching light text against the colorful background. In Gallery, this won't effect the options menu, which is a child of a ToolButton. The menu retains light theme along the rest of the application. Change-Id: Ibdc8fcf5b5fa258d853410a9b40368472424a8c6 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Add SwipeDelegateMitch Curtis2016-03-152-0/+117
| | | | | | | | | | | | | | | | | | | | 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>
* | Containers: increase paddingJ-P Nurmi2016-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | 6px is a very small default padding on high DPI. This is well visible in the Gallery example, for instance. All the control introduction labels are very near the screen edges. Change-Id: I4b998ada4589b04bc1015d1873a7031c15d89938 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-081-1/+1
|\| | | | | | | | | | | | | Conflicts: tests/auto/controls/data/tst_combobox.qml Change-Id: I9d0c9a8adbe098720f0766e38db8aa2be4ed7408
| * Fix typo in the Pane styleKonstantin Ritt2016-03-041-1/+1
| | | | | | | | | | | | | | Frame derives the Pane, not vice versa. Change-Id: I1a2bf0834efb44da7be21ded8aab01bafc42631f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-0414-16/+0
|\| | | | | | | | | | | | | Conflicts: src/templates/qquickpopup.cpp Change-Id: Ic5cdde7a2d9daa0e616de999969a4399db23245b
| * Universal: switch to distance field text renderingJ-P Nurmi2016-02-2614-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | Native text rendering is typically better on low density displays on Windows, but everywhere else, the distance field rendering gives better results. Our main target is not the classic GDI-based Windows desktop, but modern mobile typically with high density displays. Change-Id: Ibdaea09815a3915a720a04b2345e0c10c9753d2d Task-number: QTBUG-41432 Task-number: QTBUG-50971 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | StackView: use control as root id like in all other controlsJ-P Nurmi2016-03-031-4/+4
| | | | | | | | | | | | | | | | This makes it 100% clear in the doc snippets that the transitions are referring to the stackview control. Change-Id: I7c56b3669917f2f581972342c6b632738e0eb4fc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Fix out of bounds accessFrank Meerkoetter2016-03-032-3/+3
| | | | | | | | | | | | | | Fixes coverity CID155661, 155660, 155659. Change-Id: I914e321d3eda2a86916fa3ffa667d27b9a726f4b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Add SpinBox::editable propertyJ-P Nurmi2016-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | The default value is false, which is more mobile/embedded/touch friendly choice, and will be also in line with ComboBox::editable when it gets introduced sometime in the future. Change-Id: Iaaad8f5533100c2d5c4b49d1ef8ee849cf31feff Task-number: QTBUG-51114 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Universal: follow the Qt coding styleJ-P Nurmi2016-02-203-47/+56
| | | | | | | | | | | | | | | | 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 devLiang Qi2016-02-122-9/+14
|\| | | | | | | | | | | | | Conflicts: src/templates/qquickabstractbutton.cpp Change-Id: Icfd472451a150524dded704b4be5d286da21a6da
| * Universal: fix fontsJ-P Nurmi2016-02-092-9/+14
| | | | | | | | | | | | | | | | | | Request Segoe if exists, fallback to the system font. Even if we fallback to the system font, set the sizes and weights appropriately. Change-Id: I6cd34efcb5e41171758ffb2fbab22dc9d52c95a4 Task-number: QTBUG-50971 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Frame: migrage from frame to backgroundJ-P Nurmi2016-02-091-6/+3
| | | | | | | | | | Change-Id: I4478580026d4dba8994d09e8d0264b44150631d5 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | GroupBox: migrage from frame to backgroundJ-P Nurmi2016-02-091-3/+3
| | | | | | | | | | Change-Id: Ice0b983a89367c3d4cae1bfbc9500bf98ad90ba8 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devJ-P Nurmi2016-02-073-12/+28
|\| | | | | | | | | | | | | Conflicts: src/imports/controls/universal/ToolButton.qml Change-Id: Ib9f1e7d83fb824d9e6a13a2bc429d1a5642fe4f6
| * Universal: enable focus rect for ToolButtonJ-P Nurmi2016-02-061-0/+2
| | | | | | | | | | Change-Id: I5e552762c9beee7747f6bbd1d50d6ae6f50cfe69 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Optimize QQuickUniversalFocusRectangle::paint()J-P Nurmi2016-02-061-11/+22
| | | | | | | | | | | | Change-Id: I75cc70df9f5eef5a1e0132ea8ec90938305dfde2 Task-number: QTBUG-50575 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * QQuickUniversalFocusRectangle: avoid unnecessary paintsJ-P Nurmi2016-02-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Drawing a double-dashed focus rectangle gets seemingly expensive if the active focus control is eg. a SwipeView that covers the whole screen. In fact, SwipeView does not even request a focus rectangle (useSystemFocusVisuals: false), so it makes no sense to waste CPU cycles drawing a huge double-dashed rectangle. It's a bit unclear why QQuickPaintedItem even calls paint() when it's hidden... Change-Id: I57a8dd309674b8a6e99749544242a00dc02471ee Task-number: QTBUG-50575 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * Fix Universal & Material style font checksJ-P Nurmi2016-02-021-1/+1
| | | | | | | | | | | | | | | | Use QFont::exactMatch() to find out whether the font exists. Change-Id: Ie4f0a3a55c9337c504684aa285c93391e41279aa Task-number: QTBUG-50815 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Switch: migrate from label to contentItemJ-P Nurmi2016-02-062-13/+9
| | | | | | | | | | Change-Id: Ic287fc207b689d5f4a252a527b536272ad94c057 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | MenuItem: migrate from label to contentItemJ-P Nurmi2016-02-061-13/+11
| | | | | | | | | | Change-Id: I975c7a3bf3b44cf97a205c7e0a3256bee0376dfc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>