From 0a3d75d197dbc6fd8a5dfd056f3b91cb2d90791b Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 5 Aug 2018 23:54:30 +0200 Subject: [PATCH] Fixes a particular hard to track bug where ColumnLayout considers MouseArea as part of its height/width after the parent StackView changed state a few times --- pages/settings/Navbar.qml | 85 +++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/pages/settings/Navbar.qml b/pages/settings/Navbar.qml index 4f4736f3..4c1c5d2a 100644 --- a/pages/settings/Navbar.qml +++ b/pages/settings/Navbar.qml @@ -60,11 +60,10 @@ Rectangle { property string borderColor: "#808080" property int textMargin: { // left-right margins for a given cell - console.log(appWindow.width); if(isMobile){ - return 18; + return 10; } else if(appWindow.width < 890){ - return 40; + return 32; } else { return 64; } @@ -109,6 +108,14 @@ Rectangle { text: qsTr("Wallet") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Wallet" } + } } Rectangle { @@ -116,14 +123,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Wallet" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -159,6 +158,14 @@ Rectangle { text: qsTr("Layout") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "UI" } + } } Rectangle { @@ -166,14 +173,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "UI" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -209,6 +208,14 @@ Rectangle { text: qsTr("Node") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Node" } + } } Rectangle { @@ -216,14 +223,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Node" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -259,6 +258,14 @@ Rectangle { text: qsTr("Log") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Log" } + } } Rectangle { @@ -266,14 +273,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Log" } - } } Rectangle{ Layout.preferredWidth: 1 @@ -309,6 +308,14 @@ Rectangle { text: qsTr("Info") + translationManager.emptyString color: grid.fontColor } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { settingsStateView.state = "Info" } + } } Rectangle { @@ -316,14 +323,6 @@ Rectangle { Layout.preferredHeight: 1 Layout.fillWidth: true } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { settingsStateView.state = "Info" } - } } Image { Layout.preferredWidth: 2