diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2012-05-11 17:22:23 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2012-05-28 15:28:26 -0300 |
commit | 7041a3c16d6d8c230ea43b68ed40a03be055aaba (patch) | |
tree | 014d7b32b09e11bba08a366bbd9eeabad37796e7 | |
parent | 2a4a8bdb259e9f4958f18d0dfbc3cc800eb6ee2d (diff) |
Blink the statusbar indicator when the load progress is 0%.
Reviewed-by: Rafael Brandão
-rw-r--r-- | src/mobile/qml/IndicatorRow.qml | 3 | ||||
-rw-r--r-- | src/mobile/qml/NavigationPanel.qml | 1 | ||||
-rw-r--r-- | src/mobile/qml/StatusBarIndicator.qml | 11 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/mobile/qml/IndicatorRow.qml b/src/mobile/qml/IndicatorRow.qml index 168df66..6a78794 100644 --- a/src/mobile/qml/IndicatorRow.qml +++ b/src/mobile/qml/IndicatorRow.qml @@ -17,10 +17,12 @@ import QtQuick 2.0 Item { + id: indicatorRow property int itemCount: 0 property int currentItem: 0 property int maxItems: 0 property int loadProgress: 0 + property bool blinkOnZeroProgress: false height: 21 function roundProgress() { @@ -35,6 +37,7 @@ Item { StatusBarIndicator { valid: index < itemCount active: index === currentItem + blinkOnZeroProgress: indicatorRow.blinkOnZeroProgress loadProgress: active ? roundProgress() : 0 } } diff --git a/src/mobile/qml/NavigationPanel.qml b/src/mobile/qml/NavigationPanel.qml index 597e7fb..cb0a8a7 100644 --- a/src/mobile/qml/NavigationPanel.qml +++ b/src/mobile/qml/NavigationPanel.qml @@ -266,6 +266,7 @@ Item { maxItems: pageBarRow.maxItems * UiConstants.PagedGridItemsPerPage currentItem: Math.max(0, TabsModel.currentWebViewIndex) loadProgress: visibleTab != null ? visibleTab.loadProgress : 0 + blinkOnZeroProgress: true } MouseArea { diff --git a/src/mobile/qml/StatusBarIndicator.qml b/src/mobile/qml/StatusBarIndicator.qml index 76972c8..6393282 100644 --- a/src/mobile/qml/StatusBarIndicator.qml +++ b/src/mobile/qml/StatusBarIndicator.qml @@ -17,10 +17,12 @@ import QtQuick 2.0 Image { + id: indicator z: 1 property bool active: true property bool valid: true property int loadProgress + property bool blinkOnZeroProgress source: valid ? (active ? "qrc:///mobile/indicator/loading_active" : "qrc:///mobile/indicator/loading_inactive") : "qrc:///mobile/indicator/loading_active" @@ -44,6 +46,15 @@ Image { from: ""; to: "hideProgress" PropertyAnimation { target: progressIndicator; properties: "opacity"; duration: 200 } } + } + Timer { + running: blinkOnZeroProgress && active && loadProgress === 0 + repeat: true + interval: 500 + onTriggered: { + indicator.opacity = indicator.opacity === 1.0 ? 0.1 : 1.0; + } + onRunningChanged: if (!running) indicator.opacity = 1.0; } } |