Reset flickable scrollview to 0 Y position

This commit is contained in:
Sander Ferdinand 2018-04-05 11:52:09 +02:00
parent 3b76636d6b
commit 1378ae45c3
2 changed files with 13 additions and 1 deletions

View file

@ -50,6 +50,7 @@ Rectangle {
property string unlockedBalanceText property string unlockedBalanceText
property int minHeight: (appWindow.height > 800) ? appWindow.height : 800 * scaleRatio property int minHeight: (appWindow.height > 800) ? appWindow.height : 800 * scaleRatio
property alias contentHeight: mainFlickable.contentHeight property alias contentHeight: mainFlickable.contentHeight
property alias flickable: mainFlickable
// property int headerHeight: header.height // property int headerHeight: header.height
property Transfer transferView: Transfer { } property Transfer transferView: Transfer { }

View file

@ -1317,6 +1317,7 @@ ApplicationWindow {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
onDashboardClicked: { onDashboardClicked: {
middlePanel.state = "Dashboard"; middlePanel.state = "Dashboard";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1325,6 +1326,8 @@ ApplicationWindow {
onTransferClicked: { onTransferClicked: {
middlePanel.state = "Transfer"; middlePanel.state = "Transfer";
middlePanel.flickable.contentY = 0;
mainFlickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1333,6 +1336,7 @@ ApplicationWindow {
onReceiveClicked: { onReceiveClicked: {
middlePanel.state = "Receive"; middlePanel.state = "Receive";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1341,6 +1345,7 @@ ApplicationWindow {
onTxkeyClicked: { onTxkeyClicked: {
middlePanel.state = "TxKey"; middlePanel.state = "TxKey";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1349,6 +1354,7 @@ ApplicationWindow {
onSharedringdbClicked: { onSharedringdbClicked: {
middlePanel.state = "SharedRingDB"; middlePanel.state = "SharedRingDB";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1357,6 +1363,7 @@ ApplicationWindow {
onHistoryClicked: { onHistoryClicked: {
middlePanel.state = "History"; middlePanel.state = "History";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1365,6 +1372,7 @@ ApplicationWindow {
onAddressBookClicked: { onAddressBookClicked: {
middlePanel.state = "AddressBook"; middlePanel.state = "AddressBook";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1373,6 +1381,7 @@ ApplicationWindow {
onMiningClicked: { onMiningClicked: {
middlePanel.state = "Mining"; middlePanel.state = "Mining";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1381,6 +1390,7 @@ ApplicationWindow {
onSignClicked: { onSignClicked: {
middlePanel.state = "Sign"; middlePanel.state = "Sign";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
@ -1389,11 +1399,12 @@ ApplicationWindow {
onSettingsClicked: { onSettingsClicked: {
middlePanel.state = "Settings"; middlePanel.state = "Settings";
middlePanel.flickable.contentY = 0;
if(isMobile) { if(isMobile) {
hideMenu(); hideMenu();
} }
updateBalance(); updateBalance();
} }
onKeysClicked: { onKeysClicked: {
passwordDialog.onAcceptedCallback = function() { passwordDialog.onAcceptedCallback = function() {