diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2022-01-01 12:47:25 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2022-01-01 12:47:25 -0500 |
| commit | 41b827b65d1e291ac44c188b89df053fd25eecdc (patch) | |
| tree | 8f47820fc61a8a2f84a9bc5e792d1b51f37b7086 | |
| parent | 0b6ceab25b608b3939bed2e62fe5ddea572f259d (diff) | |
| parent | 70e3c2d3ad20b149da641694359101408ba3204e (diff) | |
| download | monzero-gui-41b827b65d1e291ac44c188b89df053fd25eecdc.tar.gz monzero-gui-41b827b65d1e291ac44c188b89df053fd25eecdc.tar.xz monzero-gui-41b827b65d1e291ac44c188b89df053fd25eecdc.zip | |
Merge pull request #3783
70e3c2d Settings, Advanced: mirror stack transition when clicking on a button on the left (rating89us)
| -rw-r--r-- | components/Navbar.qml | 11 | ||||
| -rw-r--r-- | pages/Advanced.qml | 5 | ||||
| -rw-r--r-- | pages/settings/Settings.qml | 5 |
3 files changed, 16 insertions, 5 deletions
diff --git a/components/Navbar.qml b/components/Navbar.qml index f7a55abf..3ea7c07a 100644 --- a/components/Navbar.qml +++ b/components/Navbar.qml @@ -32,6 +32,8 @@ import "." as MoneroComponents Rectangle { default property list<MoneroComponents.NavbarItem> items + property alias currentIndex: repeater.currentIndex + property alias previousIndex: repeater.previousIndex color: "transparent" height: grid.height @@ -100,7 +102,10 @@ Rectangle { } Repeater { + id: repeater model: items.length + property int currentIndex: 0 + property int previousIndex: 0 RowLayout { spacing: 0 @@ -149,7 +154,11 @@ Rectangle { hoverEnabled: true cursorShape: Qt.PointingHandCursor - onClicked: items[index].selected() + onClicked: { + repeater.previousIndex = repeater.currentIndex; + repeater.currentIndex = index; + items[index].selected() + } } } diff --git a/pages/Advanced.qml b/pages/Advanced.qml index fbd45d76..6aa8ac46 100644 --- a/pages/Advanced.qml +++ b/pages/Advanced.qml @@ -43,6 +43,7 @@ ColumnLayout { property alias state: stateView.state MoneroComponents.Navbar { + id: navbarId Layout.alignment: Qt.AlignHCenter Layout.topMargin: height Layout.bottomMargin: height @@ -128,7 +129,7 @@ ColumnLayout { PropertyAnimation { target: enterItem property: "x" - from: 0 - target.width + from: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * - target.width to: 0 duration: 300 easing.type: Easing.OutCubic @@ -137,7 +138,7 @@ ColumnLayout { target: exitItem property: "x" from: 0 - to: target.width + to: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * target.width duration: 300 easing.type: Easing.OutCubic } diff --git a/pages/settings/Settings.qml b/pages/settings/Settings.qml index 703ea346..fdf03ce6 100644 --- a/pages/settings/Settings.qml +++ b/pages/settings/Settings.qml @@ -49,6 +49,7 @@ ColumnLayout { property alias settingsStateViewState: settingsStateView.state MoneroComponents.Navbar { + id: navbarId Layout.alignment: Qt.AlignHCenter Layout.topMargin: height Layout.bottomMargin: height @@ -145,7 +146,7 @@ ColumnLayout { PropertyAnimation { target: enterItem property: "x" - from: 0 - target.width + from: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * - target.width to: 0 duration: 300 easing.type: Easing.OutCubic @@ -154,7 +155,7 @@ ColumnLayout { target: exitItem property: "x" from: 0 - to: target.width + to: (navbarId.currentIndex < navbarId.previousIndex ? 1 : -1) * target.width duration: 300 easing.type: Easing.OutCubic } |
