Skip to content

Commit

Permalink
Use MMBusyIndicator instead of Qt's one (#3099)
Browse files Browse the repository at this point in the history
use MMBusyIndicator instead of Qt's BusyIndicator
  • Loading branch information
PeterPetrik authored Mar 4, 2024
1 parent 0216d3e commit 64c58ef
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 81 deletions.
5 changes: 2 additions & 3 deletions app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(MM_QML
Notification.qml
NotificationBanner.qml
misc/NoWorkspaceBanner.qml

account/MMAcountPage.qml
account/MMAcountPageItem.qml
account/MMSwitchWorkspacePage.qml
Expand All @@ -28,7 +27,7 @@ set(MM_QML
components/MMLinkButton.qml
components/MMListDrawer.qml
components/MMListDrawerItem.qml
components/MMLoadingSpinner.qml
components/MMBusyIndicator.qml
components/MMMenuDrawer.qml
components/MMMessage.qml
components/MMMorePhoto.qml
Expand Down Expand Up @@ -120,7 +119,7 @@ set(MM_QML
map/MMRecordingTools.qml
map/components/MMBlurBox.qml
map/components/MMCrosshair.qml
map/components/MMLoadingIndicator.qml
map/components/MMMapLoadingIndicator.qml
map/components/MMMapBlurLabel.qml
map/components/MMMapButton.qml
map/components/MMMapLabel.qml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import QtQuick
Item {
id: root

property bool running: false
property real size: 60 * __dp
property alias running: root.visible
property int speed: 800

width: __style.row63
height: width
visible: running
width: root.size
height: root.size
visible: false

Image {
id: icon
Expand Down
6 changes: 2 additions & 4 deletions app/qml/gps/MMBluetoothConnectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ Drawer {
width: parent.width
height: resultIcon.height

BusyIndicator {
MMBusyIndicator {
id: loadingSpinner
height: parent.height / 2
width: parent.height / 2

size: parent.height / 2
anchors.centerIn: parent
running: rootstate.state === "working"
}
Expand Down
6 changes: 2 additions & 4 deletions app/qml/layers/MMFeaturesListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,10 @@ Page {
onTriggered: featuresModel.searchExpression = searchbox.text
}

BusyIndicator {
MMBusyIndicator {
id: busyIndicator
width: parent.width/8
height: width
size: parent.width/8
running: featuresModel.fetchingResults
visible: running
anchors.centerIn: parent
}

Expand Down
5 changes: 2 additions & 3 deletions app/qml/map/MMMapWrapper.qml
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,12 @@ Item {
}

// TOP elements
MMLoadingIndicator {
MMMapLoadingIndicator {
id: loadingIndicator

width: mapCanvas.width
height: visible ? 7 * __dp : 0
anchors.top: canvasRoot.top
visible: mapCanvas.isRendering && root.state !== "inactive"
running: mapCanvas.isRendering && root.state !== "inactive"
}

MMMapButton {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ import QtQuick.Controls
import Qt5Compat.GraphicalEffects

Rectangle {
id: loadingIndicator
id: root
color: __style.forestColor

height: root.visible ? 7 * __dp : 0
property alias running: root.visible

Rectangle {
id: bar
width: parent.width
height: parent.height

PropertyAnimation {
running: loadingIndicator.visible
running: root.visible
target: bar
property: "x"
from: -bar.width
Expand Down
3 changes: 2 additions & 1 deletion app/qml/project/MMProjectList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ Item {
Component {
id: loadingSpinnerComponent

MMLoadingSpinner {
MMBusyIndicator {
x: parent.width / 2 - width / 2
running: controllerModel.isLoading
size: __style.row63
}
}

Expand Down
6 changes: 2 additions & 4 deletions app/qml/project/MMProjectPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,10 @@ Item {
}
}

BusyIndicator {
MMBusyIndicator {
id: busyIndicator
width: parent.width/8
height: width
size: parent.width/8
running: stackView.pending
visible: running
anchors.centerIn: parent
z: parent.z + 1
}
Expand Down
7 changes: 5 additions & 2 deletions gallery/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
<file>../app/qml/dialogs/MMDownloadProjectDialog.qml</file>
<file>../app/qml/dialogs/MMProjectLimitDialog.qml</file>
<file>../app/qml/components/MMButton.qml</file>
<file>../app/qml/components/MMPageHeader.qml</file>
<file>../app/qml/components/MMDrawerHeader.qml</file>
<file>../app/qml/components/MMLinkButton.qml</file>
<file>../app/qml/components/MMLine.qml</file>
<file>../app/qml/components/MMIcon.qml</file>
<file>../app/qml/components/MMLine.qml</file>
<file>../app/qml/components/MMRoundButton.qml</file>
Expand Down Expand Up @@ -79,7 +82,7 @@
<file>../app/qml/components/MMPageHeader.qml</file>
<file>../app/qml/components/MMDrawer.qml</file>
<file>../app/qml/components/MMDrawerHeader.qml</file>
<file>../app/qml/components/MMLoadingSpinner.qml</file>
<file>../app/qml/components/MMBusyIndicator.qml</file>
<file>../app/qml/account/MMAcountPage.qml</file>
<file>../app/qml/account/MMAcountPageItem.qml</file>
<file>../app/qml/inputs/MMBaseInput.qml</file>
Expand Down Expand Up @@ -111,7 +114,7 @@
<file>../app/qml/onboarding/MMWhichIndustry.qml</file>
<file>../app/qml/map/MMPositionMarker.qml</file>
<file>../app/qml/map/components/MMBlurBox.qml</file>
<file>../app/qml/map/components/MMLoadingIndicator.qml</file>
<file>../app/qml/map/components/MMMapLoadingIndicator.qml</file>
<file>../app/qml/map/components/MMMapBlurLabel.qml</file>
<file>../app/qml/map/components/MMMapButton.qml</file>
<file>../app/qml/map/components/MMMapLabel.qml</file>
Expand Down
5 changes: 5 additions & 0 deletions gallery/qml/pages/MapPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ Page {
}
}

MMMapLoadingIndicator {
running: true
width: parent.width
}

MMMapScaleBar {
anchors.horizontalCenter: parent.horizontalCenter
y: 120
Expand Down
64 changes: 10 additions & 54 deletions gallery/qml/pages/MiscPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import QtQuick.Controls
import QtQuick.Controls.Basic

import "../../app/qml/components"
import "../../app/qml/misc"
import "../../app/qml/gps"

ScrollView {
Expand Down Expand Up @@ -90,7 +89,7 @@ ScrollView {
}

GroupBox {
title: "MMHeader"
title: "MMPageHeader"

width: parent.width

Expand All @@ -109,7 +108,7 @@ ScrollView {
spacing: 20
anchors.fill: parent

MMHeader {
MMPageHeader {
title: "Only title without anything on left nor right"
width: parent.width

Expand All @@ -118,63 +117,18 @@ ScrollView {
Rectangle { anchors.fill: parent; color: "red"; opacity: .3 }
}

MMHeader {
MMPageHeader {
title: "Title with back button"
width: parent.width

backVisible: true
}

MMHeader {
title: "Title with progress bar"
width: parent.width

backVisible: false
rightMarginShift: progressBar.width

MMProgressBar {
id: progressBar

anchors.right: parent.right
anchors.rightMargin: __style.pageMargins
anchors.verticalCenter: parent.verticalCenter

width: 60 * __dp
height: 4 * __dp

color: __style.grassColor
progressColor: __style.forestColor
position: 0.5
}
}

MMHeader {
title: "Title with back button and Progress bar"
width: parent.width
backVisible: true

rightMarginShift: progressBar2.width

MMProgressBar {
id: progressBar2

anchors.right: parent.right
anchors.rightMargin: __style.pageMargins
anchors.verticalCenter: parent.verticalCenter

width: 60 * __dp
height: 4 * __dp

color: __style.grassColor
progressColor: __style.forestColor
position: 0.9
}
}
}
}

GroupBox {
title: "MMHeader (bigger title)"
title: "MMDrawerHeader"
width: page.width - 40

background: Rectangle {
Expand All @@ -191,7 +145,7 @@ ScrollView {
spacing: 20
anchors.fill: parent

MMHeader {
MMDrawerHeader {
title: "Drawer title"
titleFont: __style.h3
}
Expand Down Expand Up @@ -221,7 +175,7 @@ ScrollView {
}

GroupBox {
title: "MMLoadingSpinner"
title: "MMBusyIndicator"
background: Rectangle {
color: "white"
border.color: "gray"
Expand All @@ -235,8 +189,9 @@ ScrollView {
Column {
spacing: 20
anchors.fill: parent
MMLoadingSpinner {
MMBusyIndicator {
running: true
size: 55
}
}
}
Expand Down Expand Up @@ -300,7 +255,8 @@ ScrollView {
anchors.fill: parent
MMWarningBubble {
width: page.width - 64
text: "Server is broken, sorry. \n Please wait for tomorrow"
title: "Server is broken, sorry"
description: "Please wait for tomorrow"
}
}
}
Expand Down

1 comment on commit 64c58ef

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.03.541311 just submitted!

Please sign in to comment.