mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-03 07:41:18 -07:00
Merge branch 'replace_controls_1_for_controls_2' into CURA-8688_qt6_cleanup
This commit is contained in:
commit
b2811b1125
375 changed files with 41650 additions and 33253 deletions
|
|
@ -15,6 +15,7 @@ Button
|
|||
property bool isIconOnRightSide: false
|
||||
|
||||
property alias iconSource: buttonIconLeft.source
|
||||
property real iconSize: UM.Theme.getSize("action_button_icon").height
|
||||
property alias textFont: buttonText.font
|
||||
property alias cornerRadius: backgroundRect.radius
|
||||
property alias tooltip: tooltip.tooltipText
|
||||
|
|
@ -109,7 +110,7 @@ Button
|
|||
{
|
||||
id: buttonIconLeft
|
||||
source: ""
|
||||
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
|
||||
height: visible ? button.iconSize : 0
|
||||
width: visible ? height : 0
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
|
@ -156,7 +157,7 @@ Button
|
|||
{
|
||||
id: buttonIconRight
|
||||
source: buttonIconLeft.source
|
||||
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
|
||||
height: visible ? button.iconSize : 0
|
||||
width: visible ? height : 0
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ Item
|
|||
property alias configureSettingVisibility: configureSettingVisibilityAction
|
||||
|
||||
property alias browsePackages: browsePackagesAction
|
||||
property alias openMarketplace: openMarketplaceAction
|
||||
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
|
||||
|
|
@ -482,4 +483,11 @@ Item
|
|||
text: "&Marketplace"
|
||||
icon.name: "plugins_browse"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: openMarketplaceAction
|
||||
text: catalog.i18nc("@action:menu", "&Marketplace")
|
||||
icon.name: "plugins_browse"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: checkbox
|
||||
hoverEnabled: true
|
||||
|
||||
property alias tooltip: tooltip.text
|
||||
|
||||
indicator: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("checkbox").width
|
||||
implicitHeight: UM.Theme.getSize("checkbox").height
|
||||
x: 0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: UM.Theme.getColor("main_background")
|
||||
radius: UM.Theme.getSize("checkbox_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: checkbox.hovered ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border")
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
sourceSize.height: width
|
||||
color: UM.Theme.getColor("checkbox_mark")
|
||||
source: UM.Theme.getIcon("Check")
|
||||
opacity: checkbox.checked
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: UM.Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: checkbox.indicator.right
|
||||
leftMargin: UM.Theme.getSize("narrow_margin").width
|
||||
}
|
||||
text: checkbox.text
|
||||
color: UM.Theme.getColor("checkbox_text")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
ToolTip
|
||||
{
|
||||
id: tooltip
|
||||
text: ""
|
||||
delay: 500
|
||||
visible: text != "" && checkbox.hovered
|
||||
}
|
||||
}
|
||||
|
|
@ -5,8 +5,9 @@ import QtQuick 2.2
|
|||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.5 as Cura
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
|
|
@ -84,7 +85,7 @@ UM.Dialog
|
|||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
id: rememberChoiceCheckBox
|
||||
text: catalog.i18nc("@text:window", "Remember my choice")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import QtQuick 2.10
|
|||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ UM.TooltipArea
|
|||
|
||||
property int controlHeight: UM.Theme.getSize("setting_control").height
|
||||
|
||||
height: childrenRect.height
|
||||
height: controlHeight
|
||||
width: childrenRect.width
|
||||
text: tooltip
|
||||
|
||||
|
|
@ -57,13 +57,16 @@ UM.TooltipArea
|
|||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Cura.CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
id: checkBox
|
||||
anchors.left: fieldLabel.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors {
|
||||
left: fieldLabel.right
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
checked: String(propertyProvider.properties.value).toLowerCase() != 'false'
|
||||
height: simpleCheckBox.controlHeight
|
||||
height: UM.Theme.getSize("checkbox").height
|
||||
text: ""
|
||||
onClicked:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,4 +106,4 @@ Item
|
|||
extensionMenu.extensionModel.callExtensionMethod("Toolbox", "setViewCategoryToMaterials")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,4 @@ Cura.Menu
|
|||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
Cura.AskOpenAsProjectOrModelsDialog
|
||||
{
|
||||
id: askOpenAsProjectOrModelsDialog
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ Window
|
|||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
modality: Qt.ApplicationModal
|
||||
color: UM.Theme.getColor("main_background")
|
||||
|
||||
property variant syncModel
|
||||
property alias pageIndex: swipeView.currentIndex
|
||||
|
|
@ -32,11 +33,11 @@ Window
|
|||
anchors.fill: parent
|
||||
interactive: false
|
||||
|
||||
Rectangle
|
||||
Item
|
||||
{
|
||||
id: introPage
|
||||
color: UM.Theme.getColor("main_background")
|
||||
Column
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
anchors.fill: parent
|
||||
|
|
@ -46,66 +47,64 @@ Window
|
|||
{
|
||||
text: catalog.i18nc("@title:header", "Sync materials with printers")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@text", "Following a few simple steps, you will be able to synchronize all your material profiles with your printers.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Image
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
source: UM.Theme.getImage("material_ecosystem")
|
||||
width: parent.width
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: width
|
||||
}
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: startButton
|
||||
anchors
|
||||
Item
|
||||
{
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
bottom: parent.bottom
|
||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
text: catalog.i18nc("@button", "Start")
|
||||
onClicked:
|
||||
{
|
||||
if(Cura.API.account.isLoggedIn)
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Layout.fillWidth: true
|
||||
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
swipeView.currentIndex += 2; //Skip sign in page.
|
||||
text: catalog.i18nc("@button", "Why do I need to sync material profiles?")
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
isIconOnRightSide: true
|
||||
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-why")
|
||||
}
|
||||
else
|
||||
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
swipeView.currentIndex += 1;
|
||||
anchors.right: parent.right
|
||||
text: catalog.i18nc("@button", "Start")
|
||||
onClicked:
|
||||
{
|
||||
if(Cura.API.account.isLoggedIn)
|
||||
{
|
||||
swipeView.currentIndex += 2; //Skip sign in page.
|
||||
}
|
||||
else
|
||||
{
|
||||
swipeView.currentIndex += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalCenter: startButton.verticalCenter
|
||||
}
|
||||
text: catalog.i18nc("@button", "Why do I need to sync material profiles?")
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
isIconOnRightSide: true
|
||||
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-why")
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
Item
|
||||
{
|
||||
id: signinPage
|
||||
color: UM.Theme.getColor("main_background")
|
||||
|
||||
Connections //While this page is active, continue to the next page if the user logs in.
|
||||
// While this page is active, continue to the next page if the user logs in.
|
||||
Connections
|
||||
{
|
||||
target: Cura.API.account
|
||||
function onLoginStateChanged(is_logged_in)
|
||||
|
|
@ -127,34 +126,31 @@ Window
|
|||
{
|
||||
text: catalog.i18nc("@title:header", "Sign in")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
Layout.preferredHeight: height
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@text", "To automatically sync the material profiles with all your printers connected to Digital Factory you need to be signed in in Cura.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width
|
||||
Layout.maximumWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Item
|
||||
|
||||
Image
|
||||
{
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
source: UM.Theme.getImage("first_run_ultimaker_cloud")
|
||||
Layout.fillHeight: true
|
||||
Image
|
||||
{
|
||||
source: UM.Theme.getImage("first_run_ultimaker_cloud")
|
||||
width: parent.width / 2
|
||||
sourceSize.width: width
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
sourceSize.width: width
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Layout.preferredHeight: height
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Layout.fillWidth: true
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
anchors.left: parent.left
|
||||
|
|
@ -171,10 +167,9 @@ Window
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
Item
|
||||
{
|
||||
id: printerListPage
|
||||
color: UM.Theme.getColor("main_background")
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
|
|
@ -185,7 +180,6 @@ Window
|
|||
|
||||
Row
|
||||
{
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
states: [
|
||||
|
|
@ -216,7 +210,7 @@ Window
|
|||
{
|
||||
id: printerListHeaderIcon
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
UM.Label
|
||||
|
|
@ -229,24 +223,22 @@ Window
|
|||
}
|
||||
Row
|
||||
{
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: syncStatusLabel
|
||||
|
||||
width: parent.width - UM.Theme.getSize("default_margin").width - troubleshootingLink.width
|
||||
|
||||
anchors.left: parent.left
|
||||
wrapMode: Text.Wrap
|
||||
elide: Text.ElideRight
|
||||
visible: text !== ""
|
||||
text: ""
|
||||
font: UM.Theme.getFont("medium")
|
||||
}
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
id: troubleshootingLink
|
||||
anchors.right: parent.right
|
||||
text: catalog.i18nc("@button", "Troubleshooting")
|
||||
visible: typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "error"
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
|
|
@ -256,8 +248,7 @@ Window
|
|||
ListView
|
||||
{
|
||||
id: printerList
|
||||
width: parent.width
|
||||
Layout.preferredWidth: width
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
clip: true
|
||||
|
|
@ -372,94 +363,82 @@ Window
|
|||
|
||||
footer: Item
|
||||
{
|
||||
width: printerList.width - printerListScrollBar
|
||||
height: {
|
||||
if(!visible)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
let h = UM.Theme.getSize("card").height + printerListTroubleshooting.height + UM.Theme.getSize("default_margin").height * 2; //1 margin between content and footer, 1 for troubleshooting link.
|
||||
return h;
|
||||
}
|
||||
width: printerList.width - printerListScrollBar.width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||
visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 && typeof syncModel !== "undefined" && syncModel.exportUploadStatus === "idle"
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
|
||||
|
||||
color: "transparent"
|
||||
|
||||
Row
|
||||
GridLayout
|
||||
{
|
||||
anchors
|
||||
{
|
||||
fill: parent
|
||||
margins: Math.round(UM.Theme.getSize("card").height - UM.Theme.getSize("machine_selector_icon").width) / 2 //Same margin as in other cards.
|
||||
}
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
columns: 3
|
||||
rows: 2
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: UM.Theme.getSize("thick_margin").width
|
||||
anchors.rightMargin: UM.Theme.getSize("thick_margin").width
|
||||
anchors.topMargin: UM.Theme.getSize("thick_margin").height
|
||||
anchors.bottomMargin: UM.Theme.getSize("thick_margin").height
|
||||
columnSpacing: UM.Theme.getSize("default_margin").width
|
||||
rowSpacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
UM.StatusIcon
|
||||
{
|
||||
id: infoIcon
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: width
|
||||
//Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings.
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2)
|
||||
|
||||
Layout.preferredWidth: UM.Theme.getSize("section_icon").width
|
||||
Layout.preferredHeight: UM.Theme.getSize("section_icon").height
|
||||
status: UM.StatusIcon.Status.WARNING
|
||||
}
|
||||
|
||||
Column
|
||||
UM.Label
|
||||
{
|
||||
//Fill the total width. Can't use layouts because we need the anchors for vertical alignment.
|
||||
width: parent.width - infoIcon.width - refreshListButton.width - parent.spacing * 2
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: printersMissingText
|
||||
text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?")
|
||||
+ "\n"
|
||||
+ catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
id: printerListTroubleshooting
|
||||
leftPadding: 0 //Want to visually align this to the text.
|
||||
|
||||
text: catalog.i18nc("@button", "Troubleshooting")
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer")
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?")
|
||||
+ "\n"
|
||||
+ catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: refreshListButton
|
||||
//Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings.
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2)
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
text: catalog.i18nc("@button", "Refresh List")
|
||||
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
|
||||
onClicked: Cura.API.account.sync(true)
|
||||
}
|
||||
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
id: printerListTroubleshooting
|
||||
Layout.column: 1
|
||||
Layout.row: 1
|
||||
Layout.fillWidth: true
|
||||
leftPadding: 0
|
||||
text: catalog.i18nc("@button", "Troubleshooting")
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
|
|
@ -545,7 +524,8 @@ Window
|
|||
}
|
||||
}
|
||||
|
||||
ColumnLayout //Placeholder for when the user has no cloud printers.
|
||||
// Placeholder for when the user has no cloud printers.
|
||||
ColumnLayout
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
anchors.fill: parent
|
||||
|
|
@ -556,44 +536,50 @@ Window
|
|||
{
|
||||
text: catalog.i18nc("@title:header", "No printers found")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Image
|
||||
|
||||
Item
|
||||
{
|
||||
source: UM.Theme.getImage("3d_printer_faded")
|
||||
sourceSize.width: width
|
||||
fillMode: Image.PreserveAspectFit
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.preferredWidth: parent.width / 3
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
Image
|
||||
{
|
||||
anchors.fill: parent
|
||||
source: UM.Theme.getImage("3d_printer_faded")
|
||||
sourceSize.width: width
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@text", "It seems like you don't have any compatible printers connected to Digital Factory. Make sure your printer is connected and it's running the latest firmware.")
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.Wrap
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: parent.height / 4
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
text: catalog.i18nc("@button", "Learn how to connect your printer to Digital Factory")
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-add-cloud-printer")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
maximumWidth: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Layout.fillWidth: true
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
|
|
@ -601,30 +587,34 @@ Window
|
|||
text: catalog.i18nc("@button", "Sync materials with USB")
|
||||
onClicked: swipeView.currentIndex = removableDriveSyncPage.SwipeView.index
|
||||
}
|
||||
Cura.PrimaryButton
|
||||
|
||||
RowLayout
|
||||
{
|
||||
id: disabledSyncButton
|
||||
anchors.right: parent.right
|
||||
text: catalog.i18nc("@button", "Sync")
|
||||
enabled: false //If there are no printers, always disable this button.
|
||||
}
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
anchors.right: disabledSyncButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
text: catalog.i18nc("@button", "Refresh")
|
||||
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
|
||||
outlineColor: "transparent"
|
||||
onClicked: Cura.API.account.sync(true)
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@button", "Refresh")
|
||||
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
|
||||
outlineColor: "transparent"
|
||||
onClicked: Cura.API.account.sync(true)
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: disabledSyncButton
|
||||
text: catalog.i18nc("@button", "Sync")
|
||||
enabled: false // If there are no printers, always disable this button.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
Item
|
||||
{
|
||||
id: removableDriveSyncPage
|
||||
color: UM.Theme.getColor("main_background")
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
|
|
@ -636,46 +626,52 @@ Window
|
|||
{
|
||||
text: catalog.i18nc("@title:header", "Sync material profiles via USB")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
Layout.preferredHeight: height
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width
|
||||
Layout.maximumWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Row
|
||||
|
||||
RowLayout
|
||||
{
|
||||
width: parent.width
|
||||
Layout.preferredWidth: width
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Image
|
||||
Item
|
||||
{
|
||||
source: UM.Theme.getImage("insert_usb")
|
||||
width: parent.width / 3
|
||||
height: width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
sourceSize.width: width
|
||||
Layout.preferredWidth: parent.width / 3
|
||||
Layout.fillHeight: true
|
||||
|
||||
Image
|
||||
{
|
||||
anchors.fill: parent
|
||||
source: UM.Theme.getImage("insert_usb")
|
||||
verticalAlignment: Image.AlignVCenter
|
||||
horizontalAlignment: Image.AlignHCenter
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: width
|
||||
}
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.fillWidth: true
|
||||
text: "1. " + catalog.i18nc("@text", "Click the export material archive button.")
|
||||
+ "\n2. " + catalog.i18nc("@text", "Save the .umm file on a USB stick.")
|
||||
+ "\n3. " + catalog.i18nc("@text", "Insert the USB stick into your printer and launch the procedure to load new material profiles.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width * 2 / 3 - UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
text: catalog.i18nc("@button", "How to load new material profiles to my printer")
|
||||
iconSource: UM.Theme.getIcon("LinkExternal")
|
||||
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/4403319801106/?utm_source=cura&utm_medium=software&utm_campaign=add-material-profiles-via-usb")
|
||||
|
|
@ -683,10 +679,9 @@ Window
|
|||
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Layout.fillWidth: true
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
|
|
@ -719,24 +714,22 @@ Window
|
|||
}
|
||||
}
|
||||
|
||||
Cura.GlobalStacksModel
|
||||
property variant cloudPrinterList: Cura.GlobalStacksModel
|
||||
{
|
||||
id: cloudPrinterList
|
||||
filterConnectionType: 3 //Only show cloud connections.
|
||||
filterOnlineOnly: true //Only show printers that are online.
|
||||
filterCapabilities: ["import_material"] //Only show printers that can receive the material profiles.
|
||||
}
|
||||
Cura.GlobalStacksModel
|
||||
|
||||
property variant includeOfflinePrinterList: Cura.GlobalStacksModel
|
||||
{
|
||||
//In order to show a refresh button only when there are offline cloud printers, we need to know if there are any offline printers.
|
||||
//A global stacks model without the filter for online-only printers allows this.
|
||||
id: includeOfflinePrinterList
|
||||
filterConnectionType: 3 //Still only show cloud connections.
|
||||
}
|
||||
|
||||
FileDialog
|
||||
property variant exportUsbDialog: FileDialog
|
||||
{
|
||||
id: exportUsbDialog
|
||||
title: catalog.i18nc("@title:window", "Export All Materials")
|
||||
selectExisting: false
|
||||
nameFilters: ["Material archives (*.umm)", "All files (*)"]
|
||||
|
|
|
|||
|
|
@ -199,4 +199,4 @@ UM.PreferencesPage
|
|||
UM.SettingVisibilityItem { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
35
resources/qml/SearchBar.qml
Normal file
35
resources/qml/SearchBar.qml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (C) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.7 as Cura
|
||||
|
||||
Cura.TextField
|
||||
{
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
|
||||
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
|
||||
|
||||
placeholderText: catalog.i18nc("@placeholder", "Search")
|
||||
font.italic: true
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: searchIcon
|
||||
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
source: UM.Theme.getIcon("Magnifier")
|
||||
height: UM.Theme.getSize("small_button_icon").height
|
||||
width: height
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
}
|
||||
|
|
@ -85,20 +85,20 @@ SettingItem
|
|||
{
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
width: height
|
||||
width: UM.Theme.getSize("checkbox").width
|
||||
height: width
|
||||
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
radius: UM.Theme.getSize("checkbox_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
|
||||
border.color:
|
||||
{
|
||||
if(!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
return UM.Theme.getColor("checkbox_border")
|
||||
}
|
||||
switch (propertyProvider.properties.validationState)
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@ SettingItem
|
|||
// Validation is OK.
|
||||
if (control.containsMouse || control.activeFocus || hovered)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
return UM.Theme.getColor("checkbox_border_hover")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ SettingItem
|
|||
color: {
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
return UM.Theme.getColor("checkbox_disabled")
|
||||
}
|
||||
switch (propertyProvider.properties.validationState)
|
||||
{
|
||||
|
|
@ -140,18 +140,18 @@ SettingItem
|
|||
{
|
||||
return UM.Theme.getColor("setting_control_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control")
|
||||
return UM.Theme.getColor("checkbox")
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
height: UM.Theme.getSize("checkbox_mark").height
|
||||
width: UM.Theme.getSize("checkbox_mark").width
|
||||
sourceSize.height: width
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
|
||||
source: UM.Theme.getIcon("Check")
|
||||
source: UM.Theme.getIcon("Check", "low")
|
||||
opacity: control.checked ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,8 +153,9 @@ SettingItem
|
|||
}
|
||||
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||
selectedTextColor: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
selectionColor: UM.Theme.getColor("text_selection")
|
||||
selectByMouse: true
|
||||
|
||||
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10
|
||||
|
|
|
|||
|
|
@ -16,4 +16,5 @@ Cura.ActionButton
|
|||
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
|
||||
hoverColor: "transparent"
|
||||
underlineTextOnHover: true
|
||||
iconSize: UM.Theme.getSize("action_button_icon_small").height
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ ToolTip
|
|||
onAboutToHide: hide()
|
||||
|
||||
// If the text is not set, just set the height to 0 to prevent it from showing
|
||||
height: text != "" ? label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width: 0
|
||||
height: label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width
|
||||
|
||||
x:
|
||||
{
|
||||
|
|
@ -73,7 +73,7 @@ ToolTip
|
|||
}
|
||||
|
||||
function show() {
|
||||
opacity = 1
|
||||
opacity = text != "" ? 1 : 0
|
||||
}
|
||||
|
||||
function hide() {
|
||||
|
|
|
|||
|
|
@ -1,74 +0,0 @@
|
|||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
//
|
||||
// Checkbox with Cura styling.
|
||||
//
|
||||
CheckBox
|
||||
{
|
||||
id: control
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
indicator: Rectangle
|
||||
{
|
||||
width: control.height
|
||||
height: control.height
|
||||
|
||||
color:
|
||||
{
|
||||
if (!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
}
|
||||
if (control.hovered || control.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
}
|
||||
if (control.hovered || control.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
sourceSize.height: width
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||
source: UM.Theme.getIcon("Check")
|
||||
opacity: control.checked ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: UM.Label
|
||||
{
|
||||
id: textLabel
|
||||
leftPadding: control.indicator.width + control.spacing
|
||||
text: control.text
|
||||
font: control.font
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ UM.MenuItem
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
source: UM.Theme.getIcon("Check")
|
||||
source: UM.Theme.getIcon("Check", "low")
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
}
|
||||
|
||||
|
|
|
|||
46
resources/qml/Widgets/ScrollView.qml
Normal file
46
resources/qml/Widgets/ScrollView.qml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2020 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
ScrollView
|
||||
{
|
||||
clip: true
|
||||
|
||||
// Setting this property to false hides the scrollbar both when the scrollbar is not needed (child height < height)
|
||||
// and when the scrollbar is not actively being hovered or pressed
|
||||
property bool scrollAlwaysVisible: true
|
||||
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
hoverEnabled: true
|
||||
policy: parent.scrollAlwaysVisible ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
contentItem: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("scrollbar").width
|
||||
opacity: (parent.active || parent.parent.scrollAlwaysVisible) ? 1.0 : 0.0
|
||||
radius: Math.round(width / 2)
|
||||
color:
|
||||
{
|
||||
if (parent.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("scrollbar_handle_down")
|
||||
}
|
||||
else if (parent.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("scrollbar_handle_hover")
|
||||
}
|
||||
return UM.Theme.getColor("scrollbar_handle")
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 100; } }
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,6 @@ ViewsSelector 1.0 ViewsSelector.qml
|
|||
ToolbarButton 1.0 ToolbarButton.qml
|
||||
SettingView 1.0 SettingView.qml
|
||||
ProfileMenu 1.0 ProfileMenu.qml
|
||||
CheckBoxWithTooltip 1.0 CheckBoxWithTooltip.qml
|
||||
ToolTip 1.0 ToolTip.qml
|
||||
|
||||
|
||||
|
|
@ -29,7 +28,6 @@ WizardDialog 1.0 WizardDialog.qml
|
|||
|
||||
# Cura/Widgets
|
||||
|
||||
CheckBox 1.0 CheckBox.qml
|
||||
ComboBox 1.0 ComboBox.qml
|
||||
NotificationIcon 1.0 NotificationIcon.qml
|
||||
RadioButton 1.0 RadioButton.qml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue