Don't show the background if Button.flat
Summary: Otherwise the flat property is ignored Test Plan: Tested on KDE Connect port to use PlasmaComponents Reviewers: #plasma, mart Reviewed By: #plasma, mart Subscribers: mart, #frameworks Tags: #frameworks Differential Revision: https://phabricator.kde.org/D11652
This commit is contained in:
parent
2de1bda33a
commit
49ef90bcb9
@ -52,6 +52,7 @@ T.Button {
|
|||||||
implicitHeight: units.gridUnit * 1.6
|
implicitHeight: units.gridUnit * 1.6
|
||||||
Private.ButtonShadow {
|
Private.ButtonShadow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
visible: (!control.flat || control.hovered) && (!control.pressed || !control.checked)
|
||||||
state: {
|
state: {
|
||||||
if (control.pressed) {
|
if (control.pressed) {
|
||||||
return "hidden"
|
return "hidden"
|
||||||
@ -69,7 +70,7 @@ T.Button {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
prefix: "normal"
|
prefix: "normal"
|
||||||
opacity: control.checked || control.pressed ? 0 : 1
|
opacity: (!control.flat || control.hovered) && (!control.pressed || !control.checked) ? 1 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
OpacityAnimator {
|
OpacityAnimator {
|
||||||
duration: units.longDuration
|
duration: units.longDuration
|
||||||
|
28
tests/buttons_pc3.0.qml
Normal file
28
tests/buttons_pc3.0.qml
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user