aboutsummaryrefslogtreecommitdiff
path: root/components/MenuButton.qml
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2017-11-03 15:29:10 -0500
committerluigi1111 <luigi1111w@gmail.com>2017-11-03 15:29:10 -0500
commitc58dfa913bb356368e12dc5248c4f5acdfe3934d (patch)
treeb50d0010ac51fa44405bcaec573dab03236ff9cb /components/MenuButton.qml
parent6f95f8a7545bbdc25750412c54a92ddc5224b3ad (diff)
parentceeb9b667fa35f92054c79942b593337fadcd08b (diff)
downloadmonzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.tar.gz
monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.tar.xz
monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.zip
Merge pull request #826
Remote nodes + mobile layout
Diffstat (limited to 'components/MenuButton.qml')
-rw-r--r--components/MenuButton.qml27
1 files changed, 17 insertions, 10 deletions
diff --git a/components/MenuButton.qml b/components/MenuButton.qml
index a7baa019..23ab4f74 100644
--- a/components/MenuButton.qml
+++ b/components/MenuButton.qml
@@ -38,11 +38,18 @@ Rectangle {
property var under: null
signal clicked()
+ function doClick() {
+ // Android workaround
+ releaseFocus();
+ clicked();
+ }
+
+
function getOffset() {
var offset = 0
var item = button
while (item.under) {
- offset += 20
+ offset += 20 * scaleRatio
item = item.under
}
return offset
@@ -50,7 +57,7 @@ Rectangle {
color: checked ? "#FFFFFF" : "#1C1C1C"
property bool present: !under || under.checked || checked || under.numSelectedChildren > 0
- height: present ? ((appWindow.height >= 800) ? 64 : 52) : 0
+ height: present ? ((appWindow.height >= 800) ? 64 * scaleRatio : 52 * scaleRatio ) : 0
transform: Scale {
yScale: button.present ? 1 : 0
@@ -76,18 +83,18 @@ Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.leftMargin: parent.getOffset()
- width: 50
+ width: 50 * scaleRatio
Rectangle {
id: dot
anchors.centerIn: parent
- width: 16
+ width: 16 * scaleRatio
height: width
radius: height / 2
Rectangle {
anchors.centerIn: parent
- width: 12
+ width: 12 * scaleRatio
height: width
radius: height / 2
color: "#1C1C1C"
@@ -98,7 +105,7 @@ Rectangle {
Text {
id: symbolText
anchors.centerIn: parent
- font.pixelSize: 11
+ font.pixelSize: 11 * scaleRatio
font.bold: true
color: button.checked || buttonArea.containsMouse ? "#FFFFFF" : dot.color
visible: appWindow.ctrlPressed
@@ -117,7 +124,7 @@ Rectangle {
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
- anchors.rightMargin: 20
+ anchors.rightMargin: 20 * scaleRatio
anchors.leftMargin: parent.getOffset()
source: "../images/menuIndicator.png"
}
@@ -126,9 +133,9 @@ Rectangle {
id: label
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
- anchors.leftMargin: parent.getOffset() + 50
+ anchors.leftMargin: parent.getOffset() + 50 * scaleRatio
font.family: "Arial"
- font.pixelSize: 18
+ font.pixelSize: 18 * scaleRatio
color: parent.checked ? "#000000" : "#FFFFFF"
}
@@ -139,7 +146,7 @@ Rectangle {
onClicked: {
if(parent.checked)
return
- button.clicked()
+ button.doClick()
parent.checked = true
}
}