Cura/resources/qml/Account/SyncState.qml
Ghostkeeper 0a75c772ed
Unrevert new icon set for all of Cura's interface
We created a new set of icons for Cura. These icons had to be reverted though because they weren't working out in the interface for the last release yet.
This unreverts them, basically adding them back hoping that we'll get them fixed in time for the next release.

Contributes to issue CURA-8342.

Revert "Revert "Fix merge conflict""

This reverts commit bb20e3307f43edc1ff53cb154d2351ddfe39e158.

Revert "Revert "Merge pull request #9716 from Ultimaker/CURA-8010_new_icons""

This reverts commit 70e4e9640e561e18a12870f30c905203ce8ccee7.

Revert "Revert "Fix typo in icon name""

This reverts commit 38ce22ba7c3f40b971bc6e1e0a8e776ca9d51512.

Revert "Revert "Add list for deprecated icons""

This reverts commit 119a957e7f978dbf1ddbcb3b0005bf38e8fed943.

Revert "Revert "Add Function icon""

This reverts commit 760726cf0bb953bb1b0fc277b448f419d4bd2544.

Revert "Revert "Switch out inherit icon""

This reverts commit 26afff609381e2004d194c280f504b6226859bd3.

Revert "Revert "Merge branch 'CURA-8205_Introduce_new_icons_in_Cura' of github.com:Ultimaker/Cura""

This reverts commit 6483db3d47ee052c1a966cdee3af7190577a5769.

Revert "Fix incorrect icons"

This reverts commit 02a4ade2a50a943ff36fd4895bdc9261cf2133eb.
2021-06-28 17:16:56 +02:00

138 lines
4.3 KiB
QML

import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.4 as UM
import Cura 1.1 as Cura
Row // Sync state icon + message
{
property var syncState: Cura.API.account.syncState
id: syncRow
width: childrenRect.width
height: childrenRect.height
spacing: UM.Theme.getSize("narrow_margin").height
states: [
State
{
name: "idle"
when: syncState == Cura.AccountSyncState.IDLE
PropertyChanges { target: icon; source: UM.Theme.getIcon("ArrowDoubleCircleRight")}
},
State
{
name: "syncing"
when: syncState == Cura.AccountSyncState.SYNCING
PropertyChanges { target: icon; source: UM.Theme.getIcon("ArrowDoubleCircleRight") }
PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Checking...")}
},
State
{
name: "up_to_date"
when: syncState == Cura.AccountSyncState.SUCCESS
PropertyChanges { target: icon; source: UM.Theme.getIcon("CheckCircle") }
PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Account synced")}
},
State
{
name: "error"
when: syncState == Cura.AccountSyncState.ERROR
PropertyChanges { target: icon; source: UM.Theme.getIcon("Warning") }
PropertyChanges { target: stateLabel; text: catalog.i18nc("@label", "Something went wrong...")}
}
]
UM.RecolorImage
{
id: icon
width: 20 * screenScaleFactor
height: width
// source is determined by State
color: UM.Theme.getColor("account_sync_state_icon")
RotationAnimator
{
id: updateAnimator
target: icon
from: 0
to: 360
duration: 1000
loops: Animation.Infinite
running: syncState == Cura.AccountSyncState.SYNCING
// reset rotation when stopped
onRunningChanged: {
if(!running)
{
icon.rotation = 0
}
}
}
}
Column
{
width: childrenRect.width
height: childrenRect.height
Label
{
id: stateLabel
// text is determined by State
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
width: contentWidth + UM.Theme.getSize("default_margin").height
height: contentHeight
verticalAlignment: Text.AlignVCenter
visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled
}
Label
{
id: updatePackagesButton
text: catalog.i18nc("@button", "Install pending updates")
color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
height: contentHeight
width: contentWidth + UM.Theme.getSize("default_margin").height
visible: Cura.API.account.updatePackagesEnabled
MouseArea
{
anchors.fill: parent
onClicked: Cura.API.account.onUpdatePackagesClicked()
hoverEnabled: true
onEntered: updatePackagesButton.font.underline = true
onExited: updatePackagesButton.font.underline = false
}
}
Label
{
id: accountSyncButton
text: catalog.i18nc("@button", "Check for account updates")
color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
height: contentHeight
width: contentWidth + UM.Theme.getSize("default_margin").height
visible: Cura.API.account.manualSyncEnabled
MouseArea
{
anchors.fill: parent
onClicked: Cura.API.account.sync(true)
hoverEnabled: true
onEntered: accountSyncButton.font.underline = true
onExited: accountSyncButton.font.underline = false
}
}
}
}