Skip to content

Commit

Permalink
Fix FloatingActionKey style
Browse files Browse the repository at this point in the history
  • Loading branch information
dobey committed Nov 4, 2021
1 parent 703ade3 commit 84dffbe
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions qml/keys/FloatingActionKey.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ AbstractButton {
}

background: Rectangle {
id: bg
color: normalColor
radius: Device.gu(0.5)

Connections {
target: floatingActionKey
onPressedChanged: {
if (target.pressed) {
color = pressedColor
bg.color = pressedColor
} else {
color = Qt.binding(function(){return normalColor})
bg.color = Qt.binding(function(){return normalColor})
}
}
}
Expand All @@ -50,25 +51,14 @@ AbstractButton {
centerIn: parent
}

Image {
KeyIcon {
id: icon

Layout.preferredWidth: label.text ? Device.gu(2) : Device.gu(3)
Layout.preferredHeight: Layout.preferredWidth
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter

source: Theme.iconsPath + "/%1.png".arg(action.icon.name)
fillMode: Image.PreserveAspectFit
visible: false
}

ColorOverlay {
Layout.preferredWidth: label.text ? Device.gu(2) : Device.gu(3)
Layout.preferredHeight: Layout.preferredWidth
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter

cached: true
source: icon
name: action.icon.name
color: Theme.fontColor
visible: action.icon.name != ""
}
Expand All @@ -78,7 +68,8 @@ AbstractButton {

Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter


visible: action.text
text: action.text
renderType: Text.QtRendering
font.weight: Font.Normal
Expand Down

0 comments on commit 84dffbe

Please sign in to comment.