From ba7a7d6b295dc8eee5cd2b5ef8cea9e48c1a97e9 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Sun, 9 Sep 2018 18:49:35 +0300 Subject: [PATCH] Making buttons more responsive Code in LoopListPowerItem.qml is absolute piece of shit, but it works. --- slice/LoopListPowerItem.qml | 22 +++++++++++----------- slice/SlicedButton.qml | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/slice/LoopListPowerItem.qml b/slice/LoopListPowerItem.qml index 2c24c63..54d3a83 100644 --- a/slice/LoopListPowerItem.qml +++ b/slice/LoopListPowerItem.qml @@ -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() diff --git a/slice/SlicedButton.qml b/slice/SlicedButton.qml index 1e74928..02d3fa0 100644 --- a/slice/SlicedButton.qml +++ b/slice/SlicedButton.qml @@ -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