aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
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
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')
-rw-r--r--src/imports/controls/CheckBox.qml11
-rw-r--r--src/imports/controls/ComboBox.qml6
-rw-r--r--src/imports/controls/Drawer.qml3
-rw-r--r--src/imports/controls/SpinBox.qml4
-rw-r--r--src/imports/controls/TabBar.qml7
-rw-r--r--src/imports/controls/TabButton.qml2
-rw-r--r--src/imports/controls/doc/images/qtlabscontrols-tabbar.gifbin5932 -> 8590 bytes
-rw-r--r--src/imports/controls/doc/images/qtlabscontrols-tabbar.pngbin3463 -> 4725 bytes
-rw-r--r--src/imports/controls/doc/images/qtlabscontrols-tabbutton.pngbin3477 -> 4728 bytes
-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
-rw-r--r--src/imports/controls/plugins.qmltypes13
-rw-r--r--src/imports/controls/universal/ComboBox.qml6
-rw-r--r--src/imports/templates/plugins.qmltypes13
17 files changed, 88 insertions, 41 deletions
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml
index 20d8ef1c..4b7af3b1 100644
--- a/src/imports/controls/CheckBox.qml
+++ b/src/imports/controls/CheckBox.qml
@@ -67,7 +67,16 @@ T.CheckBox {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
source: "qrc:/qt-project.org/imports/Qt/labs/controls/images/check.png"
- visible: control.checked
+ visible: control.checkState === Qt.Checked
+ }
+
+ Rectangle {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 16
+ height: 3
+ color: "#353637"
+ visible: control.checkState === Qt.PartiallyChecked
}
}
//! [indicator]
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml
index fc32c6f5..30f45af3 100644
--- a/src/imports/controls/ComboBox.qml
+++ b/src/imports/controls/ComboBox.qml
@@ -101,7 +101,9 @@ T.ComboBox {
popup: T.Popup {
y: control.height - 1
implicitWidth: control.width
- implicitHeight: Math.min(200, listview.contentHeight)
+ implicitHeight: Math.min(396, listview.contentHeight)
+ topMargin: 6
+ bottomMargin: 6
contentItem: ListView {
id: listview
@@ -118,7 +120,7 @@ T.ComboBox {
color: "transparent"
}
-// ScrollIndicator.vertical: ScrollIndicator { }
+ T.ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle { }
diff --git a/src/imports/controls/Drawer.qml b/src/imports/controls/Drawer.qml
index eb4e3e57..60abeb0c 100644
--- a/src/imports/controls/Drawer.qml
+++ b/src/imports/controls/Drawer.qml
@@ -35,12 +35,13 @@
****************************************************************************/
import QtQuick 2.6
+import QtQuick.Window 2.2
import Qt.labs.templates 1.0 as T
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/SpinBox.qml b/src/imports/controls/SpinBox.qml
index 947ec74a..77f89206 100644
--- a/src/imports/controls/SpinBox.qml
+++ b/src/imports/controls/SpinBox.qml
@@ -69,8 +69,8 @@ T.SpinBox {
font: control.font
color: "#353637"
-// selectionColor: TODO
-// selectedTextColor: TODO
+ selectionColor: "#fddd5c"
+ selectedTextColor: color
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml
index b1a9009c..f43975f2 100644
--- a/src/imports/controls/TabBar.qml
+++ b/src/imports/controls/TabBar.qml
@@ -50,7 +50,7 @@ T.TabBar {
//! [contentItem]
contentItem: ListView {
implicitWidth: contentWidth
- implicitHeight: contentHeight
+ implicitHeight: 40
model: control.contentModel
currentIndex: control.currentIndex
@@ -63,9 +63,6 @@ T.TabBar {
//! [contentItem]
//! [background]
- background: Rectangle {
- implicitWidth: 40
- implicitHeight: 40
- }
+ background: Rectangle { }
//! [background]
}
diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml
index ef11e405..178a0a7f 100644
--- a/src/imports/controls/TabButton.qml
+++ b/src/imports/controls/TabButton.qml
@@ -48,8 +48,6 @@ T.TabButton {
padding: 6
- font.pointSize: 10
-
//! [label]
label: Text {
x: control.leftPadding
diff --git a/src/imports/controls/doc/images/qtlabscontrols-tabbar.gif b/src/imports/controls/doc/images/qtlabscontrols-tabbar.gif
index 0dccecb3..31db1f9e 100644
--- a/src/imports/controls/doc/images/qtlabscontrols-tabbar.gif
+++ b/src/imports/controls/doc/images/qtlabscontrols-tabbar.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscontrols-tabbar.png b/src/imports/controls/doc/images/qtlabscontrols-tabbar.png
index 100092f8..44a91d63 100644
--- a/src/imports/controls/doc/images/qtlabscontrols-tabbar.png
+++ b/src/imports/controls/doc/images/qtlabscontrols-tabbar.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscontrols-tabbutton.png b/src/imports/controls/doc/images/qtlabscontrols-tabbutton.png
index ab05c1db..76d1e35c 100644
--- a/src/imports/controls/doc/images/qtlabscontrols-tabbutton.png
+++ b/src/imports/controls/doc/images/qtlabscontrols-tabbutton.png
Binary files differ
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
diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes
index d52c6153..75805fdd 100644
--- a/src/imports/controls/plugins.qmltypes
+++ b/src/imports/controls/plugins.qmltypes
@@ -363,9 +363,11 @@ Module {
name: "ClosePolicy"
values: {
"NoAutoClose": 0,
- "CloseOnPressOutside": 1,
- "CloseOnReleaseOutside": 2,
- "CloseOnEscape": 4
+ "OnPressOutside": 1,
+ "OnPressOutsideParent": 2,
+ "OnReleaseOutside": 4,
+ "OnReleaseOutsideParent": 8,
+ "OnEscape": 16
}
}
Enum {
@@ -392,6 +394,11 @@ Module {
Property { name: "contentHeight"; type: "double" }
Property { name: "availableWidth"; type: "double"; isReadonly: true }
Property { name: "availableHeight"; type: "double"; isReadonly: true }
+ Property { name: "margins"; type: "double" }
+ Property { name: "topMargin"; type: "double" }
+ Property { name: "leftMargin"; type: "double" }
+ Property { name: "rightMargin"; type: "double" }
+ Property { name: "bottomMargin"; type: "double" }
Property { name: "padding"; type: "double" }
Property { name: "topPadding"; type: "double" }
Property { name: "leftPadding"; type: "double" }
diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml
index 0a5701b9..f736ef96 100644
--- a/src/imports/controls/universal/ComboBox.qml
+++ b/src/imports/controls/universal/ComboBox.qml
@@ -111,7 +111,9 @@ T.ComboBox {
//! [popup]
popup: T.Popup {
implicitWidth: control.width
- implicitHeight: Math.min(200, listview.contentHeight) // TODO: 396
+ implicitHeight: Math.min(396, listview.contentHeight)
+ topMargin: 8
+ bottomMargin: 8
contentItem: ListView {
id: listview
@@ -119,7 +121,7 @@ T.ComboBox {
model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex
-// ScrollIndicator.vertical: ScrollIndicator { }
+ T.ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes
index 67058870..d96563a7 100644
--- a/src/imports/templates/plugins.qmltypes
+++ b/src/imports/templates/plugins.qmltypes
@@ -357,9 +357,11 @@ Module {
name: "ClosePolicy"
values: {
"NoAutoClose": 0,
- "CloseOnPressOutside": 1,
- "CloseOnReleaseOutside": 2,
- "CloseOnEscape": 4
+ "OnPressOutside": 1,
+ "OnPressOutsideParent": 2,
+ "OnReleaseOutside": 4,
+ "OnReleaseOutsideParent": 8,
+ "OnEscape": 16
}
}
Enum {
@@ -386,6 +388,11 @@ Module {
Property { name: "contentHeight"; type: "double" }
Property { name: "availableWidth"; type: "double"; isReadonly: true }
Property { name: "availableHeight"; type: "double"; isReadonly: true }
+ Property { name: "margins"; type: "double" }
+ Property { name: "topMargin"; type: "double" }
+ Property { name: "leftMargin"; type: "double" }
+ Property { name: "rightMargin"; type: "double" }
+ Property { name: "bottomMargin"; type: "double" }
Property { name: "padding"; type: "double" }
Property { name: "topPadding"; type: "double" }
Property { name: "leftPadding"; type: "double" }