From 6e935db7bfe6a15c146671661aebf43b4e42e923 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 25 Jul 2017 01:16:33 +0200 Subject: IconButton based on AbstractButton --- framework/qml/IconButton.qml | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) (limited to 'framework/qml') diff --git a/framework/qml/IconButton.qml b/framework/qml/IconButton.qml index f6b97090..302e51b0 100644 --- a/framework/qml/IconButton.qml +++ b/framework/qml/IconButton.qml @@ -17,49 +17,20 @@ */ import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import QtQuick.Templates 2.0 as T -import org.kube.framework 1.0 as Kube +import org.kube.framework 1.0 -T.Button { +AbstractButton { id: root property alias iconName: icon.iconName - width: Kube.Units.gridUnit + leftPadding + rightPadding - height: Kube.Units.gridUnit + topPadding + bottomPadding + width: Units.gridUnit + leftPadding + rightPadding + height: Units.gridUnit + topPadding + bottomPadding - padding: Kube.Units.smallSpacing + padding: Units.smallSpacing + color: "transparent" - clip: true - hoverEnabled: true - Keys.onReturnPressed: root.clicked() - - background: Item { - Rectangle { - anchors.fill: parent - visible: root.checked - color: Kube.Colors.highlightColor - } - Rectangle { - anchors.fill: parent - visible: root.hovered || root.visualFocus - color: "transparent" - border { - width: 2 - color: Kube.Colors.focusedButtonColor - } - } - - Rectangle { - anchors.fill: parent - visible: root.pressed - color: Kube.Colors.textColor - opacity: 0.2 - } - } - - contentItem: Kube.Icon { + contentItem: Icon { id: icon } } -- cgit v1.2.3