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

View file

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