aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/Button.qml
Commit message (Collapse)AuthorAgeFilesLines
* Material: switch back to triggering ripples on pressJ-P Nurmi2016-09-301-1/+0
| | | | | | | | | | | | | | | | | | There is something wrong with the ripple effect's speed calculation when it's triggered on release. The ripple is supposed to grow slowly on press, and fast on release. But when triggered on release, it grows clearly too slow. We also got a bug report complaining about the trigger on release behavior. Ripples are triggered on press on Android 5, which is the Android version with the most market share. The proposal is to fix the ripple effect speed calculation when triggered on release later, and switch to trigger on release when later versions of Android have passed Android 5's market share. Task-number: QTBUG-55520 Change-Id: I67994e0df3c318af24f0d1f843bb2d0c26c4d656 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: determine the default hoverEnabled value from QStyleHintsJ-P Nurmi2016-07-221-0/+2
| | | | | | Task-number: QTBUG-50003 Change-Id: I4809638c7ddaa4ca6fb99dbc734edb3641ecea05 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: rename ripple color propertiesJ-P Nurmi2016-07-211-1/+1
| | | | | | | They are no longer specific to CheckBoxes, but used in most controls. Change-Id: I404aeab706479d0b666529ebdb09caa6b8085cae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: revise Button visualsJ-P Nurmi2016-07-201-11/+14
| | | | | | | | | | | 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: improve Button's ripple effectJ-P Nurmi2016-07-191-2/+2
| | | | | | | | | Trigger ripples on press for flat buttons, on release for raised buttons. Use highlighted (colored) ripple for highlighted (colored) buttons, not for checked (not colored) buttons. Change-Id: Ic7a6de070e568792d39cc20af35229517b7fd69e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: trigger ripple effects on release for some controlsJ-P Nurmi2016-07-131-0/+1
| | | | | | | | | | Android 5 used to trigger ripple effects on press, but Android 6 made ripple effects a bit more subtle. For check boxes, radio buttons, and switches it still triggers on press, but these controls where the wave is larger, it's triggered on release instead. Change-Id: Ib4d301d5ccf72d5db106bcc6ad6afee30cef0b1e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: implement ripple effect for ButtonJ-P Nurmi2016-07-111-0/+10
| | | | | | Task-number: QTBUG-50003 Change-Id: Icc96eba2bb01847c369dbc7d07144c453aa6b324 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Bump up all controls and templates imports to version 2.1J-P Nurmi2016-07-081-3/+3
| | | | | | | | | | | | Controls must import templates version 2.1 in order to "inherit" 1-revisioned properties, methods, and signals. So far, this has been done case by case, but it's less error prone and more clear to change them all. For example, if you ever see a source file pasted/linked somewhere, it's easy to identify the version it belongs to. Change-Id: I41609ec1a22bc05ac3e79f953a147ca42d9e0786 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: remove qdoc markersJ-P Nurmi2016-06-081-4/+0
| | | | | | | | | | | | | The original plan was to include the default implementation (of all styles, if we could make the snippets collapsiple) in the customization docs. Since the default implementations tend to include internal types, in the end we went the other way and wrote dedicated example snippets for the customization docs. Therefore these markers no longer server a purpose, but just add unnecessary extra bytes for the QML parser to read. Change-Id: Ic511d7ce7a032429626ee75517d69d21b21412a3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Controls: update all paddings to relative value with paddingLiang Qi2016-05-191-2/+2
| | | | | Change-Id: I7bf3a7fb9ca97e5c7ddf34f8f921d5d4be733861 Reviewed-by: J-P Nurmi <jpnurmi@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>
* Material: remove obsolete imports of QtGraphicalEffectsNikita Krupenko2016-05-061-1/+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 proper elevation supportMichael Spencer2016-05-041-18/+27
| | | | | | | | | | | | - 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>
* Control: rename activeKeyFocus to visualFocusJ-P Nurmi2016-04-261-2/+2
| | | | | | | | | 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>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* import Qt.labs.templates 1.0 => QtQuick.Templates 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | | | | | | Even though there never was such thing is QtQuick.Templates 1.0, we'll use version 2.0 to keep it in sync with QtQuick.Controls 2.0 (next step). The templates define (and in the future, revision) the API of the controls, so the two must have the same version or it will get messy. Docs and plugins.qmltypes will be updated in follow up commits. Change-Id: Idc2e76f32f348ba35eb4b1fa167c6868300aa910 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add QQuickAbstractButton::downMitch Curtis2016-04-151-2/+2
| | | | | | | | | | | | | | | | | This property will determine whether or not the button is visually pressed. Having such a distinction allows users more control over their controls. The patch also fixes the problem with ComboBox where pressing on the ComboBox when it's open would cause a delegate in the popup to show as being pressed. Unless explicitly set, this property follows the value of the pressed property. To return to the default value, set it to undefined. Change-Id: I29ecf325ed2ede125613f0c878b0427937599866 Task-number: QTBUG-51005 Reviewed-by: J-P Nurmi <jpnurmi@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>
* Use Control.activeKeyFocus instead of Item.activeFocusJ-P Nurmi2016-04-111-2/+2
| | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-02-251-0/+8
|\ | | | | | | | | | | | | Conflicts: src/templates/qquickrangeslider_p.h Change-Id: Ibe8ec18a7e22080f69f316d0394af1d03517ce93
| * Material: add missing focus highlightsJ-P Nurmi2016-02-221-0/+8
| | | | | | | | | | | | | | Change-Id: Id678a095a56f7494c9f32160326ba667a6c0dc28 Task-number: QTBUG-51257 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Button: migrate from label to contentItemJ-P Nurmi2016-02-061-11/+6
|/ | | | | Change-Id: Icccab45dec0dafc907847eb0151b60bd9320ab9a Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Material: move DropShadows back to layer.effectJ-P Nurmi2016-01-251-23/+15
| | | | | | | | QTBUG-49979 was fixed, so we can switch back to using layer.effect, which typically leads to one less item and much less bindings. Change-Id: I7d1d1462a90c674b5f849134bb6ac8fe6ff0f231 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Material: increase minimum Button width to 64Nikita Krupenko2016-01-181-1/+1
| | | | | | | According to Material design guidelines, minimum button width is 64. Change-Id: I4de22a96691b6064fe46c006799fd3407030b280 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Material: use external padding only for top and bottom of the ButtonNikita Krupenko2016-01-181-6/+5
| | | | | | | Only extra vertial padding is needed for Button. Change-Id: Ie8a9d6db3a390c4bef2a1142d25e54e0ea9e9134 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Material: fix Button sizeNikita Krupenko2016-01-141-9/+15
| | | | | | | | In accordance to Material design guidelines, touch target size should be at least 48x48. Change-Id: Ieadf83bffc856196b11ec46b050fb5e345b8bffe Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Button: visualize disabled state more clearlyJ-P Nurmi2015-12-171-1/+2
| | | | | | Change-Id: I0b1bec4aa2c17e875a9a9580e10db80f6b21bc35 Task-number: QTBUG-50008 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Material: fix drop shadowsJ-P Nurmi2015-12-151-16/+19
| | | | | Change-Id: Ic4b1152a0a8a28a64721f064ccd09b669a12e795 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Material Button: fix font inheritanceJ-P Nurmi2015-12-031-0/+1
| | | | | Change-Id: I30235a5a43ec6cfd8107bf0f6433e22c20df4a7d Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Specify baseline offsetsJ-P Nurmi2015-11-251-0/+1
| | | | | | Change-Id: I4845a7beac2edc0f0bcc1c810edd7d9e86f31c87 Task-number: QTBUG-49468 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Visualize Material Button's highlighted stateMitch Curtis2015-11-231-4/+5
| | | | | | Change-Id: I1c638c0b70a0ba8d0f5cfe1d7e41fd514c38c1c9 Task-number: QTBUG-49551 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add Material styleMitch Curtis2015-11-121-0/+99
Change-Id: I93662a53b42858a5b65154c5ede334182e738dde Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>