diff options
Diffstat (limited to 'src/quickcontrols/material')
| -rw-r--r-- | src/quickcontrols/material/Button.qml | 5 | ||||
| -rw-r--r-- | src/quickcontrols/material/TreeViewDelegate.qml | 13 | ||||
| -rw-r--r-- | src/quickcontrols/material/Tumbler.qml | 8 | ||||
| -rw-r--r-- | src/quickcontrols/material/impl/CursorDelegate.qml | 2 |
4 files changed, 18 insertions, 10 deletions
diff --git a/src/quickcontrols/material/Button.qml b/src/quickcontrols/material/Button.qml index c02d9f426a..8ffe07bbc3 100644 --- a/src/quickcontrols/material/Button.qml +++ b/src/quickcontrols/material/Button.qml @@ -18,8 +18,9 @@ T.Button { topInset: 6 bottomInset: 6 verticalPadding: Material.buttonVerticalPadding - leftPadding: Material.buttonLeftPadding(flat, hasIcon) - rightPadding: Material.buttonRightPadding(flat, hasIcon, text !== "") + leftPadding: Material.buttonLeftPadding(flat, hasIcon && (display !== AbstractButton.TextOnly)) + rightPadding: Material.buttonRightPadding(flat, hasIcon && (display !== AbstractButton.TextOnly), + (text !== "") && (display !== AbstractButton.IconOnly)) spacing: 8 icon.width: 24 diff --git a/src/quickcontrols/material/TreeViewDelegate.qml b/src/quickcontrols/material/TreeViewDelegate.qml index 9f1d444383..7a9976b021 100644 --- a/src/quickcontrols/material/TreeViewDelegate.qml +++ b/src/quickcontrols/material/TreeViewDelegate.qml @@ -42,7 +42,7 @@ T.TreeViewDelegate { y: (parent.height - height) / 2 rotation: control.expanded ? 90 : (control.mirrored ? 180 : 0) source: "qrc:/qt-project.org/imports/QtQuick/Controls/Material/images/arrow-indicator.png" - color: control.palette.windowText + color: control.enabled ? control.Material.foreground : control.Material.hintTextColor defaultColor: "#353637" } } @@ -50,9 +50,16 @@ T.TreeViewDelegate { background: Rectangle { implicitHeight: control.Material.buttonHeight color: control.highlighted - ? control.palette.highlight + ? control.Material.accentColor : (control.treeView.alternatingRows && control.row % 2 !== 0 - ? control.palette.alternateBase : control.palette.base) + ? control.Material.background + // The Material.shade() is used as the alternate background color for rows + // based on the Material.theme value. + : control.Material.shade(control.Material.background, + control.Material.theme === Material.Dark + ? Material.Shade100 // the lighter background color + : Material.Shade700 // the darker background color + )) } contentItem: Label { diff --git a/src/quickcontrols/material/Tumbler.qml b/src/quickcontrols/material/Tumbler.qml index 59320cf52b..48d0c2e739 100644 --- a/src/quickcontrols/material/Tumbler.qml +++ b/src/quickcontrols/material/Tumbler.qml @@ -14,6 +14,8 @@ T.Tumbler { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) + readonly property real __delegateHeight: availableHeight / visibleItemCount + delegate: Text { text: modelData color: control.Material.foreground @@ -33,13 +35,11 @@ T.Tumbler { delegate: control.delegate path: Path { startX: control.contentItem.width / 2 - startY: -control.contentItem.delegateHeight / 2 + startY: -control.__delegateHeight / 2 PathLine { x: control.contentItem.width / 2 - y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2 + y: (control.visibleItemCount + 1) * control.__delegateHeight - control.__delegateHeight / 2 } } - - property real delegateHeight: control.availableHeight / control.visibleItemCount } } diff --git a/src/quickcontrols/material/impl/CursorDelegate.qml b/src/quickcontrols/material/impl/CursorDelegate.qml index 811aa89e36..d1ef157f87 100644 --- a/src/quickcontrols/material/impl/CursorDelegate.qml +++ b/src/quickcontrols/material/impl/CursorDelegate.qml @@ -24,7 +24,7 @@ Rectangle { id: timer running: cursor.parent.activeFocus && !cursor.parent.readOnly && interval != 0 repeat: true - interval: Qt.styleHints.cursorFlashTime / 2 + interval: Application.styleHints.cursorFlashTime / 2 onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0 // force the cursor visible when gaining focus onRunningChanged: cursor.opacity = 1 |
