From 2d182af76144ad623f88ffdccc0b5373d830ab99 Mon Sep 17 00:00:00 2001 From: Kugi Date: Tue, 7 Jul 2020 19:16:32 +0800 Subject: [PATCH] implemented auto hide of bottom hint --- src/app/webbrowser/Browser.qml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/app/webbrowser/Browser.qml b/src/app/webbrowser/Browser.qml index 96d81eeef..614f19210 100644 --- a/src/app/webbrowser/Browser.qml +++ b/src/app/webbrowser/Browser.qml @@ -986,6 +986,11 @@ Common.BrowserView { } visible: bottomEdgeHandle.enabled && !internal.hasMouse opacity: recentView.visible ? 0 : 1 + + function show() { + opacity = Qt.binding(function(){return recentView.visible ? 0 : 1}) + } + Behavior on opacity { UbuntuNumberAnimation {} } @@ -999,6 +1004,31 @@ Common.BrowserView { // TRANSLATORS: %1 refers to the current number of tabs opened text: i18n.tr("(%1)").arg(tabsModel ? tabsModel.count : 0) } + + Timer { + id: autohideTimer + interval: 2000 + onTriggered: { + bottomEdgeHint.opacity = 0 + } + } + + Connections { + target: currentWebview ? currentWebview : null + onScrollPositionChanged: { + bottomEdgeHint.show() + autohideTimer.restart() + } + } + + Connections { + target: browser + + onCurrentWebviewChanged: { + autohideTimer.stop() + bottomEdgeHint.show() + } + } } MouseArea {