always use round buttons on toolbuttons without text
This commit is contained in:
parent
b50652c805
commit
78a87b1da3
@ -99,7 +99,7 @@ Item {
|
||||
anchors.fill:parent
|
||||
property QtObject margins: item.margins
|
||||
sourceComponent: {
|
||||
if (label.paintedWidth == 0 && !flat) {
|
||||
if (label.text.length == 0) {
|
||||
return roundButtonComponent
|
||||
} else {
|
||||
return buttonComponent
|
||||
@ -145,7 +145,9 @@ Item {
|
||||
property int bottom: width/8
|
||||
}
|
||||
Private.RoundShadow {
|
||||
id: roundShadow
|
||||
anchors.fill: parent
|
||||
visible: !flat
|
||||
state: (internal.userPressed || checked) ? "hidden" : "shadow"
|
||||
}
|
||||
|
||||
@ -160,6 +162,11 @@ Item {
|
||||
elementId: (internal.userPressed || checked) ? "pressed" : "normal"
|
||||
width: parent.height
|
||||
height: width
|
||||
opacity: (internal.userPressed || checked || !flat || (roundShadow.hasOverState && mouse.containsMouse)) ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
PropertyAnimation { duration: 250 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ Item {
|
||||
property string hoverElement: "hover"
|
||||
property string focusElement: "focus"
|
||||
property alias shadowElement: shadow.elementId
|
||||
property bool hasOverState: false
|
||||
|
||||
PlasmaCore.Svg {
|
||||
id: shadowSvg
|
||||
|
@ -152,7 +152,7 @@ Item {
|
||||
property QtObject margins: item.margins
|
||||
property string shadowState: "shadow"
|
||||
sourceComponent: {
|
||||
if (label.paintedWidth == 0 && !flat) {
|
||||
if (label.text.length == 0) {
|
||||
return roundButtonComponent
|
||||
} else {
|
||||
return buttonComponent
|
||||
@ -198,6 +198,8 @@ Item {
|
||||
property int bottom: width/8
|
||||
}
|
||||
Private.RoundShadow {
|
||||
id: roundShadow
|
||||
visible: !flat
|
||||
anchors.fill: parent
|
||||
state: delegate.shadowState
|
||||
}
|
||||
@ -213,6 +215,11 @@ Item {
|
||||
elementId: (internal.userPressed || checked) ? "pressed" : "normal"
|
||||
width: parent.height
|
||||
height: width
|
||||
//internal: if there is no hover status, don't paint on mouse over in touchscreens
|
||||
opacity: (internal.userPressed || checked || !flat || (roundShadow.hasOverState && mouse.containsMouse)) ? 1 : 0
|
||||
Behavior on opacity {
|
||||
PropertyAnimation { duration: 250 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ Item {
|
||||
property string focusElement: "focus"
|
||||
property alias shadowElement: shadow.elementId
|
||||
|
||||
//used to tell apart this implementation with the touch components one
|
||||
property bool hasOverState: true
|
||||
|
||||
PlasmaCore.Svg {
|
||||
id: shadowSvg
|
||||
imagePath: "widgets/actionbutton"
|
||||
|
Loading…
Reference in New Issue
Block a user