on xenial help sign in
show progress bar instead of spinner
commit0b02859f684f7a0ddefd521e8208ab6e6c2ac0ac authorDiego Sarmentero <diego.sarmentero@gmail.com> dateMon 11 Aug 2014, 15:32 (12 years ago) parent3ab9fe6
3 files changed+14−15
qml/Dash/PreviewListView.qml+1−2 qml/Dash/Previews/Preview.qml−7 qml/Dash/Previews/PreviewPayments.qml+13−6
qml/Dash/PreviewListView.qml+1−2
@@ -33,8 +33,7 @@ Item {
3333 property alias count: previewListView.count
3434
3535 readonly property bool processing: currentItem && (!currentItem.previewModel.loaded
36− || currentItem.previewModel.processingAction
37− || currentItem.actionInProgress)
36+ || currentItem.previewModel.processingAction)
3837
3938 PageHeader {
4039 id: header
qml/Dash/Previews/Preview.qml−7
@@ -39,9 +39,6 @@ Item {
3939 //! \brief The ScopeStyle component.
4040 property var scopeStyle: null
4141
42− //! \brief Should be set to true if an operation is in the background and the preview shouldn't allow interactions.
43− property bool actionInProgress: false
44−
4542 clip: true
4643
4744 Binding {
@@ -95,10 +92,6 @@ Item {
9592 previewModel.triggered(widgetId, actionId, data);
9693 }
9794
98− onProcessing: {
99− root.actionInProgress = active;
100− }
101−
10295 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
10396
10497 onHeightChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
qml/Dash/Previews/PreviewPayments.qml+13−6
@@ -38,15 +38,16 @@ PreviewWidget {
3838 objectName: "paymentButton"
3939
4040 color: Theme.palette.selected.foreground
41− text: root.processActive ? i18n.tr("Purchasing…") : paymentClient.formattedPrice
41+ text: paymentClient.formattedPrice
4242 onClicked: {
4343 root.processActive = true;
44− root.processing(root.processActive);
4544 paymentClient.start();
4645 }
4746 enabled: !root.processActive
4847 anchors.right: parent.right
4948 width: (root.width - units.gu(1)) / 2
49+ opacity: root.processActive ? 0 : 1
50+ Behavior on opacity { PropertyAnimation {duration: UbuntuAnimation.SlowDuration}}
5051
5152 Payments {
5253 id: paymentClient
@@ -57,15 +58,21 @@ PreviewWidget {
5758 currency: source["currency"]
5859 storeItemId: source["store_item_id"]
5960 onPurchaseCompleted: {
60− root.processActive = false;
61− root.processing(root.processActive);
6261 root.triggered(widgetId, "purchaseCompleted", source);
6362 }
6463 onPurchaseError: {
65− root.processActive = false;
66− root.processing(root.processActive);
6764 root.triggered(widgetId, "purchaseError", source);
6865 }
6966 }
7067 }
68+
69+ ProgressBar {
70+ id: loadingBar
71+ indeterminate: true
72+ anchors.right: parent.right
73+ width: (root.width - units.gu(1)) / 2
74+ opacity: root.processActive ? 1 : 0
75+
76+ Behavior on opacity { PropertyAnimation {duration: UbuntuAnimation.SlowDuration}}
77+ }
7178}