From 996b36714d0e831900306ba6956ed5d8f4d87e58 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 30 Mar 2021 10:35:53 -0400 Subject: [PATCH] fix: fix scroll speed on Windows --- src/app/utilsView/view.nim | 9 +++++++++ ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml | 7 ++++++- ui/imports/Constants.qml | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/app/utilsView/view.nim b/src/app/utilsView/view.nim index 5965727efc..093225e922 100644 --- a/src/app/utilsView/view.nim +++ b/src/app/utilsView/view.nim @@ -33,6 +33,15 @@ QtObject: proc getDataDir*(self: UtilsView): string {.slot.} = result = accountConstants.DATADIR + proc getOs*(self: UtilsView): string {.slot.} = + if defined(windows): + return "windows" + elif (defined(macosx)): + return "mac" + elif (defined(linux)): + return "linux" + return "unknown" + proc joinPath*(self: UtilsView, start: string, ending: string): string {.slot.} = result = os.joinPath(start, ending) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml index d02083bb99..a7f2594766 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml @@ -37,7 +37,12 @@ ScrollView { anchors.bottomMargin: Style.current.bigPadding spacing: appSettings.useCompactMode ? 0 : 4 boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 10000 + flickDeceleration: { + if (utilsModel.getOs() === Constants.windows) { + return 5000 + } + return 10000 + } Layout.fillWidth: true Layout.fillHeight: true verticalLayoutDirection: ListView.BottomToTop diff --git a/ui/imports/Constants.qml b/ui/imports/Constants.qml index d61f83805c..26c7ab572e 100644 --- a/ui/imports/Constants.qml +++ b/ui/imports/Constants.qml @@ -67,6 +67,10 @@ QtObject { readonly property string seedWalletType: "seed" readonly property string generatedWalletType: "generated" + readonly property string windows: "windows" + readonly property string linux: "linux" + readonly property string mac: "mac" + // Transaction states readonly property int addressRequested: 1 readonly property int declined: 2