diff --git a/src/declarativeimports/plasmacomponents3/Button.qml b/src/declarativeimports/plasmacomponents3/Button.qml index 9ffa63e5d..c30648887 100644 --- a/src/declarativeimports/plasmacomponents3/Button.qml +++ b/src/declarativeimports/plasmacomponents3/Button.qml @@ -52,6 +52,7 @@ T.Button { implicitHeight: units.gridUnit * 1.6 Private.ButtonShadow { anchors.fill: parent + visible: (!control.flat || control.hovered) && (!control.pressed || !control.checked) state: { if (control.pressed) { return "hidden" @@ -69,7 +70,7 @@ T.Button { anchors.fill: parent imagePath: "widgets/button" prefix: "normal" - opacity: control.checked || control.pressed ? 0 : 1 + opacity: (!control.flat || control.hovered) && (!control.pressed || !control.checked) ? 1 : 0 Behavior on opacity { OpacityAnimator { duration: units.longDuration diff --git a/tests/buttons_pc3.0.qml b/tests/buttons_pc3.0.qml new file mode 100644 index 000000000..343d2010d --- /dev/null +++ b/tests/buttons_pc3.0.qml @@ -0,0 +1,28 @@ +import QtQuick 2.0 + +import org.kde.plasma.components 3.0 as PlasmaComponents + +Rectangle +{ + width: 500 + height: 300 + color: "white" + + Flow { + anchors.fill: parent + anchors.margins: 20 + spacing: 20 + + PlasmaComponents.Button { + text: "test" + } + PlasmaComponents.Button { + text: "test" + flat: true + } + PlasmaComponents.ToolButton { + text: "test" + } + } +} +