diff --git a/src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml b/src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml --- a/src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml +++ b/src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml @@ -116,64 +116,12 @@ radius: Kirigami.Units.smallSpacing color: Kirigami.Settings.isMobile ? "transparent" : Qt.rgba(1, 1, 1, 0.2) - Kirigami.Theme.inherit: false - Kirigami.Theme.colorSet: Kirigami.Theme.Complementary - Behavior on opacity { PropertyAnimation { duration: Kirigami.Units.longDuration easing.type: Easing.OutQuad } } - - Rectangle { - visible: actionsRow.children.length > 1 - anchors { - left: parent.left - top: actionsScope.top - right: parent.right - bottom: parent.bottom - } - gradient: Gradient { - GradientStop { position: 0.0; color: "transparent" } - GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.4) } - } - } - FocusScope { - id: actionsScope - anchors { - right: parent.right - bottom: parent.bottom - } - width: actionsRow.width - height: actionsRow.height - RowLayout { - id: actionsRow - - Repeater { - model: delegate.actions - delegate: Controls.ToolButton { - Kirigami.Icon { - Kirigami.Theme.inherit: false - Kirigami.Theme.colorSet: Kirigami.Theme.Complementary - anchors.centerIn: parent - width: Kirigami.Units.iconSizes.smallMedium - height: width - source: modelData.iconName - } - activeFocusOnTab: focus || delegate.focus - onClicked: modelData.trigger() - enabled: modelData.enabled - visible: modelData.visible - //NOTE: there aren't any global settings where to take "official" tooltip timeouts - Controls.ToolTip.delay: 1000 - Controls.ToolTip.timeout: 5000 - Controls.ToolTip.visible: (Kirigami.Settings.isMobile ? pressed : hovered) && modelData.tooltip.length > 0 - Controls.ToolTip.text: modelData.tooltip - } - } - } - } } // Bug 397367: explicitly using "delegate" as otherwise it crashes when switching between KCMs layer.enabled: delegate.GraphicsInfo.api === GraphicsInfo.OpenGL @@ -186,6 +134,57 @@ } } + FocusScope { + id: actionsScope + + visible: actionsRow.children.length > 0 + opacity: Kirigami.Settings.isMobile || delegate.hovered || (actionsScope.focus) ? 1 : 0 + + anchors { + right: thumbnail.right + rightMargin: -height/2 + Kirigami.Units.smallSpacing * 2 + top: thumbnail.top + topMargin: -height/2 + Kirigami.Units.smallSpacing * 2 + } + width: actionsRow.width + height: actionsRow.height + + Behavior on opacity { + PropertyAnimation { + duration: Kirigami.Units.longDuration + easing.type: Easing.OutQuad + } + } + RowLayout { + id: actionsRow + + Repeater { + model: delegate.actions + delegate: Controls.RoundButton { + Kirigami.Icon { + anchors.centerIn: parent + width: Kirigami.Units.iconSizes.smallMedium + height: width + source: modelData.iconName + } + radius: height/2 + activeFocusOnTab: focus || delegate.focus + onClicked: { + modelData.trigger() + delegate.clicked() + } + enabled: modelData.enabled + visible: modelData.visible + //NOTE: there aren't any global settings where to take "official" tooltip timeouts + Controls.ToolTip.delay: 1000 + Controls.ToolTip.timeout: 5000 + Controls.ToolTip.visible: (Kirigami.Settings.isMobile ? pressed : hovered) && modelData.tooltip.length > 0 + Controls.ToolTip.text: modelData.tooltip + } + } + } + } + Controls.Label { id: label anchors { diff --git a/src/qmlcontrols/kcmcontrols/qml/GridView.qml b/src/qmlcontrols/kcmcontrols/qml/GridView.qml --- a/src/qmlcontrols/kcmcontrols/qml/GridView.qml +++ b/src/qmlcontrols/kcmcontrols/qml/GridView.qml @@ -54,7 +54,7 @@ GridView { id: view property int implicitCellWidth: Kirigami.Units.gridUnit * 10 - property int implicitCellHeight: Math.round(implicitCellWidth / 1.6) + Kirigami.Units.gridUnit*2 + property int implicitCellHeight: Math.round(implicitCellWidth / 1.6) + Kirigami.Units.gridUnit*4 onCurrentIndexChanged: positionViewAtIndex(currentIndex, GridView.Contain);