aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-31 16:05:25 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-31 17:38:37 +0100
commit19b967506deea84a0d56375e5bcca48168a3cfc8 (patch)
treebf488dc01069b7850cceff182c2241ed13db69c6 /src/imports/controls/material
parent8318deb165047d592523ec0b2fd10510d4953b37 (diff)
parent7fc567eda8a187e365f4c29c6e8f08440bf31218 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/templates/qquickpopup.cpp src/templates/qquickpopup_p_p.h src/templates/qquickspinbox_p.h Change-Id: Ief25ad2d27410f62e90879f60499ed87359406c3
Diffstat (limited to 'src/imports/controls/material')
-rw-r--r--src/imports/controls/material/CheckBox.qml31
-rw-r--r--src/imports/controls/material/ComboBox.qml7
-rw-r--r--src/imports/controls/material/Drawer.qml3
-rw-r--r--src/imports/controls/material/RadioButton.qml7
-rw-r--r--src/imports/controls/material/Switch.qml16
5 files changed, 44 insertions, 20 deletions
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml
index a4af00c7..88a8a3fc 100644
--- a/src/imports/controls/material/CheckBox.qml
+++ b/src/imports/controls/material/CheckBox.qml
@@ -51,8 +51,11 @@ T.CheckBox {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: label ? label.y + label.baselineOffset : 0
- padding: 6
- spacing: 6
+ spacing: 8
+ topPadding: 14
+ leftPadding: 8
+ rightPadding: 8
+ bottomPadding: 14
//! [indicator]
indicator: Rectangle {
@@ -62,7 +65,7 @@ T.CheckBox {
implicitWidth: 20
implicitHeight: 20
color: "transparent"
- border.color: control.checked ? control.Material.accentColor : control.Material.secondaryTextColor
+ border.color: control.checked && control.enabled ? control.Material.accentColor : control.Material.secondaryTextColor
border.width: control.checked ? width / 2 : 2
radius: 2
@@ -98,15 +101,29 @@ T.CheckBox {
source: "qrc:/qt-project.org/imports/Qt/labs/controls/material/images/check.png"
fillMode: Image.PreserveAspectFit
- scale: control.checked ? 1 : 0
+ scale: control.checkState === Qt.Checked ? 1 : 0
Behavior on scale { NumberAnimation { duration: 100 } }
}
- states: State {
- name: "checked"
- when: control.checked
+ Rectangle {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 12
+ height: 3
+ visible: control.checkState === Qt.PartiallyChecked
}
+ states: [
+ State {
+ name: "checked"
+ when: control.checkState === Qt.Checked
+ },
+ State {
+ name: "partiallychecked"
+ when: control.checkState === Qt.PartiallyChecked
+ }
+ ]
+
transitions: Transition {
SequentialAnimation {
NumberAnimation {
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml
index 5979f97a..b87034c5 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -109,8 +109,10 @@ T.ComboBox {
popup: T.Popup {
y: control.height
implicitWidth: control.width
- implicitHeight: Math.min(200, listview.contentHeight)
+ implicitHeight: Math.min(396, listview.contentHeight)
transformOrigin: Item.Top
+ topMargin: 12
+ bottomMargin: 12
enter: Transition {
// grow_fade_in
@@ -130,10 +132,11 @@ T.ComboBox {
model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex
-// ScrollIndicator.vertical: ScrollIndicator { }
+ T.ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
+ radius: 3
color: control.Material.dialogColor
layer.enabled: control.enabled
diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml
index cb00096d..133ea9c8 100644
--- a/src/imports/controls/material/Drawer.qml
+++ b/src/imports/controls/material/Drawer.qml
@@ -35,13 +35,14 @@
****************************************************************************/
import QtQuick 2.6
+import QtQuick.Window 2.2
import Qt.labs.templates 1.0 as T
import Qt.labs.controls.material 1.0
T.Drawer {
id: control
- parent: T.ApplicationWindow.overlay
+ parent: T.ApplicationWindow.overlay || Window.contentItem
width: parent ? parent.width : 0 // TODO: Window.width
height: parent ? parent.height : 0 // TODO: Window.height
diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml
index 40761be6..893248c8 100644
--- a/src/imports/controls/material/RadioButton.qml
+++ b/src/imports/controls/material/RadioButton.qml
@@ -51,8 +51,11 @@ T.RadioButton {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: label ? label.y + label.baselineOffset : 0
- padding: 6
- spacing: 6
+ spacing: 8
+ topPadding: 14
+ leftPadding: 8
+ rightPadding: 8
+ bottomPadding: 14
//! [indicator]
indicator: Rectangle {
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml
index b1a69286..3b9bb18f 100644
--- a/src/imports/controls/material/Switch.qml
+++ b/src/imports/controls/material/Switch.qml
@@ -52,20 +52,20 @@ T.Switch {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: label ? label.y + label.baselineOffset : 0
- padding: 6
- spacing: 6
+ padding: 8
+ spacing: 8
//! [indicator]
indicator: Item {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
- implicitWidth: 40
- implicitHeight: 20
+ implicitWidth: 38
+ implicitHeight: 32
Ripple {
x: handle.x + handle.width / 2 - width / 2
y: handle.y + handle.height / 2 - height / 2
- width: handle.width - 4
+ width: handle.width
height: width
control: control
colored: control.checked
@@ -74,7 +74,7 @@ T.Switch {
Rectangle {
width: parent.width
- height: 16
+ height: 14
radius: height / 2
y: parent.height / 2 - height / 2
color: control.enabled ? (control.checked ? control.Material.switchCheckedTrackColor : control.Material.switchUncheckedTrackColor)
@@ -85,8 +85,8 @@ T.Switch {
id: handle
x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2)))
y: (parent.height - height) / 2
- width: 24
- height: 24
+ width: 20
+ height: 20
radius: width / 2
color: control.enabled ? (control.checked ? control.Material.switchCheckedHandleColor : control.Material.switchUncheckedHandleColor)
: control.Material.switchDisabledHandleColor