Making buttons more responsive

Code in LoopListPowerItem.qml is absolute piece of shit, but it works.
This commit is contained in:
Eric Kotato 2018-09-09 18:49:35 +03:00
parent 2c57cc52c1
commit ba7a7d6b29
2 changed files with 14 additions and 14 deletions

View file

@ -14,8 +14,8 @@ Item
transform: Scale
{
origin.x: 54
origin.y: 29
origin.x: descriptionLabel.height + 10 + 2
origin.y: descriptionLabel.height + 10 / 2
xScale: distance
yScale: distance
}
@ -33,8 +33,8 @@ Item
{
id: powerItemIcon
source: icon
sourceSize.width: 48
sourceSize.height: 48
sourceSize.width: descriptionLabel.height + 10 - 4
sourceSize.height: descriptionLabel.height + 10 - 4
x: 2
y: 2
}
@ -49,8 +49,8 @@ Item
Rectangle
{
width: 52
height: 52
width: descriptionLabel.height + 10
height: descriptionLabel.height + 10
color: ( hover ? colors.iconBgHover : colors.iconBg )
}
@ -62,22 +62,22 @@ Item
font: fonts.listItemMed
x: 64
x: descriptionLabel.height + 10 + 12
y: 5
}
Rectangle
{
x: 54
width: parent.width - 54
height: 52
x: descriptionLabel.height + 10 + 2
width: parent.width - descriptionLabel.height + 10 - 2
height: descriptionLabel.height + 10
color: ( hover ? colors.textBgHover : colors.textBg )
}
MouseArea
{
width: descriptionLabel.x + descriptionLabel.width
height: 52
height: descriptionLabel.height + 10
hoverEnabled: true
onClicked: itemRoot.clicked()

View file

@ -3,13 +3,14 @@ import QtQuick 2.7
Item
{
id: buttonRoot
height: 25
height: paddingTop * 2 + buttonText.height
property font font: Qt.font({
family: config.font,
bold: true,
pointSize: 13,
capitalization: Font.AllUppercase
capitalization: Font.AllUppercase,
smooth: false
});
property string text: ""
@ -230,7 +231,6 @@ Item
font: buttonRoot.font
text: ""
}
MouseArea