Merge pull request #10788 from Ultimaker/replace_controls_1_for_controls_2

Convert QtQuick.Controls 1 to QtQuick.Controls 2
This commit is contained in:
Jaime van Kessel 2022-03-03 12:52:13 +01:00 committed by GitHub
commit fcdc43fc71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
176 changed files with 5970 additions and 7374 deletions

View File

@ -679,22 +679,6 @@ class CuraApplication(QtApplication):
self._setLoadingHint(self._i18n_catalog.i18nc("@info:progress", "Initializing Active Machine...")) self._setLoadingHint(self._i18n_catalog.i18nc("@info:progress", "Initializing Active Machine..."))
super().setGlobalContainerStack(stack) super().setGlobalContainerStack(stack)
showMessageBox = pyqtSignal(str,str, str, str, int, int,
arguments = ["title", "text", "informativeText", "detailedText","buttons", "icon"])
"""A reusable dialogbox"""
def messageBox(self, title, text,
informativeText = "",
detailedText = "",
buttons = QMessageBox.Ok,
icon = QMessageBox.NoIcon,
callback = None,
callback_arguments = []
):
self._message_box_callback = callback
self._message_box_callback_arguments = callback_arguments
self.showMessageBox.emit(title, text, informativeText, detailedText, buttons, icon)
showDiscardOrKeepProfileChanges = pyqtSignal() showDiscardOrKeepProfileChanges = pyqtSignal()
def discardOrKeepProfileChanges(self) -> bool: def discardOrKeepProfileChanges(self) -> bool:

View File

@ -1,4 +1,4 @@
# Copyright (c) 2020 Ultimaker B.V. # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt
@ -9,6 +9,7 @@ from UM import i18nCatalog
from UM.Logger import Logger from UM.Logger import Logger
from UM.Qt.ListModel import ListModel from UM.Qt.ListModel import ListModel
from UM.Settings.ContainerRegistry import ContainerRegistry from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.Settings.SettingFunction import SettingFunction # To format setting functions differently.
import os import os
@ -173,12 +174,22 @@ class QualitySettingsModel(ListModel):
label = definition.label label = definition.label
if self._i18n_catalog: if self._i18n_catalog:
label = self._i18n_catalog.i18nc(definition.key + " label", label) label = self._i18n_catalog.i18nc(definition.key + " label", label)
if profile_value_source == "quality_changes":
label = f"<i>{label}</i>" # Make setting name italic if it's derived from the quality-changes profile.
if isinstance(profile_value, SettingFunction):
if self._i18n_catalog:
profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated")
else:
profile_value_display = "Calculated"
else:
profile_value_display = "" if profile_value is None else str(profile_value)
items.append({ items.append({
"key": definition.key, "key": definition.key,
"label": label, "label": label,
"unit": definition.unit, "unit": definition.unit,
"profile_value": "" if profile_value is None else str(profile_value), # it is for display only "profile_value": profile_value_display,
"profile_value_source": profile_value_source, "profile_value_source": profile_value_source,
"user_value": "" if user_value is None else str(user_value), "user_value": "" if user_value is None else str(user_value),
"category": current_category "category": current_category

View File

@ -6,7 +6,7 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
UM.Dialog UM.Dialog
@ -19,9 +19,7 @@ UM.Dialog
width: minimumWidth width: minimumWidth
height: Math.max(dialogSummaryItem.height + 2 * buttonsItem.height, minimumHeight) // 2 * button height to also have some extra space around the button relative to the button size height: Math.max(dialogSummaryItem.height + 2 * buttonsItem.height, minimumHeight) // 2 * button height to also have some extra space around the button relative to the button size
property int comboboxHeight: 15 * screenScaleFactor property int comboboxHeight: UM.Theme.getSize("default_margin").height
property int spacerHeight: 10 * screenScaleFactor
property int doubleSpacerHeight: 20 * screenScaleFactor
onClosing: manager.notifyClosed() onClosing: manager.notifyClosed()
onVisibleChanged: onVisibleChanged:
@ -46,10 +44,6 @@ UM.Dialog
id: catalog id: catalog
name: "cura" name: "cura"
} }
SystemPalette
{
id: palette
}
ListModel ListModel
{ {
@ -68,45 +62,39 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
spacing: 2 * screenScaleFactor spacing: UM.Theme.getSize("default_margin").height
Label
Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{ {
id: titleLabel id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project") text: catalog.i18nc("@action:title", "Summary - Cura Project")
font.pointSize: 18 font: UM.Theme.getFont("large")
} }
Rectangle Rectangle
{ {
id: separator id: separator
color: palette.text color: UM.Theme.getColor("text")
width: parent.width width: parent.width
height: 1 height: UM.Theme.getSize("default_lining").height
} }
Item // Spacer
{
height: doubleSpacerHeight
width: height
} }
Row
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Printer settings")
font.bold: true
width: (parent.width / 3) | 0
}
Item Item
{ {
// spacer width: parent.width
height: spacerHeight height: childrenRect.height
width: (parent.width / 3) | 0
}
UM.TooltipArea UM.TooltipArea
{ {
id: machineResolveStrategyTooltip id: machineResolveStrategyTooltip
anchors.top: parent.top
anchors.right: parent.right
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0 height: visible ? comboboxHeight : 0
visible: base.visible && machineResolveComboBox.model.count > 1 visible: base.visible && machineResolveComboBox.model.count > 1
@ -157,17 +145,30 @@ UM.Dialog
} }
} }
} }
Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{
id: printer_settings_label
text: catalog.i18nc("@action:label", "Printer settings")
font: UM.Theme.getFont("default_bold")
} }
Row Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Type") text: catalog.i18nc("@action:label", "Type")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.machineType text: manager.machineType
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
@ -178,43 +179,31 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name") text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.machineName text: manager.machineName
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
}
}
Item // Spacer
{
height: doubleSpacerHeight
width: height
}
Row
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true
width: (parent.width / 3) | 0
}
Item Item
{ {
// spacer width: parent.width
height: spacerHeight height: childrenRect.height
width: (parent.width / 3) | 0
}
UM.TooltipArea UM.TooltipArea
{ {
id: qualityChangesResolveTooltip anchors.right: parent.right
anchors.top: parent.top
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0 height: visible ? comboboxHeight : 0
visible: manager.qualityChangesConflict visible: manager.qualityChangesConflict
@ -232,96 +221,105 @@ UM.Dialog
} }
} }
} }
Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Profile settings")
font: UM.Theme.getFont("default_bold")
} }
Row Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.qualityName text: manager.qualityName
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
Row Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Intent") text: catalog.i18nc("@action:label", "Intent")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.intentName text: manager.intentName
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
Row Row
{ {
width: parent.width width: parent.width
height: manager.numUserSettings != 0 ? childrenRect.height : 0 height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Not in profile") text: catalog.i18nc("@action:label", "Not in profile")
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings) text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
visible: manager.numUserSettings != 0
} }
Row Row
{ {
width: parent.width width: parent.width
height: manager.numSettingsOverridenByQualityChanges != 0 ? childrenRect.height : 0 height: childrenRect.height
Label
UM.Label
{ {
text: catalog.i18nc("@action:label", "Derivative from") text: catalog.i18nc("@action:label", "Derivative from")
visible: manager.numSettingsOverridenByQualityChanges != 0
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges) text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
visible: manager.numSettingsOverridenByQualityChanges != 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
visible: manager.numSettingsOverridenByQualityChanges != 0
} }
Item // Spacer
{
height: doubleSpacerHeight
width: height
} }
Row
{
height: childrenRect.height
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Material settings")
font.bold: true
width: (parent.width / 3) | 0
} }
Item Item
{ {
// spacer width: parent.width
height: spacerHeight height: childrenRect.height
width: (parent.width / 3) | 0
}
UM.TooltipArea UM.TooltipArea
{ {
id: materialResolveTooltip id: materialResolveTooltip
anchors.right: parent.right
anchors.top: parent.top
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0 height: visible ? comboboxHeight : 0
visible: manager.materialConflict visible: manager.materialConflict
@ -339,6 +337,23 @@ UM.Dialog
} }
} }
} }
Column
{
width: parent.width
height: cildrenRect.height
Row
{
height: childrenRect.height
width: parent.width
spacing: UM.Theme.getSize("narrow_margin").width
UM.Label
{
text: catalog.i18nc("@action:label", "Material settings")
font: UM.Theme.getFont("default_bold")
width: (parent.width / 3) | 0
}
} }
Repeater Repeater
@ -348,12 +363,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: modelData text: modelData
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
@ -361,28 +376,29 @@ UM.Dialog
} }
} }
} }
}
Item // Spacer
{
height: doubleSpacerHeight
width: height
} }
Label Column
{
width: parent.width
height: cildrenRect.height
UM.Label
{ {
text: catalog.i18nc("@action:label", "Setting visibility") text: catalog.i18nc("@action:label", "Setting visibility")
font.bold: true font: UM.Theme.getFont("default_bold")
} }
Row Row
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Mode") text: catalog.i18nc("@action:label", "Mode")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: manager.activeMode text: manager.activeMode
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
@ -393,22 +409,19 @@ UM.Dialog
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
visible: manager.hasVisibleSettingsField visible: manager.hasVisibleSettingsField
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Visible settings:") text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings) text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
width: (parent.width / 3) | 0 width: (parent.width / 3) | 0
} }
} }
Item // Spacer
{
height: spacerHeight
width: height
} }
Row Row
{ {
width: parent.width width: parent.width
@ -418,12 +431,10 @@ UM.Dialog
{ {
width: warningLabel.height width: warningLabel.height
height: width height: width
source: UM.Theme.getIcon("Information") source: UM.Theme.getIcon("Information")
color: palette.text color: UM.Theme.getColor("text")
} }
Label UM.Label
{ {
id: warningLabel id: warningLabel
text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.") text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.")
@ -432,44 +443,22 @@ UM.Dialog
} }
} }
} }
Item
{
id: buttonsItem
width: parent.width
height: childrenRect.height
anchors.bottom: parent.bottom
anchors.right: parent.right
Button
{
id: cancel_button
text: catalog.i18nc("@action:button","Cancel");
onClicked: { manager.onCancelButtonClicked() }
enabled: true
anchors.bottom: parent.bottom
anchors.right: ok_button.left
anchors.rightMargin: 2 * screenScaleFactor
}
Button
{
id: ok_button
anchors.right: parent.right
anchors.bottom: parent.bottom
text: catalog.i18nc("@action:button","Open");
onClicked: { manager.closeBackend(); manager.onOkButtonClicked() }
}
}
buttonSpacing: UM.Theme.getSize("default_margin").width
function accept() { rightButtons: [
manager.closeBackend(); Cura.TertiaryButton
manager.onOkButtonClicked(); {
base.visible = false; text: catalog.i18nc("@action:button", "Cancel")
base.accept(); onClicked: reject()
},
Cura.PrimaryButton
{
text: catalog.i18nc("@action:button", "Open")
onClicked: accept()
} }
]
function reject() { onRejected: manager.onCancelButtonClicked()
manager.onCancelButtonClicked(); onAccepted: manager.onOkButtonClicked()
base.visible = false;
base.rejected();
}
} }

View File

@ -1,25 +1,21 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.1 as UM import UM 1.5 as UM
ScrollView
{
property alias model: backupList.model
width: parent.width
clip: true
ListView ListView
{ {
id: backupList clip: true
width: parent.width ScrollBar.vertical: UM.ScrollBar {}
delegate: Item delegate: Item
{ {
// Add a margin, otherwise the scrollbar is on top of the right most component // Add a margin, otherwise the scrollbar is on top of the right most component
width: parent.width - UM.Theme.getSize("default_margin").width width: parent.width - UM.Theme.getSize("scrollbar").width
height: childrenRect.height height: childrenRect.height
BackupListItem BackupListItem
@ -36,4 +32,3 @@ ScrollView
} }
} }
} }
}

View File

@ -1,12 +1,11 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.1
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
@ -42,28 +41,22 @@ Item
onClicked: backupListItem.showDetails = !backupListItem.showDetails onClicked: backupListItem.showDetails = !backupListItem.showDetails
} }
Label UM.Label
{ {
text: new Date(modelData.generated_time).toLocaleString(UM.Preferences.getValue("general/language")) text: new Date(modelData.generated_time).toLocaleString(UM.Preferences.getValue("general/language"))
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
Layout.minimumWidth: 100 * screenScaleFactor Layout.minimumWidth: 100 * screenScaleFactor
Layout.maximumWidth: 500 * screenScaleFactor Layout.maximumWidth: 500 * screenScaleFactor
Layout.fillWidth: true Layout.fillWidth: true
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: modelData.metadata.description text: modelData.metadata.description
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
Layout.minimumWidth: 100 * screenScaleFactor Layout.minimumWidth: 100 * screenScaleFactor
Layout.maximumWidth: 500 * screenScaleFactor Layout.maximumWidth: 500 * screenScaleFactor
Layout.fillWidth: true Layout.fillWidth: true
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
} }
Cura.SecondaryButton Cura.SecondaryButton
@ -94,21 +87,21 @@ Item
anchors.top: dataRow.bottom anchors.top: dataRow.bottom
} }
MessageDialog Cura.MessageDialog
{ {
id: confirmDeleteDialog id: confirmDeleteDialog
title: catalog.i18nc("@dialog:title", "Delete Backup") title: catalog.i18nc("@dialog:title", "Delete Backup")
text: catalog.i18nc("@dialog:info", "Are you sure you want to delete this backup? This cannot be undone.") text: catalog.i18nc("@dialog:info", "Are you sure you want to delete this backup? This cannot be undone.")
standardButtons: StandardButton.Yes | StandardButton.No standardButtons: Dialog.Yes | Dialog.No
onYes: CuraDrive.deleteBackup(modelData.backup_id) onAccepted: CuraDrive.deleteBackup(modelData.backup_id)
} }
MessageDialog Cura.MessageDialog
{ {
id: confirmRestoreDialog id: confirmRestoreDialog
title: catalog.i18nc("@dialog:title", "Restore Backup") title: catalog.i18nc("@dialog:title", "Restore Backup")
text: catalog.i18nc("@dialog:info", "You will need to restart Cura before your backup is restored. Do you want to close Cura now?") text: catalog.i18nc("@dialog:info", "You will need to restart Cura before your backup is restored. Do you want to close Cura now?")
standardButtons: StandardButton.Yes | StandardButton.No standardButtons: Dialog.Yes | Dialog.No
onYes: CuraDrive.restoreBackup(modelData.backup_id) onAccepted: CuraDrive.restoreBackup(modelData.backup_id)
} }
} }

View File

@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.3 as UM import UM 1.5 as UM
RowLayout RowLayout
{ {
@ -26,27 +26,21 @@ RowLayout
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
Label UM.Label
{ {
id: detailName id: detailName
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
Layout.minimumWidth: 50 * screenScaleFactor Layout.minimumWidth: 50 * screenScaleFactor
Layout.maximumWidth: 100 * screenScaleFactor Layout.maximumWidth: 100 * screenScaleFactor
Layout.fillWidth: true Layout.fillWidth: true
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
id: detailValue id: detailValue
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
Layout.minimumWidth: 50 * screenScaleFactor Layout.minimumWidth: 50 * screenScaleFactor
Layout.maximumWidth: 100 * screenScaleFactor Layout.maximumWidth: 100 * screenScaleFactor
Layout.fillWidth: true Layout.fillWidth: true
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
} }
} }

View File

@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "../components" import "../components"
@ -28,18 +28,14 @@ Column
width: Math.round(parent.width / 4) width: Math.round(parent.width / 4)
} }
Label UM.Label
{ {
id: welcomeTextLabel id: welcomeTextLabel
text: catalog.i18nc("@description", "Backup and synchronize your Cura settings.") text: catalog.i18nc("@description", "Backup and synchronize your Cura settings.")
width: Math.round(parent.width / 2) width: Math.round(parent.width / 2)
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Label.WordWrap wrapMode: Label.WordWrap
renderType: Text.NativeRendering
} }
Cura.PrimaryButton Cura.PrimaryButton

View File

@ -1,10 +1,9 @@
// Copyright (C) 2021 Ultimaker B.V. //Copyright (C) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura

View File

@ -1,10 +1,9 @@
// Copyright (C) 2021 Ultimaker B.V. //Copyright (C) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura

View File

@ -1,10 +1,9 @@
// Copyright (C) 2021 Ultimaker B.V. //Copyright (C) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura

View File

@ -1,10 +1,10 @@
// Copyright (C) 2021 Ultimaker B.V. //Copyright (C) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import Qt.labs.qmlmodels 1.0
import QtQuick 2.15
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
@ -57,52 +57,32 @@ Item
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
//We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView.
Cura.TableView //So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView.
Table
{ {
id: filesTableView id: filesTableView
anchors.fill: parent anchors.fill: parent
model: manager.digitalFactoryFileModel anchors.margins: parent.border.width
visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress
selectionMode: OldControls.SelectionMode.SingleSelection columnHeaders: ["Name", "Uploaded by", "Uploaded at"]
onDoubleClicked: model: TableModel
{
TableModelColumn { display: "fileName" }
TableModelColumn { display: "username" }
TableModelColumn { display: "uploadedAt" }
rows: manager.digitalFactoryFileModel.items
}
onCurrentRowChanged:
{
manager.setSelectedFileIndices([currentRow]);
}
onDoubleClicked: function(row)
{ {
manager.setSelectedFileIndices([row]); manager.setSelectedFileIndices([row]);
openFilesButton.clicked(); openFilesButton.clicked();
} }
OldControls.TableViewColumn
{
id: fileNameColumn
role: "fileName"
title: "Name"
width: Math.round(filesTableView.width / 3)
}
OldControls.TableViewColumn
{
id: usernameColumn
role: "username"
title: "Uploaded by"
width: Math.round(filesTableView.width / 3)
}
OldControls.TableViewColumn
{
role: "uploadedAt"
title: "Uploaded at"
}
Connections
{
target: filesTableView.selection
function onSelectionChanged()
{
let newSelection = [];
filesTableView.selection.forEach(function(rowIndex) { newSelection.push(rowIndex); });
manager.setSelectedFileIndices(newSelection);
}
}
} }
Label Label
@ -161,7 +141,6 @@ Item
{ {
// Make sure no files are selected when the file model changes // Make sure no files are selected when the file model changes
filesTableView.currentRow = -1 filesTableView.currentRow = -1
filesTableView.selection.clear()
} }
} }
} }
@ -187,7 +166,7 @@ Item
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
text: "Open" text: "Open"
enabled: filesTableView.selection.count > 0 enabled: filesTableView.currentRow >= 0
onClicked: onClicked:
{ {
manager.openSelectedFiles() manager.openSelectedFiles()

View File

@ -1,10 +1,10 @@
// Copyright (C) 2021 Ultimaker B.V. //Copyright (C) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import Qt.labs.qmlmodels 1.0
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
@ -86,35 +86,22 @@ Item
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
//We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView.
Cura.TableView //So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView.
Table
{ {
id: filesTableView id: filesTableView
anchors.fill: parent anchors.fill: parent
model: manager.digitalFactoryFileModel anchors.margins: parent.border.width
visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress
selectionMode: OldControls.SelectionMode.NoSelection
OldControls.TableViewColumn allowSelection: false
columnHeaders: ["Name", "Uploaded by", "Uploaded at"]
model: TableModel
{ {
id: fileNameColumn TableModelColumn { display: "fileName" }
role: "fileName" TableModelColumn { display: "username" }
title: "@tableViewColumn:title", "Name" TableModelColumn { display: "uploadedAt" }
width: Math.round(filesTableView.width / 3) rows: manager.digitalFactoryFileModel.items
}
OldControls.TableViewColumn
{
id: usernameColumn
role: "username"
title: "Uploaded by"
width: Math.round(filesTableView.width / 3)
}
OldControls.TableViewColumn
{
role: "uploadedAt"
title: "Uploaded at"
} }
} }
@ -173,8 +160,7 @@ Item
function onItemsChanged() function onItemsChanged()
{ {
// Make sure no files are selected when the file model changes // Make sure no files are selected when the file model changes
filesTableView.currentRow = -1 filesTableView.currentRow = -1;
filesTableView.selection.clear()
} }
} }
} }

View File

@ -3,9 +3,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.2 as UM import UM 1.2 as UM

View File

@ -0,0 +1,203 @@
//Copyright (C) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import Qt.labs.qmlmodels 1.0
import QtQuick 2.15
import QtQuick.Controls 2.15
import UM 1.2 as UM
/*
* A re-sizeable table of data.
*
* This table combines a list of headers with a TableView to show certain roles in a table.
* The columns of the table can be resized.
* When the table becomes too big, you can scroll through the table. When a column becomes too small, the contents of
* the table are elided.
* The table gets Cura's themeing.
*/
Item
{
id: tableBase
required property var columnHeaders //The text to show in the headers of each column.
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
property int currentRow: -1 //The selected row index.
property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
property bool allowSelection: true //Whether to allow the user to select items.
Row
{
id: headerBar
Repeater
{
id: headerRepeater
model: columnHeaders
Rectangle
{
//minimumWidth: Math.max(1, Math.round(tableBase.width / headerRepeater.count))
width: 300
height: UM.Theme.getSize("section").height
color: UM.Theme.getColor("secondary")
Label
{
id: contentText
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("narrow_margin").width
text: modelData
font: UM.Theme.getFont("medium_bold")
color: UM.Theme.getColor("text")
elide: Text.ElideRight
}
Rectangle //Resize handle.
{
anchors
{
right: parent.right
top: parent.top
bottom: parent.bottom
}
width: UM.Theme.getSize("thick_lining").width
color: UM.Theme.getColor("thick_lining")
MouseArea
{
anchors.fill: parent
cursorShape: Qt.SizeHorCursor
drag
{
target: parent
axis: Drag.XAxis
}
onMouseXChanged:
{
if(drag.active)
{
let new_width = parent.parent.width + mouseX;
let sum_widths = mouseX;
for(let i = 0; i < headerBar.children.length; ++i)
{
sum_widths += headerBar.children[i].width;
}
if(sum_widths > tableBase.width)
{
new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
}
let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized.
parent.parent.width = Qt.binding(function() { return Math.max(10, Math.round(tableBase.width * width_fraction)) });
}
}
}
}
onWidthChanged:
{
tableView.forceLayout(); //Rescale table cells underneath as well.
}
}
}
}
TableView
{
id: tableView
anchors
{
top: headerBar.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
flickableDirection: Flickable.AutoFlickIfNeeded
clip: true
ScrollBar.vertical: ScrollBar
{
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
id: verticalScrollBar
visible: tableView.contentHeight > tableView.height
background: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: UM.Theme.getColor("scrollbar_background")
}
contentItem: Rectangle
{
id: scrollViewHandle
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle")
Behavior on color { ColorAnimation { duration: 50; } }
}
}
columnWidthProvider: function(column)
{
return headerBar.children[column].width; //Cells get the same width as their column header.
}
delegate: Rectangle
{
implicitHeight: Math.max(1, cellContent.height)
color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
Label
{
id: cellContent
width: parent.width
text: display
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
}
TextMetrics
{
id: cellTextMetrics
text: cellContent.text
font: cellContent.font
elide: cellContent.elide
elideWidth: cellContent.width
}
UM.TooltipArea
{
anchors.fill: parent
acceptedButtons: Qt.LeftButton
text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided.
onClicked:
{
if(tableBase.allowSelection)
{
tableBase.currentRow = row; //Select this row.
}
}
onDoubleClicked:
{
tableBase.onDoubleClicked(row);
}
}
}
Connections
{
target: model
function onRowCountChanged()
{
tableView.contentY = 0; //When the number of rows is reduced, make sure to scroll back to the start.
}
}
}
}

View File

@ -1,19 +1,19 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import QtQuick.Dialogs 1.2 // For filedialog import QtQuick.Dialogs 1.2 // For filedialog
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Cura.MachineAction Cura.MachineAction
{ {
anchors.fill: parent; anchors.fill: parent
property bool printerConnected: Cura.MachineManager.printerConnected property bool printerConnected: Cura.MachineManager.printerConnected
property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
property bool canUpdateFirmware: activeOutputDevice ? activeOutputDevice.activePrinter.canUpdateFirmware : false property bool canUpdateFirmware: activeOutputDevice ? activeOutputDevice.activePrinter.canUpdateFirmware : false
@ -25,25 +25,22 @@ Cura.MachineAction
UM.I18nCatalog { id: catalog; name: "cura"} UM.I18nCatalog { id: catalog; name: "cura"}
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Label UM.Label
{ {
width: parent.width width: parent.width
text: catalog.i18nc("@title", "Update Firmware") text: catalog.i18nc("@title", "Update Firmware")
wrapMode: Text.WordWrap
font.pointSize: 18 font.pointSize: 18
} }
Label UM.Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.") text: catalog.i18nc("@label", "Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.")
} }
Label UM.Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap text: catalog.i18nc("@label", "The firmware shipping with new printers works, but new versions tend to have more features and improvements.")
text: catalog.i18nc("@label", "The firmware shipping with new printers works, but new versions tend to have more features and improvements.");
} }
Row Row
@ -52,10 +49,10 @@ Cura.MachineAction
width: childrenRect.width width: childrenRect.width
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName() property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName()
Button Cura.SecondaryButton
{ {
id: autoUpgradeButton id: autoUpgradeButton
text: catalog.i18nc("@action:button", "Automatically upgrade Firmware"); text: catalog.i18nc("@action:button", "Automatically upgrade Firmware")
enabled: parent.firmwareName != "" && canUpdateFirmware enabled: parent.firmwareName != "" && canUpdateFirmware
onClicked: onClicked:
{ {
@ -63,10 +60,10 @@ Cura.MachineAction
activeOutputDevice.updateFirmware(parent.firmwareName); activeOutputDevice.updateFirmware(parent.firmwareName);
} }
} }
Button Cura.SecondaryButton
{ {
id: manualUpgradeButton id: manualUpgradeButton
text: catalog.i18nc("@action:button", "Upload custom Firmware"); text: catalog.i18nc("@action:button", "Upload custom Firmware")
enabled: canUpdateFirmware enabled: canUpdateFirmware
onClicked: onClicked:
{ {
@ -75,20 +72,18 @@ Cura.MachineAction
} }
} }
Label UM.Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap
visible: !printerConnected && !updateProgressDialog.visible visible: !printerConnected && !updateProgressDialog.visible
text: catalog.i18nc("@label", "Firmware can not be updated because there is no connection with the printer."); text: catalog.i18nc("@label", "Firmware can not be updated because there is no connection with the printer.")
} }
Label Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap
visible: printerConnected && !canUpdateFirmware visible: printerConnected && !canUpdateFirmware
text: catalog.i18nc("@label", "Firmware can not be updated because the connection with the printer does not support upgrading firmware."); text: catalog.i18nc("@label", "Firmware can not be updated because the connection with the printer does not support upgrading firmware.")
} }
} }
@ -122,7 +117,7 @@ Cura.MachineAction
{ {
anchors.fill: parent anchors.fill: parent
Label UM.Label
{ {
anchors anchors
{ {
@ -157,12 +152,10 @@ Cura.MachineAction
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
ProgressBar UM.ProgressBar
{ {
id: prog id: prog
value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress : 0 value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress / 100 : 0
minimumValue: 0
maximumValue: 100
indeterminate: indeterminate:
{ {
if(manager.firmwareUpdater == null) if(manager.firmwareUpdater == null)
@ -173,18 +166,18 @@ Cura.MachineAction
} }
anchors anchors
{ {
left: parent.left; left: parent.left
right: parent.right; right: parent.right
} }
} }
} }
rightButtons: [ rightButtons: [
Button Cura.SecondaryButton
{ {
text: catalog.i18nc("@action:button","Close"); text: catalog.i18nc("@action:button", "Close")
enabled: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareUpdateState != 1 : true; enabled: manager.firmwareUpdater != null ? manager.firmwareUpdater.firmwareUpdateState != 1 : true
onClicked: updateProgressDialog.visible = false; onClicked: updateProgressDialog.visible = false
} }
] ]
} }

View File

@ -1,239 +1,333 @@
// Copyright (c) 2015 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.1 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.3
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.0 as Cura
UM.Dialog UM.Dialog
{ {
width: minimumWidth; title: catalog.i18nc("@title:window", "Convert Image")
minimumWidth: 350 * screenScaleFactor;
height: minimumHeight; minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height
minimumHeight: 250 * screenScaleFactor; minimumHeight: UM.Theme.getSize("modal_window_minimum").height
width: minimumWidth
title: catalog.i18nc("@title:window", "Convert Image...") height: minimumHeight
GridLayout GridLayout
{ {
UM.I18nCatalog { id: catalog; name: "cura" } UM.I18nCatalog { id: catalog; name: "cura" }
anchors.fill: parent; id: grid
Layout.fillWidth: true columnSpacing: UM.Theme.getSize("narrow_margin").width
columnSpacing: 16 * screenScaleFactor rowSpacing: UM.Theme.getSize("narrow_margin").height
rowSpacing: 4 * screenScaleFactor columns: 2
columns: 1
UM.TooltipArea { UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"")
Row {
width: parent.width
Label {
text: catalog.i18nc("@action:label", "Height (mm)") text: catalog.i18nc("@action:label", "Height (mm)")
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea {
id: peak_height_label
anchors.fill: parent
hoverEnabled: true
}
} }
TextField { Cura.TextField
{
id: peak_height id: peak_height
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
selectByMouse: true
objectName: "Peak_Height" objectName: "Peak_Height"
validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ }
width: 180 * screenScaleFactor onTextChanged: manager.onPeakHeightChanged(text)
onTextChanged: { manager.onPeakHeightChanged(text) }
}
}
} }
UM.TooltipArea { Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The maximum distance of each pixel from \"Base.\"")
visible: peak_height.hovered || peak_height_label.containsMouse
targetPoint: Qt.point(peak_height.x + Math.round(peak_height.width / 2), 0)
y: peak_height.y + peak_height.height + UM.Theme.getSize("default_margin").height
}
UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.")
Row {
width: parent.width
Label {
text: catalog.i18nc("@action:label", "Base (mm)") text: catalog.i18nc("@action:label", "Base (mm)")
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea
{
id: base_height_label
anchors.fill: parent
hoverEnabled: true
}
} }
TextField { Cura.TextField
{
id: base_height id: base_height
selectByMouse: true
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
objectName: "Base_Height" objectName: "Base_Height"
validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ }
width: 180 * screenScaleFactor onTextChanged: manager.onBaseHeightChanged(text)
onTextChanged: { manager.onBaseHeightChanged(text) }
}
}
} }
UM.TooltipArea { Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The base height from the build plate in millimeters.")
visible: base_height.hovered || base_height_label.containsMouse
targetPoint: Qt.point(base_height.x + Math.round(base_height.width / 2), 0)
y: base_height.y + base_height.height + UM.Theme.getSize("default_margin").height
}
UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.")
Row {
width: parent.width
Label {
text: catalog.i18nc("@action:label", "Width (mm)") text: catalog.i18nc("@action:label", "Width (mm)")
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea {
id: width_label
anchors.fill: parent
hoverEnabled: true
}
} }
TextField { Cura.TextField
{
id: width id: width
selectByMouse: true
objectName: "Width" objectName: "Width"
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
focus: true focus: true
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
width: 180 * screenScaleFactor onTextChanged: manager.onWidthChanged(text)
onTextChanged: { manager.onWidthChanged(text) }
}
}
} }
UM.TooltipArea { Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The width in millimeters on the build plate")
visible: width.hovered || width_label.containsMouse
targetPoint: Qt.point(width.x + Math.round(width.width / 2), 0)
y: width.y + width.height + UM.Theme.getSize("default_margin").height
}
UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate")
Row {
width: parent.width
Label {
text: catalog.i18nc("@action:label", "Depth (mm)") text: catalog.i18nc("@action:label", "Depth (mm)")
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea {
id: depth_label
anchors.fill: parent
hoverEnabled: true
} }
TextField { }
Cura.TextField
{
id: depth id: depth
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
selectByMouse: true
objectName: "Depth" objectName: "Depth"
focus: true focus: true
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
width: 180 * screenScaleFactor onTextChanged: manager.onDepthChanged(text)
onTextChanged: { manager.onDepthChanged(text) }
}
}
} }
UM.TooltipArea { Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The depth in millimeters on the build plate")
visible: depth.hovered || depth_label.containsMouse
targetPoint: Qt.point(depth.x + Math.round(depth.width / 2), 0)
y: depth.y + depth.height + UM.Theme.getSize("default_margin").height
}
UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
Row {
width: parent.width
//Empty label so 2 column layout works.
Label {
text: "" text: ""
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea {
id: lighter_is_higher_label
anchors.fill: parent
hoverEnabled: true
} }
ComboBox { }
Cura.ComboBox
{
id: lighter_is_higher id: lighter_is_higher
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
Layout.preferredHeight: UM.Theme.getSize("setting_control").height
objectName: "Lighter_Is_Higher" objectName: "Lighter_Is_Higher"
model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ] textRole: "text"
width: 180 * screenScaleFactor model: [
{ text: catalog.i18nc("@item:inlistbox", "Darker is higher") },
{ text: catalog.i18nc("@item:inlistbox", "Lighter is higher") }
]
onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
} }
}
Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
visible: lighter_is_higher.hovered || lighter_is_higher_label.containsMouse
targetPoint: Qt.point(lighter_is_higher.x + Math.round(lighter_is_higher.width / 2), 0)
y: lighter_is_higher.y + lighter_is_higher.height + UM.Theme.getSize("default_margin").height
} }
UM.TooltipArea { UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.") text: catalog.i18nc("@action:label", "Color Model")
Row { Layout.alignment: Qt.AlignVCenter
width: parent.width
Label { MouseArea {
text: "Color Model" id: color_model_label
width: 150 * screenScaleFactor anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter hoverEnabled: true
} }
ComboBox { }
Cura.ComboBox
{
id: color_model id: color_model
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
Layout.preferredHeight: UM.Theme.getSize("setting_control").height
objectName: "ColorModel" objectName: "ColorModel"
model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ] textRole: "text"
width: 180 * screenScaleFactor model: [
{ text: catalog.i18nc("@item:inlistbox", "Linear") },
{ text: catalog.i18nc("@item:inlistbox", "Translucency") }
]
onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
} }
}
Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.")
visible: color_model.hovered || color_model_label.containsMouse
targetPoint: Qt.point(color_model.x + Math.round(color_model.width / 2), 0)
y: color_model.y + color_model.height + UM.Theme.getSize("default_margin").height
} }
UM.TooltipArea { UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency")
Row {
width: parent.width
Label {
text: catalog.i18nc("@action:label", "1mm Transmittance (%)") text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea {
id: transmittance_label
anchors.fill: parent
hoverEnabled: true
} }
TextField { }
id: transmittance
Cura.TextField
{
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
selectByMouse: true
objectName: "Transmittance" objectName: "Transmittance"
focus: true
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
width: 180 * screenScaleFactor onTextChanged: manager.onTransmittanceChanged(text)
onTextChanged: { manager.onTransmittanceChanged(text) }
} Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
visible: parent.hovered || transmittance_label.containsMouse
targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), 0)
y: parent.y + parent.height + UM.Theme.getSize("default_margin").height
} }
} }
UM.TooltipArea { UM.Label
{
Layout.fillWidth: true Layout.fillWidth: true
height: childrenRect.height Layout.minimumWidth: UM.Theme.getSize("setting_control").width
text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.")
Row {
width: parent.width
Label {
text: catalog.i18nc("@action:label", "Smoothing") text: catalog.i18nc("@action:label", "Smoothing")
width: 150 * screenScaleFactor Layout.alignment: Qt.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
MouseArea
{
id: smoothing_label
anchors.fill: parent
hoverEnabled: true
}
} }
Item { Cura.SpinBox
width: 180 * screenScaleFactor {
height: 20 * screenScaleFactor
Layout.fillWidth: true
Slider {
id: smoothing id: smoothing
Layout.fillWidth: true
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
objectName: "Smoothing" objectName: "Smoothing"
maximumValue: 100.0 to: 100.0
stepSize: 1.0 stepSize: 1.0
width: 180 onValueChanged: manager.onSmoothingChanged(value)
onValueChanged: { manager.onSmoothingChanged(value) } }
}
Cura.ToolTip
{
text: catalog.i18nc("@info:tooltip", "The amount of smoothing to apply to the image.")
visible: smoothing.hovered || smoothing_label.containsMouse
targetPoint: Qt.point(smoothing.x + Math.round(smoothing.width / 2), 0)
y: smoothing.y + smoothing.height + UM.Theme.getSize("default_margin").height
} }
} }
Item
{
ButtonGroup
{
buttons: [ok_button, cancel_button]
checkedButton: ok_button
} }
} }
onAccepted: manager.onOkButtonClicked()
onRejected: manager.onCancelButtonClicked()
buttonSpacing: UM.Theme.getSize("default_margin").width
rightButtons: [ rightButtons: [
Button Cura.TertiaryButton
{
id:ok_button
text: catalog.i18nc("@action:button","OK");
onClicked: { manager.onOkButtonClicked() }
enabled: true
},
Button
{ {
id: cancel_button id: cancel_button
text: catalog.i18nc("@action:button","Cancel"); text: catalog.i18nc("@action:button", "Cancel")
onClicked: { manager.onCancelButtonClicked() } onClicked: manager.onCancelButtonClicked()
enabled: true },
Cura.PrimaryButton
{
id: ok_button
text: catalog.i18nc("@action:button", "OK")
onClicked: manager.onOkButtonClicked()
} }
] ]
} }

View File

@ -1,11 +1,11 @@
// Copyright (c) 2019 Ultimaker B.V. //Copyright (c) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -88,7 +88,7 @@ Cura.MachineAction
} }
} }
Label UM.Label
{ {
id: machineNameLabel id: machineNameLabel
anchors.top: parent.top anchors.top: parent.top
@ -97,7 +97,6 @@ Cura.MachineAction
text: Cura.MachineManager.activeMachine.name text: Cura.MachineManager.activeMachine.name
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
renderType: Text.NativeRendering
} }
UM.TabRow UM.TabRow
@ -111,6 +110,7 @@ Cura.MachineAction
model: tabNameModel model: tabNameModel
delegate: UM.TabRowButton delegate: UM.TabRowButton
{ {
checked: model.index == 0
text: model.name text: model.name
} }
} }

View File

@ -14,8 +14,8 @@ UM.Dialog
{ {
id: licenseDialog id: licenseDialog
title: catalog.i18nc("@button", "Plugin license agreement") title: catalog.i18nc("@button", "Plugin license agreement")
minimumWidth: UM.Theme.getSize("license_window_minimum").width minimumWidth: UM.Theme.getSize("modal_window_minimum").width
minimumHeight: UM.Theme.getSize("license_window_minimum").height minimumHeight: UM.Theme.getSize("modal_window_minimum").height
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
backgroundColor: UM.Theme.getColor("main_background") backgroundColor: UM.Theme.getColor("main_background")

View File

@ -64,8 +64,8 @@ Window
// Page title. // Page title.
Item Item
{ {
implicitWidth: parent.width Layout.preferredWidth: parent.width
implicitHeight: childrenRect.height + UM.Theme.getSize("default_margin").height Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
Label Label
{ {

View File

@ -2,43 +2,20 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.2 as UM import UM 1.2 as UM
Button UM.SimpleButton
{ {
id: modelCheckerButton id: modelCheckerButton
UM.I18nCatalog
{
id: catalog
name: "cura"
}
visible: manager.hasWarnings visible: manager.hasWarnings
tooltip: catalog.i18nc("@info:tooltip", "Some things could be problematic in this print. Click to see tips for adjustment.")
onClicked: manager.showWarnings() onClicked: manager.showWarnings()
width: UM.Theme.getSize("save_button_specs_icons").width width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height height: UM.Theme.getSize("save_button_specs_icons").height
iconSource: "model_checker.svg"
anchors.verticalCenter: parent ? parent.verticalCenter : undefined anchors.verticalCenter: parent ? parent.verticalCenter : undefined
color: UM.Theme.getColor("text_scene")
style: ButtonStyle hoverColor: UM.Theme.getColor("text_scene_hover")
{
background: Item
{
UM.RecolorImage
{
width: UM.Theme.getSize("save_button_specs_icons").width;
height: UM.Theme.getSize("save_button_specs_icons").height;
sourceSize.height: width;
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
source: "model_checker.svg"
}
}
}
} }

View File

@ -3,7 +3,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
// We show a nice overlay on the 3D viewer when the current output device has no monitor view // We show a nice overlay on the 3D viewer when the current output device has no monitor view
@ -90,7 +90,7 @@ Rectangle
visible: monitorViewComponent.sourceComponent == null visible: monitorViewComponent.sourceComponent == null
// CASE 2: CAN MONITOR & NOT CONNECTED // CASE 2: CAN MONITOR & NOT CONNECTED
Label UM.Label
{ {
anchors anchors
{ {
@ -99,14 +99,10 @@ Rectangle
visible: isNetworkConfigured && !isConnected visible: isNetworkConfigured && !isConnected
text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.") text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.WordWrap
lineHeight: UM.Theme.getSize("monitor_text_line_large").height
lineHeightMode: Text.FixedHeight
width: contentWidth width: contentWidth
} }
Label UM.Label
{ {
id: noNetworkLabel id: noNetworkLabel
anchors anchors
@ -116,11 +112,7 @@ Rectangle
visible: !isNetworkConfigured && isNetworkConfigurable visible: !isNetworkConfigured && isNetworkConfigurable
text: catalog.i18nc("@info", "Please connect your printer to the network.") text: catalog.i18nc("@info", "Please connect your printer to the network.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.WordWrap
width: contentWidth width: contentWidth
lineHeight: UM.Theme.getSize("monitor_text_line_large").height
lineHeightMode: Text.FixedHeight
} }
Item Item
{ {
@ -129,7 +121,6 @@ Rectangle
left: noNetworkLabel.left left: noNetworkLabel.left
} }
visible: !isNetworkConfigured && isNetworkConfigurable visible: !isNetworkConfigured && isNetworkConfigurable
height: UM.Theme.getSize("monitor_text_line").height
width: childrenRect.width width: childrenRect.width
UM.RecolorImage UM.RecolorImage
@ -138,8 +129,8 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
source: UM.Theme.getIcon("LinkExternal") source: UM.Theme.getIcon("LinkExternal")
width: UM.Theme.getSize("monitor_external_link_icon").width width: UM.Theme.getSize("icon_indicator").width
height: UM.Theme.getSize("monitor_external_link_icon").height height: UM.Theme.getSize("icon_indicator").height
} }
Label Label
{ {

View File

@ -1,59 +1,62 @@
// Copyright (c) 2015 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher. // Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.1 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
import ".." import ".."
Button { Button {
id: base; id: base;
style: ButtonStyle { background: Rectangle {
background: Item { } color: UM.Theme.getColor("category_background")
label: Row }
contentItem: Row
{ {
spacing: UM.Theme.getSize("default_lining").width spacing: UM.Theme.getSize("default_lining").width
Item //Wrapper to give space before icon with fixed width. This allows aligning checkbox with category icon.
{
height: label.height
width: height
anchors.verticalCenter: parent.verticalCenter
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: (label.height / 2) | 0 height: (label.height / 2) | 0
width: height width: height
source: control.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight")
color: control.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("text")
}
} }
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: label.height height: label.height
width: height width: height
source: control.iconSource source: UM.Theme.getIcon(definition.icon)
color: control.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
} }
Label UM.Label
{ {
id: label id: label
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: control.text text: base.text
color: control.hovered ? palette.highlight : palette.buttonText color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
font.bold: true font.bold: true
} }
SystemPalette { id: palette }
}
} }
signal showTooltip(string text); signal showTooltip(string text)
signal hideTooltip(); signal hideTooltip()
signal contextMenuRequested() signal contextMenuRequested()
text: definition.label text: definition.label
iconSource: UM.Theme.getIcon(definition.icon)
checkable: true checkable: true
checked: definition.expanded checked: definition.expanded

View File

@ -3,25 +3,32 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.1
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
UM.TooltipArea UM.TooltipArea
{ {
x: model.depth * UM.Theme.getSize("default_margin").width; x: model.depth * UM.Theme.getSize("default_margin").width
text: model.description; text: model.description
width: childrenRect.width; width: childrenRect.width
height: childrenRect.height; height: childrenRect.height
Item
{
id: spacer
// Align checkbox with PerObjectCategory icon
width: UM.Theme.getSize("default_margin").width
}
UM.CheckBox UM.CheckBox
{ {
id: check id: check
anchors.left: spacer.right
text: definition.label text: definition.label
checked: addedSettingsModel.getVisible(model.key) checked: addedSettingsModel.getVisible(model.key)

View File

@ -1,11 +1,10 @@
// Copyright (c) 2021 Ultimaker B.V. //Copyright (c) 2022 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 2.15
import QtQuick.Controls.Styles 1.2
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import ".." import ".."
@ -76,63 +75,72 @@ Item
id: meshTypeButtons id: meshTypeButtons
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
Button Cura.ToolbarButton
{ {
id: normalButton id: normalButton
text: catalog.i18nc("@label", "Normal model") text: catalog.i18nc("@label", "Normal model")
iconSource: UM.Theme.getIcon("Infill0"); toolItem: UM.RecolorImage
{
source: UM.Theme.getIcon("Infill0")
color: UM.Theme.getColor("icon")
}
property bool needBorder: true property bool needBorder: true
checkable: true checkable: true
onClicked: setMeshType(normalMeshType); onClicked: setMeshType(normalMeshType);
style: UM.Theme.styles.tool_button;
z: 4 z: 4
} }
Button Cura.ToolbarButton
{ {
id: supportMeshButton id: supportMeshButton
text: catalog.i18nc("@label", "Print as support") text: catalog.i18nc("@label", "Print as support")
iconSource: UM.Theme.getIcon("MeshTypeSupport"); toolItem: UM.RecolorImage
{
source: UM.Theme.getIcon("MeshTypeSupport")
color: UM.Theme.getColor("icon")
}
property bool needBorder: true property bool needBorder: true
checkable:true checkable:true
onClicked: setMeshType(supportMeshType) onClicked: setMeshType(supportMeshType)
style: UM.Theme.styles.tool_button;
z: 3 z: 3
} }
Button Cura.ToolbarButton
{ {
id: overlapMeshButton id: overlapMeshButton
text: catalog.i18nc("@label", "Modify settings for overlaps") text: catalog.i18nc("@label", "Modify settings for overlaps")
iconSource: UM.Theme.getIcon("MeshTypeIntersect"); toolItem: UM.RecolorImage
{
source: UM.Theme.getIcon("MeshTypeIntersect")
color: UM.Theme.getColor("icon")
}
property bool needBorder: true property bool needBorder: true
checkable:true checkable:true
onClicked: setMeshType(infillMeshType) onClicked: setMeshType(infillMeshType)
style: UM.Theme.styles.tool_button;
z: 2 z: 2
} }
Button Cura.ToolbarButton
{ {
id: antiOverhangMeshButton id: antiOverhangMeshButton
text: catalog.i18nc("@label", "Don't support overlaps") text: catalog.i18nc("@label", "Don't support overlaps")
iconSource: UM.Theme.getIcon("BlockSupportOverlaps"); toolItem: UM.RecolorImage
{
source: UM.Theme.getIcon("BlockSupportOverlaps")
color: UM.Theme.getColor("icon")
}
property bool needBorder: true property bool needBorder: true
checkable: true checkable: true
onClicked: setMeshType(antiOverhangMeshType) onClicked: setMeshType(antiOverhangMeshType)
style: UM.Theme.styles.tool_button;
z: 1 z: 1
} }
} }
Label UM.Label
{ {
id: meshTypeLabel id: meshTypeLabel
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: UM.Theme.getSize("setting").height height: UM.Theme.getSize("setting").height
verticalAlignment: Text.AlignVCenter
} }
@ -182,15 +190,14 @@ Item
height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight) height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight)
visible: currentMeshType != "anti_overhang_mesh" visible: currentMeshType != "anti_overhang_mesh"
ScrollView
{
height: parent.height
width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width
style: UM.Theme.styles.scrollview
ListView ListView
{ {
id: contents id: contents
height: parent.height
width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width
ScrollBar.vertical: UM.ScrollBar {}
clip: true
spacing: UM.Theme.getSize("default_lining").height spacing: UM.Theme.getSize("default_lining").height
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
@ -295,8 +302,6 @@ Item
onClicked: addedSettingsModel.setVisible(model.key, false) onClicked: addedSettingsModel.setVisible(model.key, false)
style: ButtonStyle
{
background: Item background: Item
{ {
UM.RecolorImage UM.RecolorImage
@ -305,12 +310,11 @@ Item
width: parent.width width: parent.width
height: width height: width
sourceSize.height: width sourceSize.height: width
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") color: parent.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
source: UM.Theme.getIcon("Minus") source: UM.Theme.getIcon("Minus")
} }
} }
} }
}
// Specialty provider that only watches global_inherits (we can't filter on what property changed we get events // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
// so we bypass that to make a dedicated provider). // so we bypass that to make a dedicated provider).
@ -371,7 +375,6 @@ Item
} }
} }
} }
}
Cura.SecondaryButton Cura.SecondaryButton
{ {
@ -422,8 +425,6 @@ Item
storeIndex: 0 storeIndex: 0
} }
SystemPalette { id: palette }
Component Component
{ {
id: settingTextField id: settingTextField

View File

@ -1,6 +1,8 @@
//Copyright (c) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.2
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -11,7 +13,8 @@ UM.Dialog
id: settingPickDialog id: settingPickDialog
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model") title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
width: screenScaleFactor * 360 width: UM.Theme.getSize("small_popup_dialog").width
backgroundColor: UM.Theme.getColor("background_1")
property var additional_excluded_settings property var additional_excluded_settings
@ -40,9 +43,10 @@ UM.Dialog
listview.model.filter = new_filter listview.model.filter = new_filter
} }
TextField Cura.TextField
{ {
id: filterInput id: filterInput
selectByMouse: true
anchors anchors
{ {
@ -69,20 +73,21 @@ UM.Dialog
text: catalog.i18nc("@label:checkbox", "Show all") text: catalog.i18nc("@label:checkbox", "Show all")
} }
ScrollView ListView
{ {
id: scrollView id: listview
anchors anchors
{ {
top: filterInput.bottom top: filterInput.bottom
topMargin: UM.Theme.getSize("default_margin").height
left: parent.left left: parent.left
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom
} }
ListView
{ ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
id: listview clip: true
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
{ {
id: definitionsModel id: definitionsModel
@ -101,7 +106,7 @@ UM.Dialog
{ {
id: loader id: loader
width: listview.width width: listview.width - scrollBar.width
height: model.type != undefined ? UM.Theme.getSize("section").height : 0 height: model.type != undefined ? UM.Theme.getSize("section").height : 0
property var definition: model property var definition: model
@ -121,13 +126,12 @@ UM.Dialog
} }
Component.onCompleted: settingPickDialog.updateFilter() Component.onCompleted: settingPickDialog.updateFilter()
} }
}
rightButtons: [ rightButtons: [
Button Cura.TertiaryButton
{ {
text: catalog.i18nc("@action:button", "Close") text: catalog.i18nc("@action:button", "Close")
onClicked: settingPickDialog.visible = false onClicked: reject()
} }
] ]
} }

View File

@ -1,16 +1,13 @@
// Copyright (c) 2015 Jaime van Kessel, Ultimaker B.V. // Copyright (c) 2022 Jaime van Kessel, Ultimaker B.V.
// The PostProcessingPlugin is released under the terms of the AGPLv3 or higher. // The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Controls.Styles 1.1
import QtQml.Models 2.15 as Models import QtQml.Models 2.15 as Models
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
UM.Dialog UM.Dialog
@ -18,14 +15,15 @@ UM.Dialog
id: dialog id: dialog
title: catalog.i18nc("@title:window", "Post Processing Plugin") title: catalog.i18nc("@title:window", "Post Processing Plugin")
width: 700 * screenScaleFactor; width: 700 * screenScaleFactor
height: 500 * screenScaleFactor; height: 500 * screenScaleFactor
minimumWidth: 400 * screenScaleFactor; minimumWidth: 400 * screenScaleFactor
minimumHeight: 250 * screenScaleFactor; minimumHeight: 250 * screenScaleFactor
onVisibleChanged: onVisibleChanged:
{ {
if(!visible) //Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack. // Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack.
if (!visible)
{ {
manager.writeScriptsToStack() manager.writeScriptsToStack()
} }
@ -36,63 +34,58 @@ UM.Dialog
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
id: base id: base
property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width) property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width)
property int textMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) property int textMargin: UM.Theme.getSize("narrow_margin").width
property string activeScriptName property string activeScriptName
SystemPalette{ id: palette }
SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
anchors.fill: parent anchors.fill: parent
ExclusiveGroup ButtonGroup
{ {
id: selectedScriptGroup id: selectedScriptGroup
} }
Item Column
{ {
id: activeScripts id: activeScripts
anchors.left: parent.left
width: base.columnWidth width: base.columnWidth
height: parent.height height: parent.height
Label spacing: base.textMargin
UM.Label
{ {
id: activeScriptsHeader id: activeScriptsHeader
text: catalog.i18nc("@label", "Post Processing Scripts") text: catalog.i18nc("@label", "Post Processing Scripts")
anchors.top: parent.top
anchors.topMargin: base.textMargin
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: base.textMargin
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: base.textMargin
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
elide: Text.ElideRight elide: Text.ElideRight
} }
ListView ListView
{ {
id: activeScriptsList id: activeScriptsList
anchors anchors
{ {
top: activeScriptsHeader.bottom
left: parent.left left: parent.left
right: parent.right right: parent.right
rightMargin: base.textMargin rightMargin: base.textMargin
topMargin: base.textMargin
leftMargin: UM.Theme.getSize("default_margin").width
} }
height: Math.min(contentHeight, parent.height - parent.spacing * 2 - activeScriptsHeader.height - addButton.height) //At the window height, start scrolling this one.
height: childrenRect.height clip: true
model: manager.scriptList ScrollBar.vertical: UM.ScrollBar
delegate: Item
{ {
width: parent.width id: activeScriptsScrollBar
height: activeScriptButton.height }
Button model: manager.scriptList
delegate: Button
{ {
id: activeScriptButton id: activeScriptButton
text: manager.getScriptLabelByKey(modelData.toString())
exclusiveGroup: selectedScriptGroup width: parent.width - activeScriptsScrollBar.width
width: parent.width height: UM.Theme.getSize("standard_list_lineheight").height
height: UM.Theme.getSize("setting").height
ButtonGroup.group: selectedScriptGroup
checkable: true checkable: true
checked: checked:
@ -107,6 +100,12 @@ UM.Dialog
return false return false
} }
} }
background: Rectangle
{
color: activeScriptButton.checked ? UM.Theme.getColor("background_3") : "transparent"
}
onClicked: onClicked:
{ {
forceActiveFocus() forceActiveFocus()
@ -114,60 +113,26 @@ UM.Dialog
base.activeScriptName = manager.getScriptLabelByKey(modelData.toString()) base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
} }
style: ButtonStyle RowLayout
{ {
background: Rectangle anchors.fill: parent
UM.Label
{ {
color: activeScriptButton.checked ? palette.highlight : "transparent" Layout.fillWidth: true
width: parent.width text: manager.getScriptLabelByKey(modelData.toString())
height: parent.height
}
label: Label
{
wrapMode: Text.Wrap
text: control.text
elide: Text.ElideRight
color: activeScriptButton.checked ? palette.highlightedText : palette.text
}
}
} }
Button Item
{
id: removeButton
text: "x"
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor
anchors.right:parent.right
anchors.rightMargin: base.textMargin
anchors.verticalCenter: parent.verticalCenter
onClicked: manager.removeScriptByIndex(index)
style: ButtonStyle
{
label: Item
{
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(control.width / 2.7)
height: Math.round(control.height / 2.7)
sourceSize.height: width
color: palette.text
source: UM.Theme.getIcon("Cancel")
}
}
}
}
Button
{ {
id: downButton id: downButton
text: "" Layout.preferredWidth: height
anchors.right: removeButton.left Layout.fillHeight: true
anchors.verticalCenter: parent.verticalCenter
enabled: index != manager.scriptList.length - 1 enabled: index != manager.scriptList.length - 1
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor MouseArea
{
anchors.fill: parent
onClicked: onClicked:
{ {
if (manager.selectedScriptIndex == index) if (manager.selectedScriptIndex == index)
@ -176,32 +141,30 @@ UM.Dialog
} }
return manager.moveScript(index, index + 1) return manager.moveScript(index, index + 1)
} }
style: ButtonStyle }
{
label: Item
{
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(control.width / 2.5) width: UM.Theme.getSize("standard_arrow").width
height: Math.round(control.height / 2.5) height: UM.Theme.getSize("standard_arrow").height
sourceSize.height: width sourceSize.width: width
color: control.enabled ? palette.text : disabledPalette.text sourceSize.height: height
color: parent.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
source: UM.Theme.getIcon("ChevronSingleDown") source: UM.Theme.getIcon("ChevronSingleDown")
} }
} }
} Item
}
Button
{ {
id: upButton id: upButton
text: "" Layout.preferredWidth: height
Layout.fillHeight: true
enabled: index != 0 enabled: index != 0
width: 20 * screenScaleFactor
height: 20 * screenScaleFactor MouseArea
anchors.right: downButton.left {
anchors.verticalCenter: parent.verticalCenter anchors.fill: parent
onClicked: onClicked:
{ {
if (manager.selectedScriptIndex == index) if (manager.selectedScriptIndex == index)
@ -210,52 +173,65 @@ UM.Dialog
} }
return manager.moveScript(index, index - 1) return manager.moveScript(index, index - 1)
} }
style: ButtonStyle }
{
label: Item
{
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(control.width / 2.5) width: UM.Theme.getSize("standard_arrow").width
height: Math.round(control.height / 2.5) height: UM.Theme.getSize("standard_arrow").height
sourceSize.height: width sourceSize.width: width
color: control.enabled ? palette.text : disabledPalette.text sourceSize.height: height
color: upButton.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
source: UM.Theme.getIcon("ChevronSingleUp") source: UM.Theme.getIcon("ChevronSingleUp")
} }
} }
Item
{
id: removeButton
Layout.preferredWidth: height
Layout.fillHeight: true
MouseArea
{
anchors.fill: parent
onClicked: manager.removeScriptByIndex(index)
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: height
color: UM.Theme.getColor("text")
source: UM.Theme.getIcon("Cancel")
} }
} }
} }
} }
Button }
Cura.SecondaryButton
{ {
id: addButton id: addButton
text: catalog.i18nc("@action", "Add a script") text: catalog.i18nc("@action", "Add a script")
anchors.left: parent.left
anchors.leftMargin: base.textMargin
anchors.top: activeScriptsList.bottom
anchors.topMargin: base.textMargin
onClicked: scriptsMenu.open() onClicked: scriptsMenu.open()
style: ButtonStyle
{
label: Label
{
text: control.text
} }
} }
}
QQC2.Menu Cura.Menu
{ {
id: scriptsMenu id: scriptsMenu
width: parent.width
Models.Instantiator Models.Instantiator
{ {
model: manager.loadedScriptList model: manager.loadedScriptList
QQC2.MenuItem Cura.MenuItem
{ {
text: manager.getScriptLabelByKey(modelData.toString()) text: manager.getScriptLabelByKey(modelData.toString())
onTriggered: manager.addScriptToList(modelData.toString()) onTriggered: manager.addScriptToList(modelData.toString())
@ -265,7 +241,6 @@ UM.Dialog
onObjectRemoved: scriptsMenu.removeItem(object) onObjectRemoved: scriptsMenu.removeItem(object)
} }
} }
}
Rectangle Rectangle
{ {
@ -296,9 +271,9 @@ UM.Dialog
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
} }
ScrollView ListView
{ {
id: scrollView id: listview
anchors anchors
{ {
top: scriptSpecsHeader.bottom top: scriptSpecsHeader.bottom
@ -309,13 +284,11 @@ UM.Dialog
bottom: parent.bottom bottom: parent.bottom
} }
ScrollBar.vertical: UM.ScrollBar {}
clip: true
visible: manager.selectedScriptDefinitionId != "" visible: manager.selectedScriptDefinitionId != ""
style: UM.Theme.styles.scrollview;
ListView
{
id: listview
spacing: UM.Theme.getSize("default_lining").height spacing: UM.Theme.getSize("default_lining").height
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
{ {
id: definitionsModel id: definitionsModel
@ -327,19 +300,12 @@ UM.Dialog
{ {
id: settingLoader id: settingLoader
width: parent.width width: listview.width
height: height:
{ {
if(provider.properties.enabled == "True") if (provider.properties.enabled == "True" && model.type != undefined)
{ {
if(model.type != undefined) return UM.Theme.getSize("section").height;
{
return UM.Theme.getSize("section").height
}
else
{
return 0
}
} }
else else
{ {
@ -419,10 +385,10 @@ UM.Dialog
function onShowTooltip(text) function onShowTooltip(text)
{ {
tooltip.text = text tooltip.text = text;
var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0) var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0);
tooltip.show(position) tooltip.show(position);
tooltip.target.x = position.x + 1 tooltip.target.x = position.x + 1;
} }
function onHideTooltip() { tooltip.hide() } function onHideTooltip() { tooltip.hide() }
@ -430,7 +396,6 @@ UM.Dialog
} }
} }
} }
}
Cura.PrintSetupTooltip Cura.PrintSetupTooltip
{ {
@ -480,10 +445,9 @@ UM.Dialog
} }
} }
rightButtons: Button rightButtons: Cura.TertiaryButton
{ {
text: catalog.i18nc("@action:button", "Close") text: catalog.i18nc("@action:button", "Close")
iconName: "dialog-close"
onClicked: dialog.accept() onClicked: dialog.accept()
} }

View File

@ -1,10 +1,7 @@
//Copyright (c) 2020 Ultimaker B.V. //Copyright (c) 2021 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.0 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -5,7 +5,7 @@ import QtQuick 2.9
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -131,14 +131,10 @@ Item
height: UM.Theme.getSize("action_button").height height: UM.Theme.getSize("action_button").height
hoverEnabled: true hoverEnabled: true
contentItem: Label contentItem: UM.Label
{ {
text: model.displayText text: model.displayText
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
width: contentWidth width: contentWidth
height: parent.height height: parent.height
} }

View File

@ -1,11 +1,7 @@
// Copyright (c) 2019 Ultimaker B.V. // Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.0 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -1,10 +1,8 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.0 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -1,10 +1,8 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.0 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -1,14 +1,15 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Controls 1.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.0 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
UM.PointingRectangle { UM.PointingRectangle
{
id: sliderLabelRoot id: sliderLabelRoot
// custom properties // custom properties
@ -28,47 +29,41 @@ UM.PointingRectangle {
borderColor: UM.Theme.getColor("lining") borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width borderWidth: UM.Theme.getSize("default_lining").width
Behavior on height { Behavior on height { NumberAnimation { duration: 50 } }
NumberAnimation {
duration: 50
}
}
// catch all mouse events so they're not handled by underlying 3D scene // catch all mouse events so they're not handled by underlying 3D scene
MouseArea { MouseArea
{
anchors.fill: parent anchors.fill: parent
} }
TextMetrics { TextMetrics
{
id: maxValueMetrics id: maxValueMetrics
font: valueLabel.font font: valueLabel.font
text: maximumValue + 1 // layers are 0 based, add 1 for display value text: maximumValue + 1 // layers are 0 based, add 1 for display value
} }
TextField { TextField
{
id: valueLabel id: valueLabel
anchors { anchors.centerIn: parent
verticalCenter: parent.verticalCenter
horizontalCenter: parent.horizontalCenter
alignWhenCentered: false
}
width: maxValueMetrics.width + UM.Theme.getSize("default_margin").width //width: maxValueMetrics.contentWidth + 2 * UM.Theme.getSize("default_margin").width
text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array
horizontalAlignment: TextInput.AlignHCenter horizontalAlignment: TextInput.AlignHCenter
leftPadding: UM.Theme.getSize("narrow_margin").width
rightPadding: UM.Theme.getSize("narrow_margin").width
// key bindings, work when label is currently focused (active handle in LayerSlider) // key bindings, work when label is currently focused (active handle in LayerSlider)
Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1)) Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1)) Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
color: UM.Theme.getColor("text")
style: TextFieldStyle {
textColor: UM.Theme.getColor("text")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
background: Item {} background: Item {}
} selectByMouse: true
onEditingFinished: { onEditingFinished: {
@ -84,16 +79,18 @@ UM.PointingRectangle {
} }
} }
validator: IntValidator { validator: IntValidator
{
bottom: startFrom bottom: startFrom
top: sliderLabelRoot.maximumValue + startFrom // +startFrom because maybe we want to start in a different value rather than 0 top: sliderLabelRoot.maximumValue + startFrom // +startFrom because maybe we want to start in a different value rather than 0
} }
} }
BusyIndicator
BusyIndicator { {
id: busyIndicator id: busyIndicator
anchors { anchors
{
left: parent.right left: parent.right
leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter

View File

@ -2,9 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import UM 1.4 as UM import UM 1.4 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -1,13 +1,12 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import UM 1.0 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -43,22 +42,19 @@ Cura.ExpandableComponent
headerItem: Item headerItem: Item
{ {
Label UM.Label
{ {
id: colorSchemeLabel id: colorSchemeLabel
text: catalog.i18nc("@label", "Color scheme") text: catalog.i18nc("@label", "Color scheme")
verticalAlignment: Text.AlignVCenter
height: parent.height height: parent.height
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: layerTypeCombobox.currentText text: layerTypeCombobox.currentText
verticalAlignment: Text.AlignVCenter
anchors anchors
{ {
left: colorSchemeLabel.right left: colorSchemeLabel.right
@ -68,8 +64,6 @@ Cura.ExpandableComponent
height: parent.height height: parent.height
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
} }
} }
@ -99,7 +93,8 @@ Cura.ExpandableComponent
spacing: UM.Theme.getSize("layerview_row_spacing").height spacing: UM.Theme.getSize("layerview_row_spacing").height
ListModel // matches SimulationView.py // matches SimulationView.py
ListModel
{ {
id: layerViewTypes id: layerViewTypes
} }
@ -132,18 +127,17 @@ Cura.ExpandableComponent
}) })
} }
ComboBox Cura.ComboBox
{ {
id: layerTypeCombobox id: layerTypeCombobox
textRole: "text"
valueRole: "type_id"
width: parent.width width: parent.width
implicitHeight: UM.Theme.getSize("setting_control").height
model: layerViewTypes model: layerViewTypes
visible: !UM.SimulationView.compatibilityMode visible: !UM.SimulationView.compatibilityMode
style: UM.Theme.styles.combobox
onActivated: onActivated: UM.Preferences.setValue("layerview/layer_view_type", index)
{
UM.Preferences.setValue("layerview/layer_view_type", index);
}
Component.onCompleted: Component.onCompleted:
{ {
@ -165,16 +159,13 @@ Cura.ExpandableComponent
} }
} }
Label UM.Label
{ {
id: compatibilityModeLabel id: compatibilityModeLabel
text: catalog.i18nc("@label", "Compatibility Mode") text: catalog.i18nc("@label", "Compatibility Mode")
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
visible: UM.SimulationView.compatibilityMode visible: UM.SimulationView.compatibilityMode
height: UM.Theme.getSize("layerview_row").height height: UM.Theme.getSize("layerview_row").height
width: parent.width width: parent.width
renderType: Text.NativeRendering
} }
Item // Spacer Item // Spacer
@ -187,7 +178,7 @@ Cura.ExpandableComponent
{ {
model: CuraApplication.getExtrudersModel() model: CuraApplication.getExtrudersModel()
CheckBox UM.CheckBox
{ {
id: extrudersModelCheckBox id: extrudersModelCheckBox
checked: viewSettings.extruder_opacities[index] > 0.5 || viewSettings.extruder_opacities[index] == undefined || viewSettings.extruder_opacities[index] == "" checked: viewSettings.extruder_opacities[index] > 0.5 || viewSettings.extruder_opacities[index] == undefined || viewSettings.extruder_opacities[index] == ""
@ -201,8 +192,6 @@ Cura.ExpandableComponent
UM.Preferences.setValue("layerview/extruder_opacities", viewSettings.extruder_opacities.join("|")); UM.Preferences.setValue("layerview/extruder_opacities", viewSettings.extruder_opacities.join("|"));
} }
style: UM.Theme.styles.checkbox
Rectangle Rectangle
{ {
id: swatch id: swatch
@ -215,12 +204,11 @@ Cura.ExpandableComponent
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
} }
Label UM.Label
{ {
text: model.name text: model.name
elide: Text.ElideRight elide: Text.ElideRight
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
anchors anchors
{ {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -229,7 +217,6 @@ Cura.ExpandableComponent
leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2) leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2)
rightMargin: UM.Theme.getSize("default_margin").width * 2 rightMargin: UM.Theme.getSize("default_margin").width * 2
} }
renderType: Text.NativeRendering
} }
} }
} }
@ -277,7 +264,7 @@ Cura.ExpandableComponent
} }
} }
CheckBox UM.CheckBox
{ {
id: legendModelCheckBox id: legendModelCheckBox
checked: model.initialValue checked: model.initialValue
@ -285,8 +272,6 @@ Cura.ExpandableComponent
height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
width: parent.width width: parent.width
style: UM.Theme.styles.checkbox
Rectangle Rectangle
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -299,7 +284,7 @@ Cura.ExpandableComponent
visible: viewSettings.show_legend visible: viewSettings.show_legend
} }
Label UM.Label
{ {
text: label text: label
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
@ -315,24 +300,22 @@ Cura.ExpandableComponent
} }
} }
CheckBox UM.CheckBox
{ {
checked: viewSettings.only_show_top_layers checked: viewSettings.only_show_top_layers
onClicked: UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0) onClicked: UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0)
text: catalog.i18nc("@label", "Only Show Top Layers") text: catalog.i18nc("@label", "Only Show Top Layers")
visible: UM.SimulationView.compatibilityMode visible: UM.SimulationView.compatibilityMode
style: UM.Theme.styles.checkbox
width: parent.width width: parent.width
} }
CheckBox UM.CheckBox
{ {
checked: viewSettings.top_layer_count == 5 checked: viewSettings.top_layer_count == 5
onClicked: UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1) onClicked: UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1)
text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top") text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top")
width: parent.width width: parent.width
visible: UM.SimulationView.compatibilityMode visible: UM.SimulationView.compatibilityMode
style: UM.Theme.styles.checkbox
} }
Repeater Repeater
@ -353,7 +336,7 @@ Cura.ExpandableComponent
} }
} }
Label UM.Label
{ {
text: label text: label
visible: viewSettings.show_legend visible: viewSettings.show_legend
@ -362,8 +345,6 @@ Cura.ExpandableComponent
height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
width: parent.width width: parent.width
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
Rectangle Rectangle
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -388,7 +369,7 @@ Cura.ExpandableComponent
width: parent.width width: parent.width
height: UM.Theme.getSize("layerview_row").height height: UM.Theme.getSize("layerview_row").height
Label //Minimum value. UM.Label //Minimum value.
{ {
text: text:
{ {
@ -419,12 +400,9 @@ Cura.ExpandableComponent
return catalog.i18nc("@label","min") return catalog.i18nc("@label","min")
} }
anchors.left: parent.left anchors.left: parent.left
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
} }
Label //Unit in the middle. UM.Label //Unit in the middle.
{ {
text: text:
{ {
@ -456,10 +434,9 @@ Cura.ExpandableComponent
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
} }
Label //Maximum value. UM.Label //Maximum value.
{ {
text: { text: {
if (UM.SimulationView.layerActivity && CuraApplication.platformActivity) if (UM.SimulationView.layerActivity && CuraApplication.platformActivity)
@ -490,7 +467,6 @@ Cura.ExpandableComponent
anchors.right: parent.right anchors.right: parent.right
color: UM.Theme.getColor("setting_control_text") color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
} }
} }

View File

@ -3,7 +3,6 @@
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.3
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -19,7 +18,7 @@ Button
{ {
anchors.fill: parent anchors.fill: parent
radius: 0.5 * width radius: 0.5 * width
color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled") color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_card_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled")
} }
UM.RecolorImage UM.RecolorImage

View File

@ -1,14 +1,13 @@
// Copyright (c) 2019 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.5 as Cura import Cura 1.5 as Cura
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.9
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import QtQuick.Dialogs 1.2
Cura.MachineAction Cura.MachineAction
{ {
@ -36,32 +35,27 @@ Cura.MachineAction
id: discoverUM3Action id: discoverUM3Action
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
SystemPalette { id: palette }
UM.I18nCatalog { id: catalog; name:"cura" } UM.I18nCatalog { id: catalog; name:"cura" }
Label
UM.Label
{ {
id: pageTitle id: pageTitle
width: parent.width width: parent.width
text: catalog.i18nc("@title:window", "Connect to Networked Printer") text: catalog.i18nc("@title:window", "Connect to Networked Printer")
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
font.pointSize: 18
} }
Label UM.Label
{ {
id: pageDescription id: pageDescription
width: parent.width width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.") + "\n\n" + catalog.i18nc("@label", "Select your printer from the list below:") text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.") + "\n\n" + catalog.i18nc("@label", "Select your printer from the list below:")
} }
Row Row
{ {
spacing: UM.Theme.getSize("default_lining").width spacing: UM.Theme.getSize("thin_margin").width
Button Cura.SecondaryButton
{ {
id: addButton id: addButton
text: catalog.i18nc("@action:button", "Add"); text: catalog.i18nc("@action:button", "Add");
@ -71,7 +65,7 @@ Cura.MachineAction
} }
} }
Button Cura.SecondaryButton
{ {
id: editButton id: editButton
text: catalog.i18nc("@action:button", "Edit") text: catalog.i18nc("@action:button", "Edit")
@ -82,7 +76,7 @@ Cura.MachineAction
} }
} }
Button Cura.SecondaryButton
{ {
id: removeButton id: removeButton
text: catalog.i18nc("@action:button", "Remove") text: catalog.i18nc("@action:button", "Remove")
@ -90,7 +84,7 @@ Cura.MachineAction
onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress) onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress)
} }
Button Cura.SecondaryButton
{ {
id: rediscoverButton id: rediscoverButton
text: catalog.i18nc("@action:button", "Refresh") text: catalog.i18nc("@action:button", "Refresh")
@ -109,25 +103,17 @@ Cura.MachineAction
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
ScrollView
{
id: objectListContainer
frameVisible: true
width: parent.width
height: base.height - contentRow.y - discoveryTip.height
Rectangle
{
parent: viewport
anchors.fill: parent
color: palette.light
}
ListView ListView
{ {
id: listview id: listview
model: manager.foundDevices
width: parent.width width: parent.width
height: base.height - contentRow.y - discoveryTip.height
ScrollBar.vertical: UM.ScrollBar {}
clip: true
model: manager.foundDevices
currentIndex: -1 currentIndex: -1
onCurrentIndexChanged: onCurrentIndexChanged:
{ {
@ -136,21 +122,18 @@ Cura.MachineAction
base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true"; base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true";
} }
Component.onCompleted: manager.startDiscovery() Component.onCompleted: manager.startDiscovery()
delegate: Rectangle
{ delegate: UM.Label
height: childrenRect.height
color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase
width: parent.width
Label
{ {
id: printNameLabel
width: listview.width
height: contentHeight
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right anchors.right: parent.right
text: listview.model[index].name text: listview.model[index].name
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text
elide: Text.ElideRight elide: Text.ElideRight
renderType: Text.NativeRendering
}
MouseArea MouseArea
{ {
@ -163,16 +146,18 @@ Cura.MachineAction
} }
} }
} }
background: Rectangle
{
color: parent.ListView.isCurrentItem ? UM.Theme.getColor("background_3") : "transparent"
} }
} }
} }
Label UM.Label
{ {
id: discoveryTip id: discoveryTip
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/cura/troubleshooting/network?utm_source=cura&utm_medium=software&utm_campaign=manage-network-printer"); text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/cura/troubleshooting/network?utm_source=cura&utm_medium=software&utm_campaign=manage-network-printer");
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
@ -183,32 +168,26 @@ Cura.MachineAction
width: Math.round(parent.width * 0.5) width: Math.round(parent.width * 0.5)
visible: base.selectedDevice ? true : false visible: base.selectedDevice ? true : false
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Label UM.Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap
text: base.selectedDevice ? base.selectedDevice.name : "" text: base.selectedDevice ? base.selectedDevice.name : ""
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
elide: Text.ElideRight elide: Text.ElideRight
renderType: Text.NativeRendering
} }
Grid GridLayout
{ {
visible: base.completeProperties visible: base.completeProperties
width: parent.width width: parent.width
columns: 2 columns: 2
Label UM.Label
{ {
width: Math.round(parent.width * 0.5) Layout.fillWidth: true
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Type") text: catalog.i18nc("@label", "Type")
} }
Label UM.Label
{ {
width: Math.round(parent.width * 0.5) Layout.fillWidth: true
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: text:
{ {
if (base.selectedDevice) { if (base.selectedDevice) {
@ -217,41 +196,31 @@ Cura.MachineAction
return "" return ""
} }
} }
Label UM.Label
{ {
width: Math.round(parent.width * 0.5) Layout.fillWidth: true
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Firmware version") text: catalog.i18nc("@label", "Firmware version")
} }
Label UM.Label
{ {
width: Math.round(parent.width * 0.5) Layout.fillWidth: true
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: base.selectedDevice ? base.selectedDevice.firmwareVersion : "" text: base.selectedDevice ? base.selectedDevice.firmwareVersion : ""
} }
Label UM.Label
{ {
width: Math.round(parent.width * 0.5) Layout.fillWidth: true
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Address") text: catalog.i18nc("@label", "Address")
} }
Label UM.Label
{ {
width: Math.round(parent.width * 0.5) Layout.fillWidth: true
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: base.selectedDevice ? base.selectedDevice.ipAddress : "" text: base.selectedDevice ? base.selectedDevice.ipAddress : ""
} }
} }
Label UM.Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text:{ text:{
// The property cluster size does not exist for older UM3 devices. // The property cluster size does not exist for older UM3 devices.
if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1) if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1)
@ -269,16 +238,14 @@ Cura.MachineAction
} }
} }
Label UM.Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering
visible: base.selectedDevice != null && !base.completeProperties visible: base.selectedDevice != null && !base.completeProperties
text: catalog.i18nc("@label", "The printer at this address has not yet responded." ) text: catalog.i18nc("@label", "The printer at this address has not yet responded." )
} }
Button Cura.SecondaryButton
{ {
text: catalog.i18nc("@action:button", "Connect") text: catalog.i18nc("@action:button", "Connect")
enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false
@ -288,18 +255,15 @@ Cura.MachineAction
} }
} }
MessageDialog Cura.MessageDialog
{ {
id: invalidIPAddressMessageDialog id: invalidIPAddressMessageDialog
x: parent ? (parent.x + (parent.width) / 2) : 0
y: parent ? (parent.y + (parent.height) / 2) : 0
title: catalog.i18nc("@title:window", "Invalid IP address") title: catalog.i18nc("@title:window", "Invalid IP address")
text: catalog.i18nc("@text", "Please enter a valid IP address.") text: catalog.i18nc("@text", "Please enter a valid IP address.")
icon: StandardIcon.Warning standardButtons: Dialog.Ok
standardButtons: StandardButton.Ok
} }
UM.Dialog Cura.MessageDialog
{ {
id: manualPrinterDialog id: manualPrinterDialog
property string printerKey property string printerKey
@ -307,17 +271,19 @@ Cura.MachineAction
title: catalog.i18nc("@title:window", "Printer Address") title: catalog.i18nc("@title:window", "Printer Address")
minimumWidth: 400 * screenScaleFactor width: UM.Theme.getSize("small_popup_dialog").width
minimumHeight: 130 * screenScaleFactor height: UM.Theme.getSize("small_popup_dialog").height
width: minimumWidth
height: minimumHeight anchors.centerIn: Overlay.overlay
standardButtons: Dialog.Yes | Dialog.No
signal showDialog(string key, string address) signal showDialog(string key, string address)
onShowDialog: onShowDialog:
{ {
printerKey = key; printerKey = key;
addressText = address; addressText = address;
manualPrinterDialog.show(); manualPrinterDialog.open();
addressField.selectAll(); addressField.selectAll();
addressField.focus = true; addressField.focus = true;
} }
@ -326,46 +292,30 @@ Cura.MachineAction
anchors.fill: parent anchors.fill: parent
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Label UM.Label
{ {
text: catalog.i18nc("@label", "Enter the IP address of your printer on the network.") text: catalog.i18nc("@label", "Enter the IP address of your printer on the network.")
width: parent.width
wrapMode: Text.WordWrap
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
TextField Cura.TextField
{ {
id: addressField id: addressField
width: parent.width width: parent.width
validator: RegExpValidator validator: RegExpValidator { regExp: /[a-zA-Z0-9\.\-\_]*/ }
{
regExp: /[a-zA-Z0-9\.\-\_]*/
}
onAccepted: btnOk.clicked()
} }
} }
rightButtons: [ onAccepted:
Button {
text: catalog.i18nc("@action:button","Cancel")
onClicked:
{
manualPrinterDialog.reject()
manualPrinterDialog.hide()
}
},
Button {
id: btnOk
text: catalog.i18nc("@action:button", "OK")
onClicked:
{ {
// Validate the input first // Validate the input first
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText)) if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
{ {
invalidIPAddressMessageDialog.open() // prefent closing of element, as we want to keep the dialog active after a wrongly entered IP adress
return manualPrinterDialog.open()
// show invalid ip warning
invalidIPAddressMessageDialog.open();
return;
} }
// if the entered IP address has already been discovered, switch the current item to that item // if the entered IP address has already been discovered, switch the current item to that item
@ -375,18 +325,12 @@ Cura.MachineAction
var device = manager.foundDevices[i] var device = manager.foundDevices[i]
if (device.address == manualPrinterDialog.addressText) if (device.address == manualPrinterDialog.addressText)
{ {
currentItemIndex = i currentItemIndex = i;
manualPrinterDialog.hide() return;
return
} }
} }
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText) manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText);
manualPrinterDialog.hide() }
}
enabled: manualPrinterDialog.addressText.trim() != ""
isDefault: true
}
]
} }
} }

View File

@ -3,8 +3,6 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.1
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import UM 1.3 as UM import UM 1.3 as UM

View File

@ -3,7 +3,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.3 as UM import UM 1.5 as UM
/** /**
* This component comprises a buildplate icon and the buildplate name. It is * This component comprises a buildplate icon and the buildplate name. It is
@ -57,19 +57,15 @@ Item
} }
} }
Label UM.Label
{ {
id: buildplateLabel id: buildplateLabel
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default") // 12pt, regular
text: buildplate ? buildplate : "" text: buildplate ? buildplate : ""
visible: text !== "" visible: text !== ""
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme! height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
} }

View File

@ -2,10 +2,9 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2 import UM 1.5 as UM
import UM 1.3 as UM
UM.Dialog UM.Dialog
{ {
@ -63,7 +62,7 @@ UM.Dialog
} }
] ]
Label UM.Label
{ {
anchors anchors
{ {
@ -72,7 +71,6 @@ UM.Dialog
bottomMargin: 56 * screenScaleFactor // TODO: Theme! bottomMargin: 56 * screenScaleFactor // TODO: Theme!
} }
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
text: text:
{ {
if (!printer || !printer.activePrintJob) if (!printer || !printer.activePrintJob)

View File

@ -1,10 +1,10 @@
// Copyright (c) 2019 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 2.0 import QtQuick.Controls 2.15
import QtQuick.Dialogs 1.1 import UM 1.5 as UM
import UM 1.3 as UM import Cura 1.6 as Cura
/** /**
* A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context * A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context
@ -134,32 +134,29 @@ Item
} }
} }
MessageDialog { Cura.MessageDialog
{
id: sendToTopConfirmationDialog id: sendToTopConfirmationDialog
Component.onCompleted: visible = false onAccepted: OutputDevice.sendJobToTop(printJob.key)
icon: StandardIcon.Warning standardButtons: Dialog.Yes | Dialog.No
onYes: OutputDevice.sendJobToTop(printJob.key)
standardButtons: StandardButton.Yes | StandardButton.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to move %1 to the top of the queue?").arg(printJob.name) : "" text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to move %1 to the top of the queue?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Move print job to top") title: catalog.i18nc("@window:title", "Move print job to top")
} }
MessageDialog { Cura.MessageDialog
{
id: deleteConfirmationDialog id: deleteConfirmationDialog
Component.onCompleted: visible = false onAccepted: OutputDevice.deleteJobFromQueue(printJob.key)
icon: StandardIcon.Warning standardButtons: Dialog.Yes | Dialog.No
onYes: OutputDevice.deleteJobFromQueue(printJob.key)
standardButtons: StandardButton.Yes | StandardButton.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name) : "" text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Delete print job") title: catalog.i18nc("@window:title", "Delete print job")
} }
MessageDialog { Cura.MessageDialog
{
id: abortConfirmationDialog id: abortConfirmationDialog
Component.onCompleted: visible = false onAccepted: printJob.setState("abort")
icon: StandardIcon.Warning standardButtons: Dialog.Yes | Dialog.No
onYes: printJob.setState("abort")
standardButtons: StandardButton.Yes | StandardButton.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(printJob.name) : "" text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Abort print") title: catalog.i18nc("@window:title", "Abort print")
} }

View File

@ -3,7 +3,7 @@
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Button Button
@ -17,13 +17,12 @@ Button
radius: Math.round(0.5 * width) radius: Math.round(0.5 * width)
width: base.width width: base.width
} }
contentItem: Label { contentItem: UM.Label
{
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
font.pixelSize: 32 * screenScaleFactor font.pixelSize: 32 * screenScaleFactor
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: base.text text: base.text
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering;
} }
height: width height: width
hoverEnabled: enabled hoverEnabled: enabled

View File

@ -3,7 +3,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.3 as UM import UM 1.5 as UM
/** /**
* This component is a sort of "super icon" which includes a colored SVG image * This component is a sort of "super icon" which includes a colored SVG image
@ -35,18 +35,16 @@ Item
width: size width: size
} }
Label UM.Label
{ {
id: positionLabel id: positionLabel
anchors.centerIn: icon anchors.centerIn: icon
font: UM.Theme.getFont("small") font: UM.Theme.getFont("small")
color: UM.Theme.getColor("text")
height: Math.round(size / 2) height: Math.round(size / 2)
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: position + 1 text: position + 1
verticalAlignment: Text.AlignVCenter
width: Math.round(size / 2) width: Math.round(size / 2)
visible: position >= 0 visible: position >= 0
renderType: Text.NativeRendering
} }
} }

View File

@ -2,7 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
/** /**
@ -55,10 +55,9 @@ Item
visible: !printJob visible: !printJob
radius: 2 * screenScaleFactor // TODO: Theme! radius: 2 * screenScaleFactor // TODO: Theme!
} }
Label UM.Label
{ {
text: printJob && printJob.name ? printJob.name : "" text: printJob && printJob.name ? printJob.name : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
visible: printJob visible: printJob
@ -66,8 +65,6 @@ Item
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
width: parent.width width: parent.width
height: parent.height height: parent.height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
@ -86,18 +83,15 @@ Item
radius: 2 * screenScaleFactor // TODO: Theme! radius: 2 * screenScaleFactor // TODO: Theme!
} }
Label UM.Label
{ {
text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : "" text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
visible: printJob visible: printJob
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
height: Math.round(18 * screenScaleFactor) // TODO: Theme! height: Math.round(18 * screenScaleFactor) // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
@ -116,11 +110,10 @@ Item
radius: 2 * screenScaleFactor // TODO: Theme! radius: 2 * screenScaleFactor // TODO: Theme!
} }
Label UM.Label
{ {
id: printerAssignmentLabel id: printerAssignmentLabel
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
text: { text: {
@ -143,8 +136,6 @@ Item
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
height: parent.height height: parent.height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
Row Row
@ -186,17 +177,15 @@ Item
height: Math.round(72 * screenScaleFactor) // TODO: Theme! height: Math.round(72 * screenScaleFactor) // TODO: Theme!
} }
Label { UM.Label
{
text: printJob && printJob.owner ? printJob.owner : "" text: printJob && printJob.owner ? printJob.owner : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
anchors.top: printerConfiguration.top anchors.top: printerConfiguration.top
// FIXED-LINE-HEIGHT: // FIXED-LINE-HEIGHT:
height: Math.round(18 * screenScaleFactor) // TODO: Theme! height: Math.round(18 * screenScaleFactor) // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
} }

View File

@ -2,9 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls.Styles 1.3 import UM 1.5 as UM
import QtQuick.Controls 1.4
import UM 1.3 as UM
/** /**
* NOTE: For most labels, a fixed height with vertical alignment is used to make * NOTE: For most labels, a fixed height with vertical alignment is used to make
@ -20,7 +18,7 @@ Item
property var printJob: null property var printJob: null
width: childrenRect.width width: childrenRect.width
height: UM.Theme.getSize("monitor_text_line").height height: percentLabel.height
UM.ProgressBar UM.ProgressBar
{ {
@ -34,36 +32,28 @@ Item
width: UM.Theme.getSize("monitor_progress_bar").width width: UM.Theme.getSize("monitor_progress_bar").width
} }
Label UM.Label
{ {
id: percentLabel id: percentLabel
anchors anchors
{ {
left: progressBar.right left: progressBar.right
leftMargin: UM.Theme.getSize("monitor_margin").width leftMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter
} }
text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%"
color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
width: contentWidth width: contentWidth
font: UM.Theme.getFont("default") // 12pt, regular wrapMode: Text.NoWrap
// FIXED-LINE-HEIGHT:
height: UM.Theme.getSize("monitor_text_line").height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
id: statusLabel id: statusLabel
anchors anchors
{ {
left: percentLabel.right left: percentLabel.right
leftMargin: UM.Theme.getSize("monitor_margin").width leftMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter
} }
color: UM.Theme.getColor("text") wrapMode: Text.NoWrap
font: UM.Theme.getFont("default")
text: text:
{ {
if (!printJob) if (!printJob)
@ -117,10 +107,5 @@ Item
} }
} }
width: contentWidth width: contentWidth
// FIXED-LINE-HEIGHT:
height: UM.Theme.getSize("monitor_text_line").height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }

View File

@ -3,8 +3,7 @@
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.1 import UM 1.5 as UM
import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
/** /**
@ -64,7 +63,7 @@ Item
leftMargin: 36 * screenScaleFactor // TODO: Theme! leftMargin: 36 * screenScaleFactor // TODO: Theme!
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
spacing: 18 * screenScaleFactor // TODO: Theme! spacing: UM.Theme.getSize("default_margin").width
Rectangle Rectangle
{ {
@ -96,23 +95,18 @@ Item
{ {
id: printerNameLabel id: printerNameLabel
color: printer ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading") color: printer ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
height: 18 * screenScaleFactor // TODO: Theme! height: UM.Theme.getSize("default_margin").width
width: parent.width width: parent.width
radius: 2 * screenScaleFactor // TODO: Theme! radius: UM.Theme.getSize("default_radius").width
Label UM.Label
{ {
text: printer && printer.name ? printer.name : "" text: printer && printer.name ? printer.name : ""
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("large") // 16pt, bold font: UM.Theme.getFont("large") // 16pt, bold
width: parent.width width: parent.width
visible: printer visible: printer
// FIXED-LINE-HEIGHT:
height: parent.height height: parent.height
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
@ -120,7 +114,7 @@ Item
{ {
color: UM.Theme.getColor("monitor_skeleton_loading") color: UM.Theme.getColor("monitor_skeleton_loading")
height: 18 * screenScaleFactor // TODO: Theme! height: 18 * screenScaleFactor // TODO: Theme!
radius: 2 * screenScaleFactor // TODO: Theme! radius: UM.Theme.getSize("default_radius").width
visible: !printer visible: !printer
width: 48 * screenScaleFactor // TODO: Theme! width: 48 * screenScaleFactor // TODO: Theme!
} }
@ -138,21 +132,20 @@ Item
Item Item
{ {
id: managePrinterLink id: managePrinterLink
anchors { anchors
{
top: printerFamilyPill.bottom top: printerFamilyPill.bottom
topMargin: UM.Theme.getSize("narrow_margin").height topMargin: UM.Theme.getSize("narrow_margin").height
} }
height: 18 * screenScaleFactor // TODO: Theme! height: 18 * screenScaleFactor // TODO: Theme!
width: childrenRect.width width: childrenRect.width
Label UM.Label
{ {
id: managePrinterText id: managePrinterText
anchors.verticalCenter: managePrinterLink.verticalCenter anchors.verticalCenter: managePrinterLink.verticalCenter
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("default")
text: catalog.i18nc("@label link to Connect and Cloud interfaces", "Manage printer") text: catalog.i18nc("@label link to Connect and Cloud interfaces", "Manage printer")
renderType: Text.NativeRendering
} }
UM.RecolorImage UM.RecolorImage
{ {
@ -165,22 +158,16 @@ Item
} }
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
source: UM.Theme.getIcon("LinkExternal") source: UM.Theme.getIcon("LinkExternal")
width: 12 * screenScaleFactor width: UM.Theme.getSize("icon").width
height: 12 * screenScaleFactor height: UM.Theme.getSize("icon").height
} }
} }
MouseArea MouseArea
{ {
anchors.fill: managePrinterLink anchors.fill: managePrinterLink
onClicked: OutputDevice.openPrinterControlPanel() onClicked: OutputDevice.openPrinterControlPanel()
onEntered: onEntered: manageQueueText.font.underline = true
{ onExited: manageQueueText.font.underline = false
manageQueueText.font.underline = true
}
onExited:
{
manageQueueText.font.underline = false
}
} }
} }
@ -332,9 +319,9 @@ Item
leftMargin: 36 * screenScaleFactor // TODO: Theme! leftMargin: 36 * screenScaleFactor // TODO: Theme!
} }
height: childrenRect.height height: childrenRect.height
spacing: 18 * screenScaleFactor // TODO: Theme! spacing: UM.Theme.getSize("default_margin").width
Label UM.Label
{ {
id: printerStatus id: printerStatus
anchors anchors
@ -371,7 +358,6 @@ Item
return "" return ""
} }
visible: text !== "" visible: text !== ""
renderType: Text.NativeRendering
} }
Item Item
@ -401,22 +387,18 @@ Item
height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme! height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme!
visible: printer && printer.activePrintJob && !printerStatus.visible visible: printer && printer.activePrintJob && !printerStatus.visible
Label UM.Label
{ {
id: printerJobNameLabel id: printerJobNameLabel
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.NoWrap
font: UM.Theme.getFont("large") // 16pt, bold font: UM.Theme.getFont("large") // 16pt, bold
text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled") text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled")
width: parent.width width: parent.width
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
id: printerJobOwnerLabel id: printerJobOwnerLabel
anchors anchors
@ -427,14 +409,8 @@ Item
} }
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled") color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default") // 12pt, regular
text: printer && printer.activePrintJob ? printer.activePrintJob.owner : catalog.i18nc("@label", "Anonymous") text: printer && printer.activePrintJob ? printer.activePrintJob.owner : catalog.i18nc("@label", "Anonymous")
width: parent.width width: parent.width
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
@ -448,59 +424,27 @@ Item
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length === 0 && !printerStatus.visible visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length === 0 && !printerStatus.visible
} }
Label UM.Label
{ {
anchors anchors
{ {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
font: UM.Theme.getFont("default")
text: catalog.i18nc("@label:status", "Requires configuration changes") text: catalog.i18nc("@label:status", "Requires configuration changes")
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
color: UM.Theme.getColor("text")
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
Button Cura.SecondaryButton
{ {
id: detailsButton id: detailsButton
anchors anchors
{ {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
right: parent.right right: parent.right
rightMargin: 18 * screenScaleFactor // TODO: Theme! rightMargin: UM.Theme.getSize("default_margin").width
} }
background: Rectangle text: catalog.i18nc("@action:button", "Details")
{
color: UM.Theme.getColor("monitor_secondary_button_shadow")
radius: 2 * screenScaleFactor // Todo: Theme!
Rectangle
{
anchors.fill: parent
anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme!
color: detailsButton.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : UM.Theme.getColor("monitor_secondary_button")
radius: 2 * screenScaleFactor // Todo: Theme!
}
}
contentItem: Label
{
anchors.fill: parent
anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme!
color: UM.Theme.getColor("monitor_secondary_button_text")
font: UM.Theme.getFont("medium") // 14pt, regular
text: catalog.i18nc("@action:button", "Details");
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
height: 18 * screenScaleFactor // TODO: Theme!
renderType: Text.NativeRendering
}
implicitHeight: 32 * screenScaleFactor // TODO: Theme!
implicitWidth: 96 * screenScaleFactor // TODO: Theme!
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
onClicked: base.enabled ? overrideConfirmationDialog.open() : {} onClicked: base.enabled ? overrideConfirmationDialog.open() : {}
enabled: OutputDevice.supportsPrintJobActions enabled: OutputDevice.supportsPrintJobActions

View File

@ -2,8 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.4 import UM 1.5 as UM
import UM 1.2 as UM
/** /**
* A MonitorPrinterPill is a blue-colored tag indicating which printers a print * A MonitorPrinterPill is a blue-colored tag indicating which printers a print
@ -17,20 +16,19 @@ Item
implicitHeight: 18 * screenScaleFactor // TODO: Theme! implicitHeight: 18 * screenScaleFactor // TODO: Theme!
implicitWidth: Math.max(printerNameLabel.contentWidth + 12 * screenScaleFactor, 36 * screenScaleFactor) // TODO: Theme! implicitWidth: Math.max(printerNameLabel.contentWidth + 12 * screenScaleFactor, 36 * screenScaleFactor) // TODO: Theme!
Rectangle { Rectangle
{
id: background id: background
anchors.fill: parent anchors.fill: parent
color: printerNameLabel.visible ? UM.Theme.getColor("monitor_printer_family_tag") : UM.Theme.getColor("monitor_skeleton_loading") color: printerNameLabel.visible ? UM.Theme.getColor("monitor_printer_family_tag") : UM.Theme.getColor("monitor_skeleton_loading")
radius: 2 * screenScaleFactor // TODO: Theme! radius: 2 * screenScaleFactor // TODO: Theme!
} }
Label { UM.Label
{
id: printerNameLabel id: printerNameLabel
anchors.centerIn: parent anchors.centerIn: parent
color: UM.Theme.getColor("text")
text: monitorPrinterPill.text text: monitorPrinterPill.text
font.pointSize: 10 // TODO: Theme!
visible: monitorPrinterPill.text !== "" visible: monitorPrinterPill.text !== ""
renderType: Text.NativeRendering
} }
} }

View File

@ -1,10 +1,9 @@
// Copyright (c) 2019 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 2.15
import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM
import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
/** /**
@ -18,18 +17,16 @@ Item
// they might not need to though. // they might not need to though.
property bool cloudConnection: Cura.MachineManager.activeMachineIsUsingCloudConnection property bool cloudConnection: Cura.MachineManager.activeMachineIsUsingCloudConnection
Label UM.Label
{ {
id: queuedLabel id: queuedLabel
anchors anchors
{ {
left: queuedPrintJobs.left left: printJobList.left
top: parent.top top: parent.top
} }
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("large") font: UM.Theme.getFont("large")
text: catalog.i18nc("@label", "Queued") text: catalog.i18nc("@label", "Queued")
renderType: Text.NativeRendering
} }
Item Item
@ -37,7 +34,7 @@ Item
id: manageQueueLabel id: manageQueueLabel
anchors anchors
{ {
right: queuedPrintJobs.right right: printJobList.right
verticalCenter: queuedLabel.verticalCenter verticalCenter: queuedLabel.verticalCenter
} }
height: 18 * screenScaleFactor // TODO: Theme! height: 18 * screenScaleFactor // TODO: Theme!
@ -52,7 +49,7 @@ Item
width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
} }
Label UM.Label
{ {
id: manageQueueText id: manageQueueText
anchors anchors
@ -64,7 +61,6 @@ Item
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
text: catalog.i18nc("@label link to connect manager", "Manage in browser") text: catalog.i18nc("@label link to connect manager", "Manage in browser")
renderType: Text.NativeRendering
} }
} }
@ -72,14 +68,9 @@ Item
{ {
anchors.fill: manageQueueLabel anchors.fill: manageQueueLabel
onClicked: OutputDevice.openPrintJobControlPanel() onClicked: OutputDevice.openPrintJobControlPanel()
onEntered: onEntered: manageQueueText.font.underline = true
{
manageQueueText.font.underline = true onExited: manageQueueText.font.underline = false
}
onExited:
{
manageQueueText.font.underline = false
}
} }
Row Row
@ -87,84 +78,75 @@ Item
id: printJobQueueHeadings id: printJobQueueHeadings
anchors anchors
{ {
left: queuedPrintJobs.left left: printJobList.left
leftMargin: UM.Theme.getSize("narrow_margin").width leftMargin: UM.Theme.getSize("narrow_margin").width
top: queuedLabel.bottom top: queuedLabel.bottom
topMargin: 24 * screenScaleFactor // TODO: Theme! topMargin: 24 * screenScaleFactor // TODO: Theme!
} }
spacing: 18 * screenScaleFactor // TODO: Theme! spacing: 18 * screenScaleFactor // TODO: Theme!
Label UM.Label
{ {
text: catalog.i18nc("@label", "There are no print jobs in the queue. Slice and send a job to add one.") text: catalog.i18nc("@label", "There are no print jobs in the queue. Slice and send a job to add one.")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
renderType: Text.NativeRendering
visible: printJobList.count === 0 visible: printJobList.count === 0
} }
Label UM.Label
{ {
text: catalog.i18nc("@label", "Print jobs") text: catalog.i18nc("@label", "Print jobs")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 284 * screenScaleFactor // TODO: Theme! (Should match column size) width: 284 * screenScaleFactor // TODO: Theme! (Should match column size)
renderType: Text.NativeRendering
visible: printJobList.count > 0 visible: printJobList.count > 0
} }
Label UM.Label
{ {
text: catalog.i18nc("@label", "Total print time") text: catalog.i18nc("@label", "Total print time")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("monitor_column").width width: UM.Theme.getSize("monitor_column").width
renderType: Text.NativeRendering
visible: printJobList.count > 0 visible: printJobList.count > 0
} }
Label UM.Label
{ {
text: catalog.i18nc("@label", "Waiting for") text: catalog.i18nc("@label", "Waiting for")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") // 14pt, regular font: UM.Theme.getFont("medium") // 14pt, regular
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("monitor_column").width width: UM.Theme.getSize("monitor_column").width
renderType: Text.NativeRendering
visible: printJobList.count > 0 visible: printJobList.count > 0
} }
} }
ScrollView ListView
{ {
id: queuedPrintJobs id: printJobList
anchors anchors
{ {
bottom: parent.bottom bottom: parent.bottom
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
top: printJobQueueHeadings.bottom top: printJobQueueHeadings.bottom
topMargin: 12 * screenScaleFactor // TODO: Theme! topMargin: UM.Theme.getSize("default_margin").width
} }
style: UM.Theme.styles.scrollview
width: parent.width width: parent.width
ListView ScrollBar.vertical: UM.ScrollBar
{ {
id: printJobList id: printJobScrollBar
anchors.fill: parent }
spacing: UM.Theme.getSize("narrow_margin").width
clip: true
delegate: MonitorPrintJobCard delegate: MonitorPrintJobCard
{ {
anchors anchors
{ {
left: parent.left left: parent.left
right: parent.right right: parent.right
rightMargin: printJobScrollBar.width
} }
printJob: modelData printJob: modelData
} }
@ -176,7 +158,5 @@ Item
} }
return [null, null] return [null, null]
} }
spacing: 6 // TODO: Theme!
}
} }
} }

View File

@ -2,8 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -1,24 +1,24 @@
// Copyright (c) 2019 Ultimaker B.V. // Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM
import UM 1.3 as UM
Button { Button
background: Rectangle { {
opacity: parent.down || parent.hovered ? 1 : 0; background: Rectangle
{
opacity: parent.down || parent.hovered ? 1 : 0
color: UM.Theme.getColor("monitor_context_menu_hover") color: UM.Theme.getColor("monitor_context_menu_hover")
} }
contentItem: Label { contentItem: UM.Label
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled"); {
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
text: parent.text text: parent.text
horizontalAlignment: Text.AlignLeft; horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter;
renderType: Text.NativeRendering;
} }
height: visible ? 39 * screenScaleFactor : 0; // TODO: Theme! height: visible ? 39 * screenScaleFactor : 0 // TODO: Theme!
hoverEnabled: true; hoverEnabled: true
width: parent.width; width: parent.width
} }

View File

@ -2,8 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.15
import QtQuick.Controls 2.15 as NewControls
import UM 1.1 as UM import UM 1.1 as UM
@ -84,7 +83,7 @@ UM.Dialog {
renderType: Text.NativeRendering; renderType: Text.NativeRendering;
} }
NewControls.ComboBox { ComboBox {
id: printerComboBox; id: printerComboBox;
currentIndex: 0; currentIndex: 0;
Behavior on height { NumberAnimation { duration: 100 } } Behavior on height { NumberAnimation { duration: 100 } }

View File

@ -2,8 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -3,7 +3,6 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import UM 1.2 as UM import UM 1.2 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura

View File

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
Item Item
@ -46,15 +46,12 @@ Item
} }
} }
contentItem: Label contentItem: UM.Label
{ {
id: label id: label
text: signInButton.text text: signInButton.text
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("primary_text") color: UM.Theme.getColor("primary_text")
width: contentWidth width: contentWidth
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
} }
} }
@ -113,7 +110,7 @@ Item
} }
} }
Label UM.Label
{ {
id: initialLabel id: initialLabel
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -121,9 +118,7 @@ Item
text: accountWidget.text text: accountWidget.text
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("primary_text") color: UM.Theme.getColor("primary_text")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
renderType: Text.NativeRendering
} }
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
Column Column
@ -12,14 +12,12 @@ Column
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
padding: UM.Theme.getSize("default_margin").width padding: UM.Theme.getSize("default_margin").width
Label UM.Label
{ {
id: title id: title
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
renderType: Text.NativeRendering
text: catalog.i18nc("@label", "Sign in to the Ultimaker platform") text: catalog.i18nc("@label", "Sign in to the Ultimaker platform")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
} }
Image Image
@ -33,16 +31,14 @@ Column
verticalAlignment: Image.AlignVCenter verticalAlignment: Image.AlignVCenter
} }
Label UM.Label
{ {
id: generalInformationPoints id: generalInformationPoints
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
renderType: Text.NativeRendering
text: catalog.i18nc("@text", "- Add material profiles and plug-ins from the Marketplace\n- Back-up and sync your material profiles and plug-ins\n- Share ideas and get help from 48,000+ users in the Ultimaker community") text: catalog.i18nc("@text", "- Add material profiles and plug-ins from the Marketplace\n- Back-up and sync your material profiles and plug-ins\n- Share ideas and get help from 48,000+ users in the Ultimaker community")
lineHeight: 1.4 lineHeight: 1.4
font: UM.Theme.getFont("default") wrapMode: Text.NoWrap
color: UM.Theme.getColor("text")
} }
Cura.PrimaryButton Cura.PrimaryButton

View File

@ -1,7 +1,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
Row // Sync state icon + message Row // Sync state icon + message
@ -77,28 +77,26 @@ Row // Sync state icon + message
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
id: stateLabel id: stateLabel
// text is determined by State // text is determined by State
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: contentWidth + UM.Theme.getSize("default_margin").height anchors.rightMargin: UM.Theme.getSize("default_margin").width
wrapMode: Text.NoWrap
height: contentHeight height: contentHeight
verticalAlignment: Text.AlignVCenter
visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled
} }
Label UM.Label
{ {
id: updatePackagesButton id: updatePackagesButton
text: catalog.i18nc("@button", "Install pending updates") text: catalog.i18nc("@button", "Install pending updates")
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
height: contentHeight height: contentHeight
wrapMode: Text.NoWrap
width: contentWidth + UM.Theme.getSize("default_margin").height width: contentWidth + UM.Theme.getSize("default_margin").height
visible: Cura.API.account.updatePackagesEnabled visible: Cura.API.account.updatePackagesEnabled
@ -112,14 +110,13 @@ Row // Sync state icon + message
} }
} }
Label UM.Label
{ {
id: accountSyncButton id: accountSyncButton
text: catalog.i18nc("@button", "Check for account updates") text: catalog.i18nc("@button", "Check for account updates")
color: UM.Theme.getColor("text_link") color: UM.Theme.getColor("text_link")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering wrapMode: Text.NoWrap
verticalAlignment: Text.AlignVCenter
height: contentHeight height: contentHeight
width: contentWidth + UM.Theme.getSize("default_margin").height width: contentWidth + UM.Theme.getSize("default_margin").height
visible: Cura.API.account.manualSyncEnabled visible: Cura.API.account.manualSyncEnabled

View File

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
Column Column
@ -41,16 +41,13 @@ Column
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("action_button_disabled") color: UM.Theme.getColor("action_button_disabled")
visible: !avatar.hasAvatar visible: !avatar.hasAvatar
Label UM.Label
{ {
id: initialLabel id: initialLabel
anchors.centerIn: parent anchors.centerIn: parent
text: profile["username"].charAt(0).toUpperCase() text: profile["username"].charAt(0).toUpperCase()
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
renderType: Text.NativeRendering
} }
} }
@ -62,25 +59,22 @@ Column
spacing: UM.Theme.getSize("narrow_margin").height spacing: UM.Theme.getSize("narrow_margin").height
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
Label
UM.Label
{ {
id: username id: username
renderType: Text.NativeRendering
text: profile.username text: profile.username
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
} }
SyncState SyncState
{ {
id: syncRow id: syncRow
} }
Label UM.Label
{ {
id: lastSyncLabel id: lastSyncLabel
renderType: Text.NativeRendering
text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime) text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime)
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
} }
} }

View File

@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0 // For the dropshadow import QtGraphicalEffects 1.0 // For the dropshadow
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -128,18 +128,16 @@ Button
elideWidth: buttonText.width elideWidth: buttonText.width
} }
Label UM.Label
{ {
id: buttonText id: buttonText
text: button.text text: button.text
color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
visible: text != "" visible: text != ""
renderType: Text.NativeRendering
height: parent.height height: parent.height
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight elide: Text.ElideRight
Binding Binding

View File

@ -1,10 +1,9 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4 as Controls1
import UM 1.4 as UM import UM 1.4 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -122,7 +121,9 @@ Column
tooltip: catalog.i18nc("@label", "Start the slicing process") tooltip: catalog.i18nc("@label", "Start the slicing process")
enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart
visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error
onClicked: sliceOrStopSlicing() onClicked: {
sliceOrStopSlicing()
}
} }
Cura.SecondaryButton Cura.SecondaryButton
@ -136,7 +137,9 @@ Column
text: catalog.i18nc("@button", "Cancel") text: catalog.i18nc("@button", "Cancel")
enabled: sliceButton.enabled enabled: sliceButton.enabled
visible: !sliceButton.visible visible: !sliceButton.visible
onClicked: sliceOrStopSlicing() onClicked: {
sliceOrStopSlicing()
}
} }
} }
@ -165,7 +168,7 @@ Column
} }
// Shortcut for "slice/stop" // Shortcut for "slice/stop"
Controls1.Action Action
{ {
shortcut: "Ctrl+P" shortcut: "Ctrl+P"
onTriggered: onTriggered:

View File

@ -4,75 +4,73 @@
pragma Singleton pragma Singleton
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.1 import QtQuick.Controls 2.4
import QtQuick.Controls 2.3 as Controls2
import UM 1.1 as UM import UM 1.1 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
{ {
property alias newProject: newProjectAction; property alias newProject: newProjectAction
property alias open: openAction; property alias open: openAction
property alias quit: quitAction; property alias quit: quitAction
property alias undo: undoAction; property alias undo: undoAction
property alias redo: redoAction; property alias redo: redoAction
property alias view3DCamera: view3DCameraAction; property alias view3DCamera: view3DCameraAction
property alias viewFrontCamera: viewFrontCameraAction; property alias viewFrontCamera: viewFrontCameraAction
property alias viewTopCamera: viewTopCameraAction; property alias viewTopCamera: viewTopCameraAction
property alias viewBottomCamera: viewBottomCameraAction; property alias viewBottomCamera: viewBottomCameraAction
property alias viewLeftSideCamera: viewLeftSideCameraAction; property alias viewLeftSideCamera: viewLeftSideCameraAction
property alias viewRightSideCamera: viewRightSideCameraAction; property alias viewRightSideCamera: viewRightSideCameraAction
property alias deleteSelection: deleteSelectionAction; property alias deleteSelection: deleteSelectionAction
property alias centerSelection: centerSelectionAction; property alias centerSelection: centerSelectionAction
property alias multiplySelection: multiplySelectionAction; property alias multiplySelection: multiplySelectionAction
property alias deleteObject: deleteObjectAction; property alias deleteObject: deleteObjectAction
property alias centerObject: centerObjectAction; property alias centerObject: centerObjectAction
property alias groupObjects: groupObjectsAction; property alias groupObjects: groupObjectsAction
property alias unGroupObjects:unGroupObjectsAction; property alias unGroupObjects:unGroupObjectsAction
property alias mergeObjects: mergeObjectsAction; property alias mergeObjects: mergeObjectsAction
//property alias unMergeObjects: unMergeObjectsAction; //property alias unMergeObjects: unMergeObjectsAction
property alias multiplyObject: multiplyObjectAction; property alias multiplyObject: multiplyObjectAction
property alias selectAll: selectAllAction; property alias selectAll: selectAllAction
property alias deleteAll: deleteAllAction; property alias deleteAll: deleteAllAction
property alias reloadAll: reloadAllAction; property alias reloadAll: reloadAllAction
property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction; property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction
property alias arrangeAll: arrangeAllAction; property alias arrangeAll: arrangeAllAction
property alias arrangeSelection: arrangeSelectionAction; property alias arrangeSelection: arrangeSelectionAction
property alias resetAllTranslation: resetAllTranslationAction; property alias resetAllTranslation: resetAllTranslationAction
property alias resetAll: resetAllAction; property alias resetAll: resetAllAction
property alias addMachine: addMachineAction; property alias addMachine: addMachineAction
property alias configureMachines: settingsAction; property alias configureMachines: settingsAction
property alias addProfile: addProfileAction; property alias addProfile: addProfileAction
property alias updateProfile: updateProfileAction; property alias updateProfile: updateProfileAction
property alias resetProfile: resetProfileAction; property alias resetProfile: resetProfileAction
property alias manageProfiles: manageProfilesAction; property alias manageProfiles: manageProfilesAction
property alias manageMaterials: manageMaterialsAction; property alias manageMaterials: manageMaterialsAction
property alias marketplaceMaterials: marketplaceMaterialsAction; property alias marketplaceMaterials: marketplaceMaterialsAction
property alias preferences: preferencesAction; property alias preferences: preferencesAction
property alias showProfileFolder: showProfileFolderAction; property alias showProfileFolder: showProfileFolderAction
property alias documentation: documentationAction; property alias documentation: documentationAction
property alias showTroubleshooting: showTroubleShootingAction property alias showTroubleshooting: showTroubleShootingAction
property alias reportBug: reportBugAction; property alias reportBug: reportBugAction
property alias whatsNew: whatsNewAction property alias whatsNew: whatsNewAction
property alias about: aboutAction; property alias about: aboutAction
property alias toggleFullScreen: toggleFullScreenAction; property alias toggleFullScreen: toggleFullScreenAction
property alias exitFullScreen: exitFullScreenAction property alias exitFullScreen: exitFullScreenAction
property alias configureSettingVisibility: configureSettingVisibilityAction property alias configureSettingVisibility: configureSettingVisibilityAction
property alias browsePackages: browsePackagesAction property alias browsePackages: browsePackagesAction
property alias openMarketplace: openMarketplaceAction
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
@ -81,7 +79,7 @@ Item
{ {
id: showTroubleShootingAction id: showTroubleShootingAction
onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting") onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting")
text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide"); text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide")
} }
Action Action
@ -89,7 +87,7 @@ Item
id: toggleFullScreenAction id: toggleFullScreenAction
shortcut: StandardKey.FullScreen shortcut: StandardKey.FullScreen
text: catalog.i18nc("@action:inmenu", "Toggle Full Screen") text: catalog.i18nc("@action:inmenu", "Toggle Full Screen")
iconName: "view-fullscreen" icon.name: "view-fullscreen"
} }
Action Action
@ -97,27 +95,27 @@ Item
id: exitFullScreenAction id: exitFullScreenAction
shortcut: StandardKey.Cancel shortcut: StandardKey.Cancel
text: catalog.i18nc("@action:inmenu", "Exit Full Screen") text: catalog.i18nc("@action:inmenu", "Exit Full Screen")
iconName: "view-fullscreen" icon.name: "view-fullscreen"
} }
Action Action
{ {
id: undoAction; id: undoAction
text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo"); text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo")
iconName: "edit-undo"; icon.name: "edit-undo"
shortcut: StandardKey.Undo; shortcut: StandardKey.Undo
onTriggered: UM.OperationStack.undo(); onTriggered: UM.OperationStack.undo()
enabled: UM.OperationStack.canUndo; enabled: UM.OperationStack.canUndo
} }
Action Action
{ {
id: redoAction; id: redoAction
text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo"); text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo")
iconName: "edit-redo"; icon.name: "edit-redo"
shortcut: StandardKey.Redo; shortcut: StandardKey.Redo
onTriggered: UM.OperationStack.redo(); onTriggered: UM.OperationStack.redo()
enabled: UM.OperationStack.canRedo; enabled: UM.OperationStack.canRedo
} }
Action Action
@ -132,7 +130,7 @@ Item
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
text: (Qt.platform.os == "osx") ? "&Quit" : catalog.i18nc("@action:inmenu menubar:file", "&Quit") text: (Qt.platform.os == "osx") ? "&Quit" : catalog.i18nc("@action:inmenu menubar:file", "&Quit")
iconName: "application-exit" icon.name: "application-exit"
shortcut: StandardKey.Quit shortcut: StandardKey.Quit
} }
@ -189,7 +187,7 @@ Item
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
text: (Qt.platform.os == "osx") ? "Configure Cura..." : catalog.i18nc("@action:inmenu", "Configure Cura...") text: (Qt.platform.os == "osx") ? "Configure Cura..." : catalog.i18nc("@action:inmenu", "Configure Cura...")
iconName: "configure" icon.name: "configure"
} }
Action Action
@ -202,14 +200,14 @@ Item
{ {
id: settingsAction id: settingsAction
text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...") text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...")
iconName: "configure" icon.name: "configure"
} }
Action Action
{ {
id: manageMaterialsAction id: manageMaterialsAction
text: catalog.i18nc("@action:inmenu", "Manage Materials...") text: catalog.i18nc("@action:inmenu", "Manage Materials...")
iconName: "configure" icon.name: "configure"
shortcut: "Ctrl+K" shortcut: "Ctrl+K"
} }
@ -221,7 +219,7 @@ Item
Action Action
{ {
id: updateProfileAction; id: updateProfileAction
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null
text: catalog.i18nc("@action:inmenu menubar:profile", "&Update profile with current settings/overrides"); text: catalog.i18nc("@action:inmenu menubar:profile", "&Update profile with current settings/overrides");
onTriggered: Cura.ContainerManager.updateQualityChanges(); onTriggered: Cura.ContainerManager.updateQualityChanges();
@ -229,56 +227,56 @@ Item
Action Action
{ {
id: resetProfileAction; id: resetProfileAction
enabled: Cura.MachineManager.hasUserSettings enabled: Cura.MachineManager.hasUserSettings
text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes"); text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes")
onTriggered: onTriggered:
{ {
forceActiveFocus(); forceActiveFocus()
Cura.ContainerManager.clearUserContainers(); Cura.ContainerManager.clearUserContainers()
} }
} }
Action Action
{ {
id: addProfileAction; id: addProfileAction
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings
text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides..."); text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides...")
} }
Action Action
{ {
id: manageProfilesAction id: manageProfilesAction
text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...") text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...")
iconName: "configure" icon.name: "configure"
shortcut: "Ctrl+J" shortcut: "Ctrl+J"
} }
Action Action
{ {
id: documentationAction; id: documentationAction
text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation"); text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation")
iconName: "help-contents"; icon.name: "help-contents"
shortcut: StandardKey.Help; shortcut: StandardKey.Help
onTriggered: CuraActions.openDocumentation(); onTriggered: CuraActions.openDocumentation()
} }
Action { Action {
id: reportBugAction; id: reportBugAction
text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug"); text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug")
iconName: "tools-report-bug"; icon.name: "tools-report-bug"
onTriggered: CuraActions.openBugReportPage(); onTriggered: CuraActions.openBugReportPage()
} }
Action Action
{ {
id: whatsNewAction; id: whatsNewAction
text: catalog.i18nc("@action:inmenu menubar:help", "What's New"); text: catalog.i18nc("@action:inmenu menubar:help", "What's New")
} }
Action Action
{ {
id: aboutAction; id: aboutAction
//On MacOS, don't translate the "About" word. //On MacOS, don't translate the "About" word.
//Qt moves the "about" entry to a different place, and if it got renamed can't find it again when it //Qt moves the "about" entry to a different place, and if it got renamed can't find it again when it
@ -287,60 +285,60 @@ Item
//For more information, see: //For more information, see:
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About..."); text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About...")
iconName: "help-about"; icon.name: "help-about"
} }
Action Action
{ {
id: deleteSelectionAction; id: deleteSelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected"); text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected")
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
iconName: "edit-delete"; icon.name: "edit-delete"
shortcut: StandardKey.Delete | "Backspace" shortcut: StandardKey.Delete | "Backspace"
onTriggered: CuraActions.deleteSelection(); onTriggered: CuraActions.deleteSelection()
} }
Action Action
{ {
id: centerSelectionAction; id: centerSelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected"); text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected")
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
iconName: "align-vertical-center"; icon.name: "align-vertical-center"
onTriggered: CuraActions.centerSelection(); onTriggered: CuraActions.centerSelection()
} }
Action Action
{ {
id: multiplySelectionAction; id: multiplySelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected"); text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected")
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
iconName: "edit-duplicate"; icon.name: "edit-duplicate"
shortcut: "Ctrl+M" shortcut: "Ctrl+M"
} }
Action Action
{ {
id: deleteObjectAction; id: deleteObjectAction
text: catalog.i18nc("@action:inmenu","Delete Model"); text: catalog.i18nc("@action:inmenu","Delete Model")
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled
iconName: "edit-delete"; icon.name: "edit-delete"
} }
Action Action
{ {
id: centerObjectAction; id: centerObjectAction
text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform"); text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform")
} }
Action Action
{ {
id: groupObjectsAction id: groupObjectsAction
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models"); text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models")
enabled: UM.Selection.selectionCount > 1 ? true: false enabled: UM.Selection.selectionCount > 1 ? true: false
iconName: "object-group" icon.name: "object-group"
shortcut: "Ctrl+G"; shortcut: "Ctrl+G"
onTriggered: CuraApplication.groupSelected(); onTriggered: CuraApplication.groupSelected()
} }
Action Action
@ -356,139 +354,132 @@ Item
Action Action
{ {
id: unGroupObjectsAction id: unGroupObjectsAction
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models"); text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models")
enabled: UM.Selection.isGroupSelected enabled: UM.Selection.isGroupSelected
iconName: "object-ungroup" icon.name: "object-ungroup"
shortcut: "Ctrl+Shift+G"; shortcut: "Ctrl+Shift+G"
onTriggered: CuraApplication.ungroupSelected(); onTriggered: CuraApplication.ungroupSelected()
} }
Action Action
{ {
id: mergeObjectsAction id: mergeObjectsAction
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models"); text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models")
enabled: UM.Selection.selectionCount > 1 ? true: false enabled: UM.Selection.selectionCount > 1 ? true: false
iconName: "merge"; icon.name: "merge"
shortcut: "Ctrl+Alt+G"; shortcut: "Ctrl+Alt+G"
onTriggered: CuraApplication.mergeSelected(); onTriggered: CuraApplication.mergeSelected()
} }
Action Action
{ {
id: multiplyObjectAction; id: multiplyObjectAction
text: catalog.i18nc("@action:inmenu","&Multiply Model..."); text: catalog.i18nc("@action:inmenu","&Multiply Model...")
iconName: "edit-duplicate" icon.name: "edit-duplicate"
} }
Action Action
{ {
id: selectAllAction; id: selectAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models"); text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models")
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled
iconName: "edit-select-all"; icon.name: "edit-select-all"
shortcut: "Ctrl+A"; shortcut: "Ctrl+A"
onTriggered: CuraApplication.selectAll(); onTriggered: CuraApplication.selectAll()
} }
Action Action
{ {
id: deleteAllAction; id: deleteAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate"); text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate")
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled
iconName: "edit-delete"; icon.name: "edit-delete"
shortcut: "Ctrl+D"; shortcut: "Ctrl+D"
onTriggered: CuraApplication.deleteAll(); onTriggered: CuraApplication.deleteAll()
} }
Action Action
{ {
id: reloadAllAction; id: reloadAllAction
text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models"); text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models")
iconName: "document-revert"; icon.name: "document-revert"
shortcut: "F5" shortcut: "F5"
onTriggered: CuraApplication.reloadAll(); onTriggered: CuraApplication.reloadAll()
} }
Action Action
{ {
id: arrangeAllBuildPlatesAction; id: arrangeAllBuildPlatesAction
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates")
onTriggered: Printer.arrangeObjectsToAllBuildPlates(); onTriggered: Printer.arrangeObjectsToAllBuildPlates()
} }
Action Action
{ {
id: arrangeAllAction; id: arrangeAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models")
onTriggered: Printer.arrangeAll(); onTriggered: Printer.arrangeAll()
shortcut: "Ctrl+R"; shortcut: "Ctrl+R"
} }
Action Action
{ {
id: arrangeSelectionAction; id: arrangeSelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection")
onTriggered: Printer.arrangeSelection(); onTriggered: Printer.arrangeSelection()
} }
Action Action
{ {
id: resetAllTranslationAction; id: resetAllTranslationAction
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions"); text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions")
onTriggered: CuraApplication.resetAllTranslation(); onTriggered: CuraApplication.resetAllTranslation()
} }
Action Action
{ {
id: resetAllAction; id: resetAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations"); text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations")
onTriggered: CuraApplication.resetAll(); onTriggered: CuraApplication.resetAll()
} }
Action Action
{ {
id: openAction; id: openAction
property var fileProviderModel: CuraApplication.getFileProviderModel() property var fileProviderModel: CuraApplication.getFileProviderModel()
text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)..."); text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)...")
iconName: "document-open"; icon.name: "document-open"
// Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is // Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is
// enabled instead, and Ctrl+O is assigned to the local file provider // enabled instead, and Ctrl+O is assigned to the local file provider
shortcut: fileProviderModel.count == 1 ? StandardKey.Open : ""; shortcut: fileProviderModel.count == 1 ? StandardKey.Open : ""
} }
Action Action
{ {
id: newProjectAction id: newProjectAction
text: catalog.i18nc("@action:inmenu menubar:file","&New Project..."); text: catalog.i18nc("@action:inmenu menubar:file","&New Project...")
shortcut: StandardKey.New shortcut: StandardKey.New
} }
Action Action
{ {
id: showProfileFolderAction; id: showProfileFolderAction
text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder"); text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder")
} }
Action Action
{ {
id: configureSettingVisibilityAction id: configureSettingVisibilityAction
text: catalog.i18nc("@action:menu", "Configure setting visibility..."); text: catalog.i18nc("@action:menu", "Configure setting visibility...")
iconName: "configure" icon.name: "configure"
} }
Action Action
{ {
id: browsePackagesAction id: browsePackagesAction
text: "&Marketplace" text: "&Marketplace"
iconName: "plugins_browse" icon.name: "plugins_browse"
}
Action
{
id: openMarketplaceAction
text: catalog.i18nc("@action:menu", "&Marketplace")
iconName: "plugins_browse"
} }
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
Button Button
@ -73,7 +73,7 @@ Button
} }
} }
Label UM.Label
{ {
id: applicationDisplayName id: applicationDisplayName
@ -82,10 +82,8 @@ Button
height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap wrapMode: Text.Wrap
elide: Text.ElideRight elide: Text.ElideRight
color: UM.Theme.getColor("text")
} }
} }
} }

View File

@ -0,0 +1,148 @@
import QtQuick 2.10
import QtQuick.Controls 2.2
import QtQuick.Window 2.1
import QtQuick.Layouts 1.1
import UM 1.5 as UM
import Cura 1.1 as Cura
/*
* A dialog that provides the option to pick a color. Currently it only asks for a hex code and shows the color
* in a color swath
*/
UM.Dialog
{
id: base
property variant catalog: UM.I18nCatalog { name: "cura" }
margin: UM.Theme.getSize("default_margin").width
property alias swatchGridColumns: colorSwatchGrid.columns
// In this case we would like to let the content of the dialog determine the size of the dialog
// however with the current implementation of the dialog this is not possible, so instead we calculate
// the size of the dialog ourselves.
minimumWidth: content.width + 4 * margin
minimumHeight:
content.height // content height
+ buttonRow.height // button row height
+ 5 * margin // top and bottom margin and margin between buttons and content
width: minimumWidth
height: minimumHeight
property alias color: colorInput.text
property var swatchColors: [
"#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD",
"#5D88BE", "#5ABD0E", "#E17239", "#F74E46", "#874AF9",
"#50C2EC", "#8DC15A", "#C3977A", "#CD7776", "#9086BA",
"#FFFFFF", "#D3D3D3", "#9E9E9E", "#5A5A5A", "#000000",
]
Component.onCompleted: updateSwatches()
onSwatchColorsChanged: updateSwatches()
function updateSwatches()
{
swatchColorsModel.clear();
for (const swatchColor of base.swatchColors)
{
swatchColorsModel.append({ swatchColor });
}
}
Column
{
id: content
width: childrenRect.width
height: childrenRect.height
spacing: UM.Theme.getSize("wide_margin").height
GridLayout {
id: colorSwatchGrid
columns: 5
width: childrenRect.width
height: childrenRect.height
columnSpacing: UM.Theme.getSize("thick_margin").width
rowSpacing: UM.Theme.getSize("thick_margin").height
Repeater
{
model: ListModel
{
id: swatchColorsModel
}
delegate: Rectangle
{
color: swatchColor
implicitWidth: UM.Theme.getSize("medium_button_icon").width
implicitHeight: UM.Theme.getSize("medium_button_icon").height
radius: width / 2
UM.RecolorImage
{
anchors.fill: parent
visible: swatchColor == base.color
source: UM.Theme.getIcon("Check", "low")
color: UM.Theme.getColor("checkbox")
}
MouseArea
{
anchors.fill: parent
onClicked: base.color = swatchColor
}
}
}
}
RowLayout
{
width: parent.width
spacing: UM.Theme.getSize("default_margin").width
UM.Label
{
text: catalog.i18nc("@label", "Hex")
}
TextField
{
id: colorInput
Layout.fillWidth: true
text: "#FFFFFF"
selectByMouse: true
onTextChanged: {
if (!text.startsWith("#"))
{
text = `#${text}`;
}
}
validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ }
}
Rectangle
{
color: base.color
Layout.preferredHeight: parent.height
Layout.preferredWidth: height
}
}
}
buttonSpacing: UM.Theme.getSize("thin_margin").width
rightButtons:
[
Cura.TertiaryButton {
text: catalog.i18nc("@action:button", "Cancel")
onClicked: base.close()
},
Cura.PrimaryButton {
text: catalog.i18nc("@action:button", "OK")
onClicked: base.accept()
}
]
}

View File

@ -1,14 +1,11 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.15
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import UM 1.5 as UM
import UM 1.3 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "Dialogs" import "Dialogs"
@ -161,7 +158,6 @@ UM.MainWindow
ApplicationMenu ApplicationMenu
{ {
id: applicationMenu id: applicationMenu
window: base
} }
Item Item
@ -255,7 +251,6 @@ UM.MainWindow
// Try to install plugin & close. // Try to install plugin & close.
CuraApplication.installPackageViaDragAndDrop(filename); CuraApplication.installPackageViaDragAndDrop(filename);
packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting."); packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting.");
packageInstallDialog.icon = StandardIcon.Information;
packageInstallDialog.open(); packageInstallDialog.open();
} }
else else
@ -588,18 +583,15 @@ UM.MainWindow
} }
} }
MessageDialog Cura.MessageDialog
{ {
id: exitConfirmationDialog id: exitConfirmationDialog
title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName) title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName)
text: catalog.i18nc("@label %1 is the application name", "Are you sure you want to exit %1?").arg(CuraApplication.applicationDisplayName) text: catalog.i18nc("@label %1 is the application name", "Are you sure you want to exit %1?").arg(CuraApplication.applicationDisplayName)
icon: StandardIcon.Question standardButtons: Dialog.Yes | Dialog.No
modality: Qt.ApplicationModal onAccepted: CuraApplication.callConfirmExitDialogCallback(true)
standardButtons: StandardButton.Yes | StandardButton.No
onYes: CuraApplication.callConfirmExitDialogCallback(true)
onNo: CuraApplication.callConfirmExitDialogCallback(false)
onRejected: CuraApplication.callConfirmExitDialogCallback(false) onRejected: CuraApplication.callConfirmExitDialogCallback(false)
onVisibilityChanged: onClosed:
{ {
if (!visible) if (!visible)
{ {
@ -749,20 +741,18 @@ UM.MainWindow
} }
} }
MessageDialog Cura.MessageDialog
{ {
id: packageInstallDialog id: packageInstallDialog
title: catalog.i18nc("@window:title", "Install Package"); title: catalog.i18nc("@window:title", "Install Package")
standardButtons: StandardButton.Ok standardButtons: StandardButton.Ok
modality: Qt.ApplicationModal
} }
MessageDialog Cura.MessageDialog
{ {
id: infoMultipleFilesWithGcodeDialog id: infoMultipleFilesWithGcodeDialog
title: catalog.i18nc("@title:window", "Open File(s)") title: catalog.i18nc("@title:window", "Open File(s)")
icon: StandardIcon.Information standardButtons: Dialog.Ok
standardButtons: StandardButton.Ok
text: catalog.i18nc("@text:window", "We have found one or more G-Code files within the files you have selected. You can only open one G-Code file at a time. If you want to open a G-Code file, please just select only one.") text: catalog.i18nc("@text:window", "We have found one or more G-Code files within the files you have selected. You can only open one G-Code file at a time. If you want to open a G-Code file, please just select only one.")
property var selectedMultipleFiles property var selectedMultipleFiles
@ -821,35 +811,6 @@ UM.MainWindow
} }
} }
MessageDialog
{
id: messageDialog
modality: Qt.ApplicationModal
onAccepted: CuraApplication.messageBoxClosed(clickedButton)
onApply: CuraApplication.messageBoxClosed(clickedButton)
onDiscard: CuraApplication.messageBoxClosed(clickedButton)
onHelp: CuraApplication.messageBoxClosed(clickedButton)
onNo: CuraApplication.messageBoxClosed(clickedButton)
onRejected: CuraApplication.messageBoxClosed(clickedButton)
onReset: CuraApplication.messageBoxClosed(clickedButton)
onYes: CuraApplication.messageBoxClosed(clickedButton)
}
Connections
{
target: CuraApplication
function onShowMessageBox(title, text, informativeText, detailedText, buttons, icon)
{
messageDialog.title = title
messageDialog.text = text
messageDialog.informativeText = informativeText
messageDialog.detailedText = detailedText
messageDialog.standardButtons = buttons
messageDialog.icon = icon
messageDialog.visible = true
}
}
Component Component
{ {
id: discardOrKeepProfileChangesDialogComponent id: discardOrKeepProfileChangesDialogComponent

View File

@ -1,11 +1,11 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.9
import QtQuick.Window 2.1
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.5 as Cura
UM.Dialog UM.Dialog
{ {
@ -50,7 +50,7 @@ UM.Dialog
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
} }
Label UM.Label
{ {
id: version id: version
@ -63,7 +63,7 @@ UM.Dialog
} }
} }
Label UM.Label
{ {
id: description id: description
width: parent.width width: parent.width
@ -76,7 +76,7 @@ UM.Dialog
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
} }
Label UM.Label
{ {
id: creditsNotes id: creditsNotes
width: parent.width width: parent.width
@ -89,37 +89,36 @@ UM.Dialog
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
} }
ScrollView
{
id: credits
anchors.top: creditsNotes.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
ListView ListView
{ {
id: projectsList id: projectsList
anchors.top: creditsNotes.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width width: parent.width
height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
ScrollBar.vertical: UM.ScrollBar
{
id: projectsListScrollBar
}
delegate: Row delegate: Row
{ {
Label spacing: UM.Theme.getSize("narrow_margin").width
UM.Label
{ {
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name) text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
width: (projectsList.width * 0.25) | 0 width: (projectsList.width * 0.25) | 0
elide: Text.ElideRight elide: Text.ElideRight
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
Label UM.Label
{ {
text: model.description text: model.description
elide: Text.ElideRight elide: Text.ElideRight
width: (projectsList.width * 0.6) | 0 width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width
} }
Label UM.Label
{ {
text: model.license text: model.license
elide: Text.ElideRight elide: Text.ElideRight
@ -165,14 +164,12 @@ UM.Dialog
projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" }); projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" });
} }
} }
}
rightButtons: Button rightButtons: Cura.TertiaryButton
{ {
//: Close about dialog button //: Close about dialog button
id: closeButton id: closeButton
text: catalog.i18nc("@action:button","Close"); text: catalog.i18nc("@action:button", "Close")
onClicked: reject()
onClicked: base.visible = false;
} }
} }

View File

@ -1,12 +1,9 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -77,17 +74,13 @@ UM.Dialog
Column Column
{ {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 20 * screenScaleFactor spacing: UM.Theme.getSize("default_margin").height
anchors.rightMargin: 20 * screenScaleFactor
anchors.bottomMargin: 10 * screenScaleFactor
spacing: 10 * screenScaleFactor
Label UM.Label
{ {
id: questionText id: questionText
width: parent.width
text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?") text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?")
anchors.left: parent.left
anchors.right: parent.right
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
@ -98,29 +91,24 @@ UM.Dialog
text: catalog.i18nc("@text:window", "Remember my choice") text: catalog.i18nc("@text:window", "Remember my choice")
checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask" checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask"
} }
// Buttons
Item {
id: buttonBar
anchors.right: parent.right
anchors.left: parent.left
height: childrenRect.height
Button {
id: openAsProjectButton
text: catalog.i18nc("@action:button", "Open as project")
anchors.right: importModelsButton.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width
isDefault: true
onClicked: loadProjectFile()
} }
Button { onAccepted: loadProjectFile()
id: importModelsButton onRejected: loadModelFiles()
buttonSpacing: UM.Theme.getSize("thin_margin").width
rightButtons:
[
Cura.PrimaryButton
{
text: catalog.i18nc("@action:button", "Open as project")
onClicked: loadProjectFile()
},
Cura.SecondaryButton
{
text: catalog.i18nc("@action:button", "Import models") text: catalog.i18nc("@action:button", "Import models")
anchors.right: parent.right
onClicked: loadModelFiles() onClicked: loadModelFiles()
} }
} ]
}
} }

View File

@ -1,23 +1,30 @@
// Copyright (c) 2020 Ultimaker B.V. //Copyright (c) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import Qt.labs.qmlmodels 1.0
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.1 import QtQuick.Controls 2.15
import QtQuick.Controls 2.15 as NewControls
import QtQuick.Dialogs 1.2
import QtQuick.Window 2.1
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.6 as Cura
UM.Dialog UM.Dialog
{ {
id: base id: base
title: catalog.i18nc("@title:window", "Discard or Keep changes") title: catalog.i18nc("@title:window", "Discard or Keep changes")
onAccepted: CuraApplication.discardOrKeepProfileChangesClosed("discard")
onRejected: CuraApplication.discardOrKeepProfileChangesClosed("keep")
minimumWidth: UM.Theme.getSize("popup_dialog").width minimumWidth: UM.Theme.getSize("popup_dialog").width
minimumHeight: UM.Theme.getSize("popup_dialog").height minimumHeight: UM.Theme.getSize("popup_dialog").height
width: minimumWidth
height: minimumHeight
margin: UM.Theme.getSize("thick_margin").width
property var changesModel: Cura.UserChangesModel { id: userChangesModel } property var changesModel: Cura.UserChangesModel { id: userChangesModel }
onVisibilityChanged: onVisibilityChanged:
{ {
if(visible) if(visible)
@ -37,119 +44,59 @@ UM.Dialog
} }
} }
Row UM.Label
{ {
id: infoTextRow id: infoText
height: childrenRect.height text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings. Would you like to Keep these changed settings after switching profiles? Alternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"])
anchors.margins: UM.Theme.getSize("default_margin").width
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top wrapMode: Text.WordWrap
spacing: UM.Theme.getSize("default_margin").width
UM.I18nCatalog UM.I18nCatalog
{ {
id: catalog; id: catalog
name: "cura" name: "cura"
} }
Label
{
text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings.\nWould you like to Keep these changed settings after switching profiles?\nAlternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"])
anchors.margins: UM.Theme.getSize("default_margin").width
wrapMode: Text.WordWrap
}
} }
Item Item
{ {
anchors.margins: UM.Theme.getSize("default_margin").width anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.top: infoTextRow.bottom anchors.top: infoText.bottom
anchors.bottom: optionRow.top anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
TableView
Cura.TableView
{ {
anchors.fill: parent
height: base.height - 150
id: tableView id: tableView
Component anchors.fill: parent
columnHeaders: [
catalog.i18nc("@title:column", "Profile settings"),
Cura.MachineManager.activeQualityDisplayNameMap["main"],
catalog.i18nc("@title:column", "Current changes")
]
model: TableModel
{ {
id: labelDelegate TableModelColumn { display: "label" }
Label TableModelColumn { display: "original_value" }
{ TableModelColumn { display: "user_value" }
property var extruder_name: userChangesModel.getItem(styleData.row).extruder rows: userChangesModel.items
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right
elide: Text.ElideRight
font: UM.Theme.getFont("system")
text:
{
var result = styleData.value
if (extruder_name != "")
{
result += " (" + extruder_name + ")"
}
return result
} }
sectionRole: "category"
} }
} }
Component buttonSpacing: UM.Theme.getSize("thin_margin").width
{
id: defaultDelegate
Label
{
text: styleData.value
font: UM.Theme.getFont("system")
}
}
TableViewColumn leftButtons: [
Cura.ComboBox
{ {
role: "label" implicitHeight: UM.Theme.getSize("combobox_wide").height
title: catalog.i18nc("@title:column", "Profile settings") implicitWidth: UM.Theme.getSize("combobox_wide").width
delegate: labelDelegate
width: (tableView.width * 0.4) | 0
}
TableViewColumn
{
role: "original_value"
title: Cura.MachineManager.activeQualityDisplayNameMap["main"]
width: (tableView.width * 0.3) | 0
delegate: defaultDelegate
}
TableViewColumn
{
role: "user_value"
title: catalog.i18nc("@title:column", "Current changes")
width: (tableView.width * 0.3) | 0
}
section.property: "category"
section.delegate: Label
{
text: section
font.bold: true
}
model: userChangesModel
}
}
Item
{
id: optionRow
anchors.bottom: buttonsRow.top
anchors.right: parent.right
anchors.left: parent.left
anchors.margins: UM.Theme.getSize("default_margin").width
height: childrenRect.height
NewControls.ComboBox
{
id: discardOrKeepProfileChangesDropDownButton id: discardOrKeepProfileChangesDropDownButton
width: 300
textRole: "text" textRole: "text"
model: ListModel model: ListModel
@ -182,41 +129,21 @@ UM.Dialog
} }
} }
} }
} ]
Item rightButtons:
{ [
id: buttonsRow Cura.PrimaryButton
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.margins: UM.Theme.getSize("default_margin").width
height: childrenRect.height
Button
{ {
id: discardButton id: discardButton
text: catalog.i18nc("@action:button", "Discard changes"); text: catalog.i18nc("@action:button", "Discard changes")
anchors.right: parent.right onClicked: base.accept()
onClicked: },
{ Cura.SecondaryButton
CuraApplication.discardOrKeepProfileChangesClosed("discard")
base.hide()
}
isDefault: true
}
Button
{ {
id: keepButton id: keepButton
text: catalog.i18nc("@action:button", "Keep changes"); text: catalog.i18nc("@action:button", "Keep changes")
anchors.right: discardButton.left onClicked: base.reject()
anchors.rightMargin: UM.Theme.getSize("default_margin").width
onClicked:
{
CuraApplication.discardOrKeepProfileChangesClosed("keep")
base.hide()
}
}
} }
]
} }

View File

@ -0,0 +1,20 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import UM 1.5 as UM
import Cura 1.5 as Cura
// Wrapper around the UM.MessageBox with the primary/secondarybuttons
// set to Cura.PrimaryButton and Cura.SecondaryButton respectively
UM.MessageDialog
{
primaryButton: Cura.PrimaryButton
{
text: model.text
}
secondaryButton: Cura.TertiaryButton
{
text: model.text
}
}

View File

@ -1,15 +1,12 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.5 as Cura
UM.Dialog UM.Dialog
{ {
@ -17,9 +14,9 @@ UM.Dialog
id: base id: base
title: catalog.i18nc("@title:window", "Open file(s)") title: catalog.i18nc("@title:window", "Open file(s)")
width: 420 * screenScaleFactor
height: 170 * screenScaleFactor
width: UM.Theme.getSize("small_popup_dialog").width
height: UM.Theme.getSize("small_popup_dialog").height
maximumHeight: height maximumHeight: height
maximumWidth: width maximumWidth: width
minimumHeight: height minimumHeight: height
@ -29,12 +26,6 @@ UM.Dialog
property var fileUrls: [] property var fileUrls: []
property var addToRecent: true property var addToRecent: true
property int spacerHeight: 10 * screenScaleFactor
function loadProjectFile(projectFile)
{
UM.WorkspaceFileHandler.readLocalFile(projectFile, base.addToRecent);
}
function loadModelFiles(fileUrls) function loadModelFiles(fileUrls)
{ {
@ -44,70 +35,29 @@ UM.Dialog
} }
} }
Column onAccepted: loadModelFiles(base.fileUrls)
{
anchors.fill: parent
anchors.leftMargin: 20 * screenScaleFactor
anchors.rightMargin: 20 * screenScaleFactor
anchors.bottomMargin: 20 * screenScaleFactor
anchors.left: parent.left
anchors.right: parent.right
spacing: 10 * screenScaleFactor
Label UM.Label
{ {
text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?") text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?")
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
font: UM.Theme.getFont("default")
wrapMode: Text.WordWrap
} }
Item // Spacer buttonSpacing: UM.Theme.getSize("thin_margin").width
{
height: base.spacerHeight
width: height
}
// Buttons // Buttons
Item rightButtons:
[
Cura.SecondaryButton
{ {
anchors.right: parent.right
anchors.left: parent.left
height: childrenRect.height
Button
{
id: cancelButton
text: catalog.i18nc("@action:button", "Cancel"); text: catalog.i18nc("@action:button", "Cancel");
anchors.right: importAllAsModelsButton.left onClicked: base.reject()
onClicked: },
Cura.PrimaryButton
{ {
// cancel
base.hide();
}
}
Button
{
id: importAllAsModelsButton
text: catalog.i18nc("@action:button", "Import all as models"); text: catalog.i18nc("@action:button", "Import all as models");
anchors.right: parent.right onClicked: base.accept()
isDefault: true
onClicked:
{
// load models from all selected file
loadModelFiles(base.fileUrls);
base.hide();
}
}
}
UM.I18nCatalog
{
id: catalog
name: "cura"
}
} }
]
} }

View File

@ -1,11 +1,9 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.9
import QtQuick.Controls 2.0 as Controls2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -15,26 +13,14 @@ UM.Dialog
id: base id: base
title: catalog.i18nc("@title:window", "Save Project") title: catalog.i18nc("@title:window", "Save Project")
minimumWidth: 500 * screenScaleFactor minimumWidth: UM.Theme.getSize("popup_dialog").width
minimumHeight: 400 * screenScaleFactor minimumHeight: UM.Theme.getSize("popup_dialog").height
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
property int spacerHeight: 10 * screenScaleFactor
property bool dontShowAgain: true property bool dontShowAgain: true
signal yes(); onClosing: UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked)
function accept() { // pressing enter will call this function
close();
yes();
}
onClosing:
{
UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked)
}
onVisibleChanged: onVisibleChanged:
{ {
@ -59,11 +45,7 @@ UM.Dialog
visibilityHandler: UM.SettingPreferenceVisibilityHandler { } visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
} }
SystemPalette UM.Label
{
id: palette
}
Label
{ {
id: mainHeading id: mainHeading
width: parent.width width: parent.width
@ -79,16 +61,28 @@ UM.Dialog
{ {
top: mainHeading.bottom top: mainHeading.bottom
topMargin: UM.Theme.getSize("default_margin").height topMargin: UM.Theme.getSize("default_margin").height
bottom: controls.top bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_margin").height bottomMargin: UM.Theme.getSize("default_margin").height
} }
style: UM.Theme.styles.scrollview
ScrollBar.vertical: UM.ScrollBar
{
parent: scroll
anchors
{
top: parent.top
right: parent.right
bottom: parent.bottom
}
}
clip: true
ColumnLayout ColumnLayout
{ {
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Column Column
{ {
Label UM.Label
{ {
id: settingsHeading id: settingsHeading
text: catalog.i18nc("@action:label", "Printer settings") text: catalog.i18nc("@action:label", "Printer settings")
@ -98,14 +92,14 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Type") text: catalog.i18nc("@action:label", "Type")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name text: Cura.MachineManager.activeMachine == null ? "" : Cura.MachineManager.activeMachine.definition.name
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }
@ -113,12 +107,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name") text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: text:
{ {
@ -157,7 +151,7 @@ UM.Dialog
var material_name = extruder.material.name var material_name = extruder.material.name
return (material_name !== undefined) ? material_name : "" return (material_name !== undefined) ? material_name : ""
} }
Label UM.Label
{ {
text: { text: {
var extruder = Number(modelData.position) var extruder = Number(modelData.position)
@ -181,7 +175,7 @@ UM.Dialog
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: text:
{ {
@ -194,7 +188,7 @@ UM.Dialog
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
enabled: modelData.isEnabled enabled: modelData.isEnabled
} }
Label UM.Label
{ {
text: text:
{ {
@ -214,7 +208,7 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Profile settings") text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true font.bold: true
@ -222,12 +216,12 @@ UM.Dialog
Row Row
{ {
width: parent.width width: parent.width
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Not in profile") text: catalog.i18nc("@action:label", "Not in profile")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings) text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -238,12 +232,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Name") text: catalog.i18nc("@action:label", "Name")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: Cura.MachineManager.activeQualityOrQualityChangesName text: Cura.MachineManager.activeQualityOrQualityChangesName
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -255,12 +249,12 @@ UM.Dialog
{ {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@action:label", "Intent") text: catalog.i18nc("@action:label", "Intent")
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
Label UM.Label
{ {
text: Cura.MachineManager.activeIntentCategory text: Cura.MachineManager.activeIntentCategory
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
@ -269,43 +263,31 @@ UM.Dialog
} }
} }
} }
Item }
{
id: controls buttonSpacing: UM.Theme.getSize("thin_margin").width
width: parent.width
height: childrenRect.height leftButtons:
anchors.bottom: parent.bottom [
UM.CheckBox UM.CheckBox
{ {
id: dontShowAgainCheckbox id: dontShowAgainCheckbox
anchors.left: parent.left
text: catalog.i18nc("@action:label", "Don't show project summary on save again") text: catalog.i18nc("@action:label", "Don't show project summary on save again")
checked: dontShowAgain checked: dontShowAgain
} }
Controls2.Button ]
rightButtons:
[
Cura.SecondaryButton
{ {
id: cancel_button text: catalog.i18nc("@action:button", "Cancel")
anchors onClicked: base.reject()
},
Cura.PrimaryButton
{ {
right: ok_button.left text: catalog.i18nc("@action:button", "Save")
rightMargin: UM.Theme.getSize("default_margin").width onClicked: base.accept()
}
text: catalog.i18nc("@action:button","Cancel");
enabled: true
onClicked: close()
}
Controls2.Button
{
id: ok_button
anchors.right: parent.right
text: catalog.i18nc("@action:button","Save");
enabled: true
onClicked:
{
close()
yes()
}
}
}
} }
]
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
// The expandable component has 2 major sub components: // The expandable component has 2 major sub components:
@ -30,8 +30,8 @@ Item
property color contentBackgroundColor: UM.Theme.getColor("action_button") property color contentBackgroundColor: UM.Theme.getColor("action_button")
property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button")
property color headerActiveColor: UM.Theme.getColor("secondary") property color headerActiveColor: UM.Theme.getColor("expandable_active")
property color headerHoverColor: UM.Theme.getColor("action_button_hovered") property color headerHoverColor: UM.Theme.getColor("expandable_hover")
property alias enabled: mouseArea.enabled property alias enabled: mouseArea.enabled
@ -126,7 +126,7 @@ Item
color: base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") color: base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled")
anchors.fill: parent anchors.fill: parent
Label UM.Label
{ {
id: disabledLabel id: disabledLabel
visible: !base.enabled visible: !base.enabled
@ -134,10 +134,6 @@ Item
leftPadding: background.padding leftPadding: background.padding
rightPadding: background.padding rightPadding: background.padding
text: "" text: ""
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
color: UM.Theme.getColor("text")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
// Header of the popup // Header of the popup
@ -16,20 +16,17 @@ Cura.RoundedRectangle
property alias xPosCloseButton: closeButton.left property alias xPosCloseButton: closeButton.left
height: UM.Theme.getSize("expandable_component_content_header").height height: UM.Theme.getSize("expandable_component_content_header").height
color: UM.Theme.getColor("secondary") color: UM.Theme.getColor("background_1")
cornerSide: Cura.RoundedRectangle.Direction.Up cornerSide: Cura.RoundedRectangle.Direction.Up
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
radius: UM.Theme.getSize("default_radius").width radius: UM.Theme.getSize("default_radius").width
Label UM.Label
{ {
id: headerLabel id: headerLabel
text: "" text: ""
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
color: UM.Theme.getColor("small_button_text")
height: parent.height height: parent.height
anchors anchors

View File

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
// The expandable component has 2 major sub components: // The expandable component has 2 major sub components:
@ -30,8 +30,8 @@ Item
property color contentBackgroundColor: UM.Theme.getColor("action_button") property color contentBackgroundColor: UM.Theme.getColor("action_button")
property color headerBackgroundColor: UM.Theme.getColor("action_button") property color headerBackgroundColor: UM.Theme.getColor("action_button")
property color headerActiveColor: UM.Theme.getColor("secondary") property color headerActiveColor: UM.Theme.getColor("expandable_active")
property color headerHoverColor: UM.Theme.getColor("action_button_hovered") property color headerHoverColor: UM.Theme.getColor("expandable_hover")
property alias mouseArea: headerMouseArea property alias mouseArea: headerMouseArea
property alias enabled: headerMouseArea.enabled property alias enabled: headerMouseArea.enabled
@ -120,16 +120,12 @@ Item
color: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") color: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled")
anchors.fill: parent anchors.fill: parent
Label UM.Label
{ {
id: disabledLabel id: disabledLabel
visible: !base.enabled visible: !base.enabled
leftPadding: background.padding leftPadding: background.padding
text: "" text: ""
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
color: UM.Theme.getColor("text")
height: parent.height height: parent.height
} }

View File

@ -2,8 +2,7 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 1.1 import UM 1.5 as UM
import UM 1.2 as UM
Item Item
{ {
@ -43,18 +42,15 @@ Item
color: extruderNumberText.color color: extruderNumberText.color
} }
Label UM.Label
{ {
id: extruderNumberText id: extruderNumberText
anchors.centerIn: parent anchors.centerIn: parent
text: index + 1 text: index + 1
font: UM.Theme.getFont("small_emphasis") font: UM.Theme.getFont("small_emphasis")
color: UM.Theme.getColor("text")
width: contentWidth width: contentWidth
height: contentHeight height: contentHeight
renderType: Text.NativeRendering
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
} }
} }
} }

View File

@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
// Reusable component that holds an (re-colorable) icon on the left with some text on the right. // Reusable component that holds an (re-colorable) icon on the left with some text on the right.
@ -49,15 +49,10 @@ Item
} }
} }
Label UM.Label
{ {
id: label id: label
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
elide: Text.ElideRight elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
anchors anchors
{ {
left: icon.right left: icon.right

View File

@ -1,12 +1,11 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.1 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
@ -29,7 +28,8 @@ Item
{ {
if (!activity) if (!activity)
{ {
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file) // When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't
// set an empty string as a jobName (which is later used for saving the file)
PrintInformation.baseName = "" PrintInformation.baseName = ""
} }
} }
@ -41,35 +41,21 @@ Item
anchors.left: parent.left anchors.left: parent.left
height: UM.Theme.getSize("jobspecs_line").height height: UM.Theme.getSize("jobspecs_line").height
Button UM.SimpleButton
{ {
id: printJobPencilIcon id: printJobPencilIcon
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("save_button_specs_icons").width width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height height: UM.Theme.getSize("save_button_specs_icons").height
iconSource: UM.Theme.getIcon("Pen")
hoverColor: UM.Theme.getColor("small_button_text_hover")
color: UM.Theme.getColor("small_button_text")
onClicked: onClicked:
{ {
printJobTextfield.selectAll() printJobTextfield.selectAll()
printJobTextfield.focus = true printJobTextfield.focus = true
} }
style: ButtonStyle
{
background: Item
{
UM.RecolorImage
{
width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height
sourceSize.width: width
sourceSize.height: width
color: control.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text")
source: UM.Theme.getIcon("Pen")
}
}
}
} }
TextField TextField
@ -78,9 +64,9 @@ Item
anchors.left: printJobPencilIcon.right anchors.left: printJobPencilIcon.right
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
height: UM.Theme.getSize("jobspecs_line").height height: UM.Theme.getSize("jobspecs_line").height
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50) width: Math.max(contentWidth + UM.Theme.getSize("default_margin").width, 50)
maximumLength: 120 maximumLength: 120
text: (PrintInformation === null) ? "" : PrintInformation.jobName text: PrintInformation === null ? "" : PrintInformation.jobName
horizontalAlignment: TextInput.AlignLeft horizontalAlignment: TextInput.AlignLeft
property string textBeforeEdit: "" property string textBeforeEdit: ""
@ -105,29 +91,20 @@ Item
validator: RegExpValidator { validator: RegExpValidator {
regExp: /^[^\\\/\*\?\|\[\]]*$/ regExp: /^[^\\\/\*\?\|\[\]]*$/
} }
style: TextFieldStyle
{
textColor: UM.Theme.getColor("text_scene")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
background: Rectangle color: UM.Theme.getColor("text_scene")
{ background: Item {}
opacity: 0 selectByMouse: true
border.width: 0
}
}
} }
} }
Label UM.Label
{ {
id: boundingSpec id: boundingSpec
anchors.top: jobNameRow.bottom anchors.top: jobNameRow.bottom
anchors.left: parent.left anchors.left: parent.left
height: UM.Theme.getSize("jobspecs_line").height height: UM.Theme.getSize("jobspecs_line").height
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_scene") color: UM.Theme.getColor("text_scene")
text: CuraApplication.getSceneBoundingBoxString text: CuraApplication.getSceneBoundingBoxString
} }
@ -141,10 +118,7 @@ Item
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
} }
Component.onCompleted: Component.onCompleted: base.addAdditionalComponents("jobSpecsButton")
{
base.addAdditionalComponents("jobSpecsButton")
}
Connections Connections
{ {

View File

@ -5,7 +5,7 @@ import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.2 as UM import UM 1.5 as UM
// The labelBar shows a set of labels that are evenly spaced from one another. // The labelBar shows a set of labels that are evenly spaced from one another.
// The first item is aligned to the left, the last is aligned to the right. // The first item is aligned to the left, the last is aligned to the right.
@ -34,13 +34,10 @@ Item
Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1)) Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1))
height: label.height height: label.height
Label UM.Label
{ {
id: label id: label
text: model[modelKey] text: model[modelKey]
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
height: contentHeight height: contentHeight
anchors anchors
{ {

View File

@ -1,11 +1,11 @@
// Copyright (c) 2020 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -45,7 +45,7 @@ UM.TooltipArea
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
ScrollView Flickable
{ {
anchors.top: titleLabel.bottom anchors.top: titleLabel.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
@ -53,26 +53,9 @@ UM.TooltipArea
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
background: Rectangle ScrollBar.vertical: UM.ScrollBar {}
{
color: UM.Theme.getColor("main_background")
anchors.fill: parent
border.color: TextArea.flickable: TextArea
{
if (!gcodeTextArea.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
}
TextArea
{ {
id: gcodeTextArea id: gcodeTextArea
@ -92,6 +75,27 @@ UM.TooltipArea
propertyProvider.setPropertyValue("value", text) propertyProvider.setPropertyValue("value", text)
} }
} }
background: Rectangle
{
color: UM.Theme.getColor("main_background")
anchors.fill: parent
anchors.margins: -border.width //Wrap the border around the parent.
border.color:
{
if (!gcodeTextArea.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
border.width: UM.Theme.getSize("default_lining").width
}
} }
} }
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -83,13 +83,12 @@ UM.TooltipArea
height: numericTextFieldWithUnit.controlHeight height: numericTextFieldWithUnit.controlHeight
// Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.) // Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.)
background: Rectangle background: UM.UnderlineBackground
{ {
anchors.fill: parent anchors.fill: parent
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
radius: UM.Theme.getSize("setting_control_radius").width
border.color: liningColor:
{ {
if (!textFieldWithUnit.enabled) if (!textFieldWithUnit.enabled)
{ {
@ -108,9 +107,9 @@ UM.TooltipArea
// Validation is OK. // Validation is OK.
if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus)
{ {
return UM.Theme.getColor("setting_control_border_highlight") return UM.Theme.getColor("border_main_light")
} }
return UM.Theme.getColor("setting_control_border") return UM.Theme.getColor("border_field_light")
} }
color: color:
@ -222,7 +221,7 @@ UM.TooltipArea
} }
} }
Label UM.Label
{ {
id: unitLabel id: unitLabel
anchors.right: parent.right anchors.right: parent.right
@ -230,10 +229,7 @@ UM.TooltipArea
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: unitText text: unitText
textFormat: Text.PlainText textFormat: Text.PlainText
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
color: UM.Theme.getColor("setting_unit") color: UM.Theme.getColor("setting_unit")
font: UM.Theme.getFont("default")
} }
} }
} }

View File

@ -1,13 +1,10 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "../Menus" import "../Menus"
@ -16,38 +13,42 @@ import "../Dialogs"
Item Item
{ {
id: menu id: menu
width: applicationMenu.width width: parent.width
height: applicationMenu.height height: applicationMenu.height
property alias window: applicationMenu.window
UM.ApplicationMenu MenuBar
{ {
id: applicationMenu id: applicationMenu
width: parent.width
height: UM.Theme.getSize("context_menu").height
FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") } background: Rectangle {
color: UM.Theme.getColor("background_1")
Menu
{
title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
MenuItem { action: Cura.Actions.undo }
MenuItem { action: Cura.Actions.redo }
MenuSeparator { }
MenuItem { action: Cura.Actions.selectAll }
MenuItem { action: Cura.Actions.arrangeAll }
MenuItem { action: Cura.Actions.multiplySelection }
MenuItem { action: Cura.Actions.deleteSelection }
MenuItem { action: Cura.Actions.deleteAll }
MenuItem { action: Cura.Actions.resetAllTranslation }
MenuItem { action: Cura.Actions.resetAll }
MenuSeparator { }
MenuItem { action: Cura.Actions.groupObjects }
MenuItem { action: Cura.Actions.mergeObjects }
MenuItem { action: Cura.Actions.unGroupObjects }
} }
ViewMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&View") } delegate: MenuBarItem
{
id: menuBarItem
contentItem: UM.Label
{
text: menuBarItem.text.replace(new RegExp("&([A-Za-z])"), function (match, character)
{
return `<u>${character}</u>`;
})
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
background: Rectangle
{
color: menuBarItem.highlighted ? UM.Theme.getColor("background_2") : "transparent"
}
}
FileMenu {}
EditMenu {}
ViewMenu {}
SettingsMenu SettingsMenu
{ {
//On MacOS, don't translate the "Settings" word. //On MacOS, don't translate the "Settings" word.
@ -59,93 +60,11 @@ Item
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
} }
ExtensionMenu { id: extensionMenu }
Menu PreferencesMenu {}
{ HelpMenu {}
id: extensionMenu
title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions")
Instantiator
{
id: extensions
model: UM.ExtensionModel { }
Menu
{
id: sub_menu
title: model.name;
visible: actions != null
enabled: actions != null
Instantiator
{
model: actions
Loader
{
property var extensionsModel: extensions.model
property var modelText: model.text
property var extensionName: name
sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem
} }
onObjectAdded: sub_menu.insertItem(index, object.item)
onObjectRemoved: sub_menu.removeItem(object.item)
}
}
onObjectAdded: extensionMenu.insertItem(index, object)
onObjectRemoved: extensionMenu.removeItem(object)
}
}
Menu
{
id: preferencesMenu
//On MacOS, don't translate the "Preferences" word.
//Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it
//attempts to delete the item upon closing the application, causing a crash.
//In the new location, these items are translated automatically according to the system's language.
//For more information, see:
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references")
MenuItem { action: Cura.Actions.preferences }
}
Menu
{
id: helpMenu
title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
MenuItem { action: Cura.Actions.showProfileFolder }
MenuItem { action: Cura.Actions.showTroubleshooting}
MenuItem { action: Cura.Actions.documentation }
MenuItem { action: Cura.Actions.reportBug }
MenuSeparator { }
MenuItem { action: Cura.Actions.whatsNew }
MenuItem { action: Cura.Actions.about }
}
}
Component
{
id: extensionsMenuItem
MenuItem
{
text: modelText
onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText)
}
}
Component
{
id: extensionsMenuSeparator
MenuSeparator {}
}
// ############################################################################################### // ###############################################################################################
@ -156,18 +75,17 @@ Item
{ {
id: saveWorkspaceDialog id: saveWorkspaceDialog
property var args property var args
onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
} }
MessageDialog Cura.MessageDialog
{ {
id: newProjectDialog id: newProjectDialog
modality: Qt.ApplicationModal
title: catalog.i18nc("@title:window", "New project") title: catalog.i18nc("@title:window", "New project")
text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.") text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.")
standardButtons: StandardButton.Yes | StandardButton.No standardButtons: Dialog.Yes | Dialog.No
icon: StandardIcon.Question onAccepted:
onYes:
{ {
CuraApplication.resetWorkspace() CuraApplication.resetWorkspace()
Cura.Actions.resetProfile.trigger() Cura.Actions.resetProfile.trigger()
@ -175,11 +93,6 @@ Item
} }
} }
UM.ExtensionModel
{
id: curaExtensions
}
// ############################################################################################### // ###############################################################################################
// Definition of all the connections // Definition of all the connections
// ############################################################################################### // ###############################################################################################
@ -196,13 +109,13 @@ Item
} }
} }
// show the Marketplace // show the Toolbox
Connections Connections
{ {
target: Cura.Actions.openMarketplace target: Cura.Actions.browsePackages
function onTriggered() function onTriggered()
{ {
curaExtensions.callExtensionMethod("Marketplace", "show") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
} }
} }
@ -212,8 +125,8 @@ Item
target: Cura.Actions.marketplaceMaterials target: Cura.Actions.marketplaceMaterials
function onTriggered() function onTriggered()
{ {
curaExtensions.callExtensionMethod("Marketplace", "show") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
curaExtensions.callExtensionMethod("Marketplace", "setVisibleTabToMaterials") extensionMenu.extensionModel.callExtensionMethod("Marketplace", "setVisibleTabToMaterials")
} }
} }
} }

View File

@ -1,12 +1,10 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 as Controls2 import QtQuick.Controls 2.4
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.1
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import "../Account" import "../Account"
@ -33,6 +31,10 @@ Item
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
} }
ButtonGroup
{
buttons: stagesListContainer.children
}
Row Row
{ {
@ -61,15 +63,60 @@ Item
checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
exclusiveGroup: mainWindowHeaderMenuGroup //style: UM.Theme.styles.main_window_header_tab
style: UM.Theme.styles.main_window_header_tab
height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
iconSource: model.stage.iconSource
property color overlayColor: "transparent"
property string overlayIconSource: ""
// This id is required to find the stage buttons through Squish // This id is required to find the stage buttons through Squish
property string stageId: model.id property string stageId: model.id
hoverEnabled: true
leftPadding: 2 * UM.Theme.getSize("default_margin").width
rightPadding: 2 * UM.Theme.getSize("default_margin").width
// Set top & bottom padding to whatever space is left from height and the size of the text.
bottomPadding: Math.round((height - buttonLabel.contentHeight) / 2)
topPadding: bottomPadding
background: Rectangle
{
radius: UM.Theme.getSize("action_button_radius").width
color:
{
if (stageSelectorButton.checked)
{
return UM.Theme.getColor("main_window_header_button_background_active")
}
else
{
if (stageSelectorButton.hovered)
{
return UM.Theme.getColor("main_window_header_button_background_hovered")
}
return UM.Theme.getColor("main_window_header_button_background_inactive")
}
}
}
contentItem: UM.Label
{
id: buttonLabel
text: stageSelectorButton.text
anchors.centerIn: stageSelectorButton
font: UM.Theme.getFont("medium")
color:
{
if (stageSelectorButton.checked)
{
return UM.Theme.getColor("main_window_header_button_text_active")
}
else
{
if (stageSelectorButton.hovered)
{
return UM.Theme.getColor("main_window_header_button_text_hovered")
}
return UM.Theme.getColor("main_window_header_button_text_inactive")
}
}
}
// This is a trick to assure the activeStage is correctly changed. It doesn't work properly if done in the onClicked (see CURA-6028) // This is a trick to assure the activeStage is correctly changed. It doesn't work properly if done in the onClicked (see CURA-6028)
MouseArea MouseArea
@ -79,35 +126,21 @@ Item
} }
} }
} }
ExclusiveGroup { id: mainWindowHeaderMenuGroup }
} }
Controls2.Button // Shortcut button to quick access the Toolbox
Button
{ {
id: marketplaceButton id: marketplaceButton
text: catalog.i18nc("@action:button", "Marketplace")
height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
anchors onClicked: Cura.Actions.browsePackages.trigger()
{
verticalCenter: parent.verticalCenter
right: applicationSwitcher.left
rightMargin: UM.Theme.getSize("default_margin").width
}
hoverEnabled: true hoverEnabled: true
onClicked: Cura.Actions.openMarketplace.trigger()
contentItem: Label
{
text: "Marketplace" //Ultimaker considers this a product name, so it shouldn't be translated.
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("primary_text")
width: contentWidth
verticalAlignment: Text.AlignVCenter
}
background: Rectangle background: Rectangle
{ {
id: marketplaceButtonBorder
radius: UM.Theme.getSize("action_button_radius").width radius: UM.Theme.getSize("action_button_radius").width
color: UM.Theme.getColor("main_window_header_background") color: UM.Theme.getColor("main_window_header_background")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
@ -115,6 +148,7 @@ Item
Rectangle Rectangle
{ {
id: marketplaceButtonFill
anchors.fill: parent anchors.fill: parent
radius: parent.radius radius: parent.radius
color: UM.Theme.getColor("primary_text") color: UM.Theme.getColor("primary_text")
@ -123,12 +157,30 @@ Item
} }
} }
Cura.NotificationIcon contentItem: UM.Label
{ {
id: label
text: marketplaceButton.text
color: UM.Theme.getColor("primary_text")
width: contentWidth
}
anchors anchors
{ {
horizontalCenter: parent.right right: applicationSwitcher.left
verticalCenter: parent.top rightMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter
}
Cura.NotificationIcon
{
id: marketplaceNotificationIcon
anchors
{
top: parent.top
right: parent.right
rightMargin: (-0.5 * width) | 0
topMargin: (-0.5 * height) | 0
} }
visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0 visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0

View File

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Button Button
@ -99,7 +99,7 @@ Button
height: width height: width
} }
Label UM.Label
{ {
id: unknownMaterialMessage id: unknownMaterialMessage
text: text:
@ -147,10 +147,6 @@ Button
anchors.top: unknownMaterial.top anchors.top: unknownMaterial.top
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
verticalAlignment: Text.AlignVCenter
linkColor: UM.Theme.getColor("text_link")
onLinkActivated: onLinkActivated:
{ {

View File

@ -1,10 +1,10 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
@ -67,18 +67,14 @@ Item
contentHeight: configurationList.height contentHeight: configurationList.height
clip: true clip: true
ScrollBar.vertical.policy: (configurationList.height > maximumHeight) ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff //The AsNeeded policy also hides it when the cursor is away, and we don't want that. ScrollBar.vertical: UM.ScrollBar {
ScrollBar.vertical.background: Rectangle parent: container
anchors
{ {
implicitWidth: UM.Theme.getSize("scrollbar").width top: parent.top
radius: width / 2 right: parent.right
color: UM.Theme.getColor("scrollbar_background") bottom: parent.bottom
} }
ScrollBar.vertical.contentItem: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: width / 2
color: UM.Theme.getColor(parent.pressed ? "scrollbar_handle_down" : parent.hovered ? "scrollbar_handle_hover" : "scrollbar_handle")
} }
ButtonGroup ButtonGroup

View File

@ -3,10 +3,9 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.4 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -19,7 +18,7 @@ Cura.ExpandablePopup
id: base id: base
property var extrudersModel: CuraApplication.getExtrudersModel() property var extrudersModel: CuraApplication.getExtrudersModel()
property var activeMachine: Cura.MachineManager.activeMachine
UM.I18nCatalog UM.I18nCatalog
{ {
id: catalog id: catalog
@ -33,7 +32,7 @@ Cura.ExpandablePopup
} }
contentPadding: UM.Theme.getSize("default_lining").width contentPadding: UM.Theme.getSize("default_lining").width
enabled: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials || Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change. enabled: activeMachine ? activeMachine.hasMaterials || activeMachine.hasVariants || activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change.
headerItem: Item headerItem: Item
{ {
@ -44,7 +43,7 @@ Cura.ExpandablePopup
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
width: parent.width - UM.Theme.getSize("standard_arrow").width width: parent.width - UM.Theme.getSize("standard_arrow").width
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false visible: activeMachine ? activeMachine.hasMaterials : false
Repeater Repeater
{ {
model: extrudersModel model: extrudersModel
@ -56,9 +55,9 @@ Cura.ExpandablePopup
Layout.maximumWidth: Math.round(parent.width / extrudersModel.count) Layout.maximumWidth: Math.round(parent.width / extrudersModel.count)
Layout.fillHeight: true Layout.fillHeight: true
property var extruderStack: Cura.MachineManager.activeMachine.extruders[model.index] property var extruderStack: activeMachine ? activeMachine.extruders[model.index]: null
property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack) property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack)
property bool valueError: Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" : false
// Extruder icon. Shows extruder index and has the same color as the active material. // Extruder icon. Shows extruder index and has the same color as the active material.
Cura.ExtruderIcon Cura.ExtruderIcon
@ -190,56 +189,49 @@ Cura.ExpandablePopup
rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
} }
// Label for the brand of the material // Label for the brand of the material
Label UM.Label
{ {
id: materialBrandNameLabel id: materialBrandNameLabel
text: model.material_brand + " " + model.material_name text: model.material_brand + " " + model.material_name
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default") wrapMode: Text.NoWrap
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
width: parent.width width: parent.width
visible: !truncated visible: !truncated
} }
Label UM.Label
{ {
id: materialNameLabel id: materialNameLabel
text: model.material_name text: model.material_name
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
width: parent.width width: parent.width
wrapMode: Text.NoWrap
visible: !materialBrandNameLabel.visible && !truncated visible: !materialBrandNameLabel.visible && !truncated
} }
Label UM.Label
{ {
id: materialTypeLabel id: materialTypeLabel
text: model.material_type text: model.material_type
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
width: parent.width width: parent.width
wrapMode: Text.NoWrap
visible: !materialBrandNameLabel.visible && !materialNameLabel.visible visible: !materialBrandNameLabel.visible && !materialNameLabel.visible
} }
// Label that shows the name of the variant // Label that shows the name of the variant
Label UM.Label
{ {
id: variantLabel id: variantLabel
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false visible: activeMachine ? activeMachine.hasVariants : false
text: model.variant text: model.variant
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.NoWrap
font: UM.Theme.getFont("default_bold") font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
} }
} }
@ -248,15 +240,13 @@ Cura.ExpandablePopup
} }
// Placeholder text if there is a configuration to select but no materials (so we can't show the materials per extruder). // Placeholder text if there is a configuration to select but no materials (so we can't show the materials per extruder).
Label UM.Label
{ {
text: catalog.i18nc("@label", "Select configuration") text: catalog.i18nc("@label", "Select configuration")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false visible: activeMachine ? !activeMachine.hasMaterials && (activeMachine.hasVariants || activeMachine.hasVariantBuildplates) : false
anchors anchors
{ {
@ -281,7 +271,7 @@ Cura.ExpandablePopup
onVisibleChanged: onVisibleChanged:
{ {
is_connected = Cura.MachineManager.activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate. is_connected = activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate.
// If the printer is not connected or does not have configurations, we switch always to the custom mode. If is connected instead, the auto mode // If the printer is not connected or does not have configurations, we switch always to the custom mode. If is connected instead, the auto mode
// or the previous state is selected // or the previous state is selected

View File

@ -1,12 +1,14 @@
// Copyright (c) 2019 Ultimaker B.V. //Copyright (c) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls 1.1 as OldControls
import Cura 1.0 as Cura import Cura 1.0 as Cura
import UM 1.3 as UM import UM 1.5 as UM
// Simple button for displaying text and changes appearance for various states: enabled, valueError, valueWarning
// - and hovered. Mainly used in CustomConfiguration.qml
Item Item
{ {
@ -19,14 +21,13 @@ Item
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
id: header id: header
text: catalog.i18nc("@header", "Custom") text: catalog.i18nc("@header", "Custom")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("small_button_text") color: UM.Theme.getColor("small_button_text")
height: contentHeight height: contentHeight
renderType: Text.NativeRendering
anchors anchors
{ {
@ -56,28 +57,27 @@ Item
topMargin: visible ? UM.Theme.getSize("default_margin").height : 0 topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
} }
Label UM.Label
{ {
text: catalog.i18nc("@label", "Printer") text: catalog.i18nc("@label", "Printer")
width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width
height: contentHeight height: contentHeight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.verticalCenter: printerTypeSelector.verticalCenter anchors.verticalCenter: printerTypeSelector.verticalCenter
anchors.left: parent.left anchors.left: parent.left
} }
OldControls.ToolButton Button
{ {
id: printerTypeSelector id: printerTypeSelector
text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: "" text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: ""
tooltip: text
height: UM.Theme.getSize("print_setup_big_item").height height: UM.Theme.getSize("print_setup_big_item").height
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
anchors.right: parent.right anchors.right: parent.right
style: UM.Theme.styles.print_setup_header_button onClicked: menu.open()
//style: UM.Theme.styles.print_setup_header_button
menu: Cura.PrinterTypeMenu { } Cura.PrinterTypeMenu { id: menu}
} }
} }
@ -94,6 +94,7 @@ Item
model: extrudersModel model: extrudersModel
delegate: UM.TabRowButton delegate: UM.TabRowButton
{ {
checked: model.index == 0
contentItem: Item contentItem: Item
{ {
Cura.ExtruderIcon Cura.ExtruderIcon
@ -208,23 +209,18 @@ Item
height: visible ? UM.Theme.getSize("setting_control").height : 0 height: visible ? UM.Theme.getSize("setting_control").height : 0
visible: extrudersModel.count > 1 // If there is only one extruder, there is no point to enable/disable that. visible: extrudersModel.count > 1 // If there is only one extruder, there is no point to enable/disable that.
Label UM.Label
{ {
text: catalog.i18nc("@label", "Enabled") text: catalog.i18nc("@label", "Enabled")
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height height: parent.height
width: selectors.textWidth width: selectors.textWidth
renderType: Text.NativeRendering
} }
OldControls.CheckBox UM.CheckBox
{ {
id: enabledCheckbox id: enabledCheckbox
enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder. enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder.
height: parent.height height: parent.height
style: UM.Theme.styles.checkbox
Binding Binding
{ {
@ -262,18 +258,14 @@ Item
height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0 height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false
Label UM.Label
{ {
text: catalog.i18nc("@label", "Material") text: catalog.i18nc("@label", "Material")
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height height: parent.height
width: selectors.textWidth width: selectors.textWidth
renderType: Text.NativeRendering
} }
OldControls.ToolButton Cura.PrintSetupHeaderButton
{ {
id: materialSelection id: materialSelection
@ -286,20 +278,19 @@ Item
width: selectors.controlWidth width: selectors.controlWidth
height: parent.height height: parent.height
anchors.verticalCenter: parent.verticalCenter
focusPolicy: Qt.ClickFocus
style: UM.Theme.styles.print_setup_header_button
activeFocusOnPress: true
Cura.MaterialMenu Cura.MaterialMenu
{ {
id: materialsMenu id: materialsMenu
extruderIndex: Cura.ExtruderManager.activeExtruderIndex extruderIndex: Cura.ExtruderManager.activeExtruderIndex
updateModels: materialSelection.visible updateModels: materialSelection.visible
} }
onClicked: onClicked: materialsMenu.popup()
{
materialsMenu.popup();
}
} }
Item Item
{ {
width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width
@ -328,26 +319,22 @@ Item
height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0 height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false
Label UM.Label
{ {
text: Cura.MachineManager.activeDefinitionVariantsName text: Cura.MachineManager.activeDefinitionVariantsName
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
height: parent.height height: parent.height
width: selectors.textWidth width: selectors.textWidth
renderType: Text.NativeRendering
} }
OldControls.ToolButton Cura.PrintSetupHeaderButton
{ {
id: variantSelection id: variantSelection
text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.variant.name : "" text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.variant.name : ""
tooltip: text tooltip: text
height: parent.height height: parent.height
width: selectors.controlWidth width: selectors.controlWidth
style: UM.Theme.styles.print_setup_header_button anchors.verticalCenter: parent.verticalCenter
activeFocusOnPress: true focusPolicy: Qt.ClickFocus
enabled: enabledCheckbox.checked enabled: enabledCheckbox.checked
Cura.NozzleMenu Cura.NozzleMenu
@ -355,10 +342,7 @@ Item
id: nozzlesMenu id: nozzlesMenu
extruderIndex: Cura.ExtruderManager.activeExtruderIndex extruderIndex: Cura.ExtruderManager.activeExtruderIndex
} }
onClicked: onClicked: nozzlesMenu.popup()
{
nozzlesMenu.popup();
}
} }
} }
@ -372,11 +356,10 @@ Item
property bool buildplateCompatibilityWarning: Cura.MachineManager.variantBuildplateUsable property bool buildplateCompatibilityWarning: Cura.MachineManager.variantBuildplateUsable
// This is a space holder aligning the warning messages. // This is a space holder aligning the warning messages.
Label UM.Label
{ {
text: "" text: ""
width: selectors.textWidth width: selectors.textWidth
renderType: Text.NativeRendering
} }
Item Item
@ -397,19 +380,15 @@ Item
visible: !Cura.MachineManager.isCurrentSetupSupported || warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning visible: !Cura.MachineManager.isCurrentSetupSupported || warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning
} }
Label UM.Label
{ {
id: materialCompatibilityLabel id: materialCompatibilityLabel
anchors.left: warningImage.right anchors.left: warningImage.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
verticalAlignment: Text.AlignVCenter
width: selectors.controlWidth - warningImage.width - UM.Theme.getSize("default_margin").width width: selectors.controlWidth - warningImage.width - UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@label", "Use glue for better adhesion with this material combination.") text: catalog.i18nc("@label", "Use glue for better adhesion with this material combination.")
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
visible: CuraSDKVersion == "dev" ? false : warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning visible: CuraSDKVersion == "dev" ? false : warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
renderType: Text.NativeRendering
} }
} }
} }

View File

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
@ -33,30 +33,24 @@ Item
margins: UM.Theme.getSize("default_margin").width margins: UM.Theme.getSize("default_margin").width
} }
Label UM.Label
{ {
text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.brand : " " //Use space so that the height is still correct. text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.brand : " " //Use space so that the height is still correct.
renderType: Text.NativeRendering
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_inactive") color: UM.Theme.getColor("text_inactive")
width: parent.width width: parent.width
} }
Label UM.Label
{ {
text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct. text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct.
renderType: Text.NativeRendering
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
width: parent.width width: parent.width
} }
Label UM.Label
{ {
text: (printCoreConfiguration !== null && printCoreConfiguration.hotendID) ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct. text: (printCoreConfiguration !== null && printCoreConfiguration.hotendID) ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct.
renderType: Text.NativeRendering
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_inactive") color: UM.Theme.getColor("text_inactive")
width: parent.width width: parent.width
} }

View File

@ -1,15 +1,14 @@
// Copyright (c) 2016 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Dialogs 1.2
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: base id: base
@ -18,17 +17,25 @@ Menu
property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel() property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
// Selection-related actions. // Selection-related actions.
MenuItem { action: Cura.Actions.centerSelection; } Cura.MenuItem { action: Cura.Actions.centerSelection; }
MenuItem { action: Cura.Actions.deleteSelection; } Cura.MenuItem { action: Cura.Actions.deleteSelection; }
MenuItem { action: Cura.Actions.multiplySelection; } Cura.MenuItem { action: Cura.Actions.multiplySelection; }
// Extruder selection - only visible if there is more than 1 extruder // Extruder selection - only visible if there is more than 1 extruder
MenuSeparator { visible: base.shouldShowExtruders } Cura.MenuSeparator { visible: base.shouldShowExtruders }
MenuItem { id: extruderHeader; text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount); enabled: false; visible: base.shouldShowExtruders } Cura.MenuItem
{
id: extruderHeader
text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount)
enabled: false
visible: base.shouldShowExtruders
}
Instantiator Instantiator
{ {
model: CuraApplication.getExtrudersModel() model: CuraApplication.getExtrudersModel()
MenuItem { Cura.MenuItem
{
text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant) text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant)
visible: base.shouldShowExtruders visible: base.shouldShowExtruders
enabled: UM.Selection.hasSelection && model.enabled enabled: UM.Selection.hasSelection && model.enabled
@ -37,60 +44,30 @@ Menu
onTriggered: CuraActions.setExtruderForSelection(model.id) onTriggered: CuraActions.setExtruderForSelection(model.id)
shortcut: "Ctrl+" + (model.index + 1) shortcut: "Ctrl+" + (model.index + 1)
} }
onObjectAdded: base.insertItem(index, object) // Add it to the fifth position (and above) as we want it to be added after the extruder header.
onObjectAdded: base.insertItem(index + 5, object)
onObjectRemoved: base.removeItem(object) onObjectRemoved: base.removeItem(object)
} }
MenuSeparator {
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
Instantiator
{
model: base.multiBuildPlateModel
MenuItem {
enabled: UM.Selection.hasSelection
text: base.multiBuildPlateModel.getItem(index).name;
onTriggered: CuraActions.setBuildPlateForSelection(base.multiBuildPlateModel.getItem(index).buildPlateNumber);
checkable: true
checked: base.multiBuildPlateModel.selectionBuildPlates.indexOf(base.multiBuildPlateModel.getItem(index).buildPlateNumber) != -1;
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
onObjectAdded: base.insertItem(index, object);
onObjectRemoved: base.removeItem(object);
}
MenuItem {
enabled: UM.Selection.hasSelection
text: "New build plate";
onTriggered: {
CuraActions.setBuildPlateForSelection(base.multiBuildPlateModel.maxBuildPlate + 1);
checked = false;
}
checkable: true
checked: false
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
// Global actions // Global actions
MenuSeparator {} Cura.MenuSeparator {}
MenuItem { action: Cura.Actions.selectAll; } Cura.MenuItem { action: Cura.Actions.selectAll }
MenuItem { action: Cura.Actions.arrangeAll; } Cura.MenuItem { action: Cura.Actions.arrangeAll }
MenuItem { action: Cura.Actions.deleteAll; } Cura.MenuItem { action: Cura.Actions.deleteAll }
MenuItem { action: Cura.Actions.reloadAll; } Cura.MenuItem { action: Cura.Actions.reloadAll }
MenuItem { action: Cura.Actions.resetAllTranslation; } Cura.MenuItem { action: Cura.Actions.resetAllTranslation }
MenuItem { action: Cura.Actions.resetAll; } Cura.MenuItem { action: Cura.Actions.resetAll }
// Group actions // Group actions
MenuSeparator {} Cura.MenuSeparator {}
MenuItem { action: Cura.Actions.groupObjects; } Cura.MenuItem { action: Cura.Actions.groupObjects }
MenuItem { action: Cura.Actions.mergeObjects; } Cura.MenuItem { action: Cura.Actions.mergeObjects }
MenuItem { action: Cura.Actions.unGroupObjects; } Cura.MenuItem { action: Cura.Actions.unGroupObjects }
Connections Connections
{ {
target: UM.Controller target: UM.Controller
function onContextMenuRequested() { base.popup(); } function onContextMenuRequested() { base.popup() }
} }
Connections Connections
@ -108,69 +85,56 @@ Menu
watchedProperties: [ "value" ] watchedProperties: [ "value" ]
} }
Dialog UM.Dialog
{ {
id: multiplyDialog id: multiplyDialog
modality: Qt.ApplicationModal
title: catalog.i18ncp("@title:window", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount) title: catalog.i18ncp("@title:window", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount)
width: UM.Theme.getSize("small_popup_dialog").width
height: UM.Theme.getSize("small_popup_dialog").height
minimumWidth: UM.Theme.getSize("small_popup_dialog").width
minimumHeight: UM.Theme.getSize("small_popup_dialog").height
onAccepted: CuraActions.multiplySelection(copiesField.value) onAccepted: CuraActions.multiplySelection(copiesField.value)
signal reset() buttonSpacing: UM.Theme.getSize("thin_margin").width
onReset:
{
copiesField.value = 1;
copiesField.focus = true;
}
onVisibleChanged: rightButtons:
[
Cura.SecondaryButton
{ {
copiesField.forceActiveFocus(); text: "Cancel"
onClicked: multiplyDialog.reject()
},
Cura.PrimaryButton
{
text: "Ok"
onClicked: multiplyDialog.accept()
} }
]
standardButtons: StandardButton.Ok | StandardButton.Cancel
Row Row
{ {
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
Label UM.Label
{ {
text: catalog.i18nc("@label", "Number of Copies") text: catalog.i18nc("@label", "Number of Copies")
anchors.verticalCenter: copiesField.verticalCenter anchors.verticalCenter: copiesField.verticalCenter
width: contentWidth
wrapMode: Text.NoWrap
} }
SpinBox Cura.SpinBox
{ {
id: copiesField id: copiesField
editable: true
focus: true focus: true
minimumValue: 1 from: 1
maximumValue: 99 to: 99
width: 2 * UM.Theme.getSize("button").width
} }
} }
} }
// Find the index of an item in the list of child items of this menu.
//
// This is primarily intended as a helper function so we do not have to
// hard-code the position of the extruder selection actions.
//
// \param item The item to find the index of.
//
// \return The index of the item or -1 if it was not found.
function findItemIndex(item)
{
for(var i in base.items)
{
if(base.items[i] == item)
{
return i;
}
}
return -1;
}
UM.I18nCatalog { id: catalog; name: "cura" }
} }

View File

@ -0,0 +1,28 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 2.1
import UM 1.6 as UM
import Cura 1.0 as Cura
Cura.Menu
{
title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
Cura.MenuItem { action: Cura.Actions.undo }
Cura.MenuItem { action: Cura.Actions.redo }
Cura.MenuSeparator { }
Cura.MenuItem { action: Cura.Actions.selectAll }
Cura.MenuItem { action: Cura.Actions.arrangeAll }
Cura.MenuItem { action: Cura.Actions.multiplySelection }
Cura.MenuItem { action: Cura.Actions.deleteSelection }
Cura.MenuItem { action: Cura.Actions.deleteAll }
Cura.MenuItem { action: Cura.Actions.resetAllTranslation }
Cura.MenuItem { action: Cura.Actions.resetAll }
Cura.MenuSeparator { }
Cura.MenuItem { action: Cura.Actions.groupObjects }
Cura.MenuItem { action: Cura.Actions.mergeObjects }
Cura.MenuItem { action: Cura.Actions.unGroupObjects }
}

View File

@ -0,0 +1,64 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.4
import UM 1.5 as UM
import Cura 1.0 as Cura
Cura.Menu
{
id: extensionMenu
title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions")
property var extensionModel: UM.ExtensionModel { }
Component
{
id: extensionsMenuItem
Cura.MenuItem
{
text: modelText
onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText)
}
}
Component
{
id: extensionsMenuSeparator
Cura.MenuSeparator {}
}
Instantiator
{
id: extensions
model: extensionModel
Cura.Menu
{
id: sub_menu
title: model.name
shouldBeVisible: actions !== undefined
enabled: actions != null
Instantiator
{
model: actions
Loader
{
property var extensionsModel: extensions.model
property var modelText: model.text
property var extensionName: name
sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem
}
onObjectAdded: sub_menu.insertItem(index, object.item)
onObjectRemoved: sub_menu.removeItem(object.item)
}
}
onObjectAdded: extensionMenu.insertMenu(index, object)
onObjectRemoved: extensionMenu.removeMenu(object)
}
}

View File

@ -1,46 +1,49 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: base id: base
title: catalog.i18nc("@title:menu menubar:toplevel", "&File") title: catalog.i18nc("@title:menu menubar:toplevel", "&File")
property var fileProviderModel: CuraApplication.getFileProviderModel() property var fileProviderModel: CuraApplication.getFileProviderModel()
MenuItem
Cura.MenuItem
{ {
id: newProjectMenu id: newProjectMenu
action: Cura.Actions.newProject action: Cura.Actions.newProject
} }
MenuItem Cura.MenuItem
{ {
id: openMenu id: openMenu
action: Cura.Actions.open action: Cura.Actions.open
visible: (base.fileProviderModel.count == 1) visible: base.fileProviderModel.count == 1
enabled: base.fileProviderModel.count == 1
} }
OpenFilesMenu OpenFilesMenu
{ {
id: openFilesMenu id: openFilesMenu
visible: (base.fileProviderModel.count > 1)
shouldBeVisible: base.fileProviderModel.count > 1
} }
RecentFilesMenu { } RecentFilesMenu { }
MenuItem Cura.MenuItem
{ {
id: saveWorkspaceMenu id: saveWorkspaceMenu
shortcut: visible ? StandardKey.Save : "" shortcut: StandardKey.Save
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...") text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
visible: saveProjectMenu.model.count == 1 visible: saveProjectMenu.model.count == 1
enabled: UM.WorkspaceFileHandler.enabled enabled: UM.WorkspaceFileHandler.enabled && saveProjectMenu.model.count == 1
onTriggered: onTriggered:
{ {
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" }; var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
@ -62,13 +65,13 @@ Menu
{ {
id: saveProjectMenu id: saveProjectMenu
model: projectOutputDevicesModel model: projectOutputDevicesModel
visible: model.count > 1 shouldBeVisible: model.count > 1
enabled: UM.WorkspaceFileHandler.enabled enabled: UM.WorkspaceFileHandler.enabled
} }
MenuSeparator { } Cura.MenuSeparator { }
MenuItem Cura.MenuItem
{ {
id: saveAsMenu id: saveAsMenu
text: catalog.i18nc("@title:menu menubar:file", "&Export...") text: catalog.i18nc("@title:menu menubar:file", "&Export...")
@ -79,24 +82,24 @@ Menu
} }
} }
MenuItem Cura.MenuItem
{ {
id: exportSelectionMenu id: exportSelectionMenu
text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...") text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...")
enabled: UM.Selection.hasSelection enabled: UM.Selection.hasSelection
iconName: "document-save-as" icon.name: "document-save-as"
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"}) onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"})
} }
MenuSeparator { } Cura.MenuSeparator { }
MenuItem Cura.MenuItem
{ {
id: reloadAllMenu id: reloadAllMenu
action: Cura.Actions.reloadAll action: Cura.Actions.reloadAll
} }
MenuSeparator { } Cura.MenuSeparator { }
MenuItem { action: Cura.Actions.quit } Cura.MenuItem { action: Cura.Actions.quit }
} }

View File

@ -0,0 +1,23 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.4
import UM 1.5 as UM
import Cura 1.0 as Cura
Cura.Menu
{
id: helpMenu
title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
Cura.MenuItem { action: Cura.Actions.showProfileFolder }
Cura.MenuItem { action: Cura.Actions.showTroubleshooting}
Cura.MenuItem { action: Cura.Actions.documentation }
Cura.MenuItem { action: Cura.Actions.reportBug }
Cura.MenuSeparator { }
Cura.MenuItem { action: Cura.Actions.whatsNew }
Cura.MenuItem { action: Cura.Actions.about }
}

View File

@ -1,25 +0,0 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import UM 1.2 as UM
import Cura 1.0 as Cura
Instantiator
{
model: Cura.GlobalStacksModel {}
MenuItem
{
text: model.name
checkable: true
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
exclusiveGroup: group
visible: !model.hasRemoteConnection
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
}

View File

@ -1,15 +1,15 @@
//Copyright (c) 2020 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: menu id: materialMenu
title: catalog.i18nc("@label:category menu label", "Material") title: catalog.i18nc("@label:category menu label", "Material")
property int extruderIndex: 0 property int extruderIndex: 0
@ -25,55 +25,54 @@ Menu
} }
property bool isActiveExtruderEnabled: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.isEnabled property bool isActiveExtruderEnabled: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.isEnabled
property string activeMaterialId: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.material.id property string activeMaterialId: (activeExtruder === null || activeExtruder === undefined) ? "" : activeExtruder.material.id
property bool updateModels: true property bool updateModels: true
Cura.FavoriteMaterialsModel Cura.FavoriteMaterialsModel
{ {
id: favoriteMaterialsModel id: favoriteMaterialsModel
extruderPosition: menu.extruderIndex extruderPosition: materialMenu.extruderIndex
enabled: updateModels enabled: updateModels
} }
Cura.GenericMaterialsModel Cura.GenericMaterialsModel
{ {
id: genericMaterialsModel id: genericMaterialsModel
extruderPosition: menu.extruderIndex extruderPosition: materialMenu.extruderIndex
enabled: updateModels enabled: updateModels
} }
Cura.MaterialBrandsModel Cura.MaterialBrandsModel
{ {
id: brandModel id: brandModel
extruderPosition: menu.extruderIndex extruderPosition: materialMenu.extruderIndex
enabled: updateModels enabled: updateModels
} }
MenuItem Cura.MenuItem
{ {
text: catalog.i18nc("@label:category menu label", "Favorites") text: catalog.i18nc("@label:category menu label", "Favorites")
enabled: false enabled: false
visible: favoriteMaterialsModel.items.length > 0 visible: favoriteMaterialsModel.items.length > 0
} }
Instantiator Instantiator
{ {
model: favoriteMaterialsModel model: favoriteMaterialsModel
delegate: MenuItem delegate: Cura.MenuItem
{ {
text: model.brand + " " + model.name text: model.brand + " " + model.name
checkable: true checkable: true
enabled: isActiveExtruderEnabled enabled: isActiveExtruderEnabled
checked: model.root_material_id === menu.currentRootMaterialId checked: model.root_material_id === materialMenu.currentRootMaterialId
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
exclusiveGroup: favoriteGroup // One favorite and one item from the others can be active at the same time.
} }
onObjectAdded: menu.insertItem(index, object) onObjectAdded: materialMenu.insertItem(index + 1, object)
onObjectRemoved: menu.removeItem(index) onObjectRemoved: materialMenu.removeItem(index)
} }
MenuSeparator {} Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0}
Menu Cura.Menu
{ {
id: genericMenu id: genericMenu
title: catalog.i18nc("@label:category menu label", "Generic") title: catalog.i18nc("@label:category menu label", "Generic")
@ -81,13 +80,12 @@ Menu
Instantiator Instantiator
{ {
model: genericMaterialsModel model: genericMaterialsModel
delegate: MenuItem delegate: Cura.MenuItem
{ {
text: model.name text: model.name
checkable: true checkable: true
enabled: isActiveExtruderEnabled enabled: isActiveExtruderEnabled
checked: model.root_material_id === menu.currentRootMaterialId checked: model.root_material_id === materialMenu.currentRootMaterialId
exclusiveGroup: group
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
} }
onObjectAdded: genericMenu.insertItem(index, object) onObjectAdded: genericMenu.insertItem(index, object)
@ -95,12 +93,12 @@ Menu
} }
} }
MenuSeparator {} Cura.MenuSeparator {}
Instantiator Instantiator
{ {
model: brandModel model: brandModel
Menu Cura.Menu
{ {
id: brandMenu id: brandMenu
title: brandName title: brandName
@ -110,7 +108,7 @@ Menu
Instantiator Instantiator
{ {
model: brandMaterials model: brandMaterials
delegate: Menu delegate: Cura.Menu
{ {
id: brandMaterialsMenu id: brandMaterialsMenu
title: materialName title: materialName
@ -120,47 +118,37 @@ Menu
Instantiator Instantiator
{ {
model: brandMaterialColors model: brandMaterialColors
delegate: MenuItem delegate: Cura.MenuItem
{ {
text: model.name text: model.name
checkable: true checkable: true
enabled: isActiveExtruderEnabled enabled: isActiveExtruderEnabled
checked: model.id === menu.activeMaterialId checked: model.id === materialMenu.activeMaterialId
exclusiveGroup: group
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
} }
onObjectAdded: brandMaterialsMenu.insertItem(index, object) onObjectAdded: brandMaterialsMenu.insertItem(index, object)
onObjectRemoved: brandMaterialsMenu.removeItem(object) onObjectRemoved: brandMaterialsMenu.removeItem(object)
} }
} }
onObjectAdded: brandMenu.insertItem(index, object) onObjectAdded: brandMenu.insertMenu(index, object)
onObjectRemoved: brandMenu.removeItem(object) onObjectRemoved: brandMenu.removeMenu(object)
} }
} }
onObjectAdded: menu.insertItem(index, object) onObjectAdded: materialMenu.insertMenu(index + 4, object)
onObjectRemoved: menu.removeItem(object) onObjectRemoved: materialMenu.removeMenu(object)
} }
ExclusiveGroup Cura.MenuSeparator {}
{
id: group
}
ExclusiveGroup Cura.MenuItem
{
id: favoriteGroup
}
MenuSeparator {}
MenuItem
{ {
action: Cura.Actions.manageMaterials action: Cura.Actions.manageMaterials
} }
MenuSeparator {} Cura.MenuSeparator {}
MenuItem Cura.MenuItem
{ {
action: Cura.Actions.marketplaceMaterials action: Cura.Actions.marketplaceMaterials
} }

View File

@ -1,32 +0,0 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import UM 1.2 as UM
import Cura 1.0 as Cura
Instantiator
{
model: Cura.GlobalStacksModel {}
MenuItem
{
property string connectGroupName:
{
if("group_name" in model.metadata)
{
return model.metadata["group_name"]
}
return ""
}
text: connectGroupName
checkable: true
visible: model.hasRemoteConnection
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
exclusiveGroup: group
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
}

View File

@ -1,15 +1,15 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: menu id: nozzleMenu
title: "Nozzle" title: "Nozzle"
property int extruderIndex: 0 property int extruderIndex: 0
@ -23,38 +23,34 @@ Menu
{ {
model: nozzleModel model: nozzleModel
MenuItem Cura.MenuItem
{ {
text: model.hotend_name text: model.hotend_name
checkable: true checkable: true
checked: { property var activeMachine: Cura.MachineManager.activeMachine
var activeMachine = Cura.MachineManager.activeMachine checked:
{
if (activeMachine === null) if (activeMachine === null)
{ {
return false return false
} }
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] var extruder = activeMachine.extruderList[extruderIndex]
return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name) return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name)
} }
exclusiveGroup: group
enabled: enabled:
{ {
var activeMachine = Cura.MachineManager.activeMachine
if (activeMachine === null) if (activeMachine === null)
{ {
return false return false
} }
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] var extruder = activeMachine.extruderList[extruderIndex]
return (extruder === undefined) ? false : extruder.isEnabled return (extruder === undefined) ? false : extruder.isEnabled
} }
onTriggered: { onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)
Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node);
}
} }
onObjectAdded: menu.insertItem(index, object); onObjectAdded: nozzleMenu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object); onObjectRemoved: nozzleMenu.removeItem(object)
} }
ExclusiveGroup { id: group }
} }

View File

@ -1,30 +1,26 @@
// Copyright (c) 2020 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import "../Dialogs" import "../Dialogs"
Menu Cura.Menu
{ {
id: openFilesMenu id: openFilesMenu
title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...") title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...")
iconName: "document-open-recent";
Instantiator Instantiator
{ {
id: fileProviders id: fileProviders
model: CuraApplication.getFileProviderModel() model: CuraApplication.getFileProviderModel()
MenuItem Cura.MenuItem
{ {
text: text: model.displayText
{
return model.displayText;
}
onTriggered: onTriggered:
{ {
if (model.index == 0) // The 0th element is the "From Disk" option, which should activate the open local file dialog if (model.index == 0) // The 0th element is the "From Disk" option, which should activate the open local file dialog
@ -36,11 +32,10 @@ Menu
CuraApplication.getFileProviderModel().trigger(model.name); CuraApplication.getFileProviderModel().trigger(model.name);
} }
} }
// Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts. shortcut: model.shortcut
// When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead.
shortcut: openFilesMenu.visible ? model.shortcut : ""
} }
onObjectAdded: openFilesMenu.insertItem(index, object) onObjectAdded: openFilesMenu.insertItem(index, object)
onObjectRemoved: openFilesMenu.removeItem(object) onObjectRemoved: openFilesMenu.removeItem(object)
} }
} }

View File

@ -0,0 +1,25 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.4
import UM 1.5 as UM
import Cura 1.0 as Cura
Cura.Menu
{
id: preferencesMenu
//On MacOS, don't translate the "Preferences" word.
//Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it
//attempts to delete the item upon closing the application, causing a crash.
//In the new location, these items are translated automatically according to the system's language.
//For more information, see:
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references")
Cura.MenuItem { action: Cura.Actions.preferences }
}

View File

@ -1,61 +1,77 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4
import UM 1.2 as UM import UM 1.6 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: menu id: menu
// TODO Enable custom style to the menu title: catalog.i18nc("@title:menu menubar:settings", "&Printer")
// style: MenuStyle Cura.MenuItem
// {
// frame: Rectangle
// {
// color: "white"
// }
// }
MenuItem
{ {
id: networkEnabledPrinterItem
text: catalog.i18nc("@label:category menu label", "Network enabled printers") text: catalog.i18nc("@label:category menu label", "Network enabled printers")
enabled: false enabled: false
visible: networkPrinterMenu.count > 0 visible: networKPrinterInstantiator.count > 0
} }
NetworkPrinterMenu Instantiator
{ {
id: networkPrinterMenu id: networKPrinterInstantiator
} model: Cura.GlobalStacksModel {filterOnlineOnly: true }
Cura.MenuItem
MenuSeparator
{ {
visible: networkPrinterMenu.count > 0 property string connectGroupName:
}
MenuItem
{ {
text: catalog.i18nc("@label:category menu label", "Local printers") if("group_name" in model.metadata)
enabled: false {
visible: localPrinterMenu.count > 0 return model.metadata["group_name"]
}
return ""
}
text: connectGroupName
checkable: true
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
}
onObjectAdded: menu.insertItem(2, object)
onObjectRemoved: menu.removeItem(object)
} }
LocalPrinterMenu Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 }
Cura.MenuItem
{ {
id: localPrinterMenu id: localPrinterMenu
text: catalog.i18nc("@label:category menu label", "Local printers")
enabled: false
visible: localPrinterInstantiator.count > 0
} }
ExclusiveGroup { id: group; } Instantiator
MenuSeparator
{ {
visible: localPrinterMenu.count > 0 id: localPrinterInstantiator
model: Cura.GlobalStacksModel {}
Cura.MenuItem
{
text: model.name
checkable: true
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
visible: !model.hasRemoteConnection
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
}
// A bit hackish, but we have 2 items at the end, put them before that
onObjectAdded: menu.insertItem(menu.count - 2, object)
onObjectRemoved: menu.removeItem(object)
} }
MenuItem { action: Cura.Actions.addMachine; } Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 }
MenuItem { action: Cura.Actions.configureMachines; }
Cura.MenuItem { action: Cura.Actions.addMachine }
Cura.MenuItem { action: Cura.Actions.configureMachines }
} }

View File

@ -2,12 +2,12 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: menu id: menu
title: "Printer type" title: "Printer type"
@ -18,12 +18,11 @@ Menu
id: printerTypeInstantiator id: printerTypeInstantiator
model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : [] model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []
MenuItem Cura.MenuItem
{ {
text: modelData.machine_type text: modelData.machine_type
checkable: true checkable: true
checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type
exclusiveGroup: group
onTriggered: onTriggered:
{ {
Cura.MachineManager.switchPrinterType(modelData.machine_type) Cura.MachineManager.switchPrinterType(modelData.machine_type)
@ -32,6 +31,4 @@ Menu
onObjectAdded: menu.insertItem(index, object) onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object) onObjectRemoved: menu.removeItem(object)
} }
ExclusiveGroup { id: group }
} }

View File

@ -1,26 +1,26 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import "../Dialogs" import "../Dialogs"
Menu Cura.Menu
{ {
id: menu id: menu
title: catalog.i18nc("@title:menu menubar:file", "Open &Recent") title: catalog.i18nc("@title:menu menubar:file", "Open &Recent")
iconName: "document-open-recent"; //iconName: "document-open-recent";
enabled: CuraApplication.recentFiles.length > 0; enabled: CuraApplication.recentFiles.length > 0;
Instantiator Instantiator
{ {
model: CuraApplication.recentFiles model: CuraApplication.recentFiles
MenuItem Cura.MenuItem
{ {
text: text:
{ {
@ -32,9 +32,4 @@ Menu
onObjectAdded: menu.insertItem(index, object) onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object) onObjectRemoved: menu.removeItem(object)
} }
Cura.AskOpenAsProjectOrModelsDialog
{
id: askOpenAsProjectOrModelsDialog
}
} }

View File

@ -1,15 +1,15 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import UM 1.6 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "../Dialogs" import "../Dialogs"
Menu Cura.Menu
{ {
id: saveProjectMenu id: saveProjectMenu
title: catalog.i18nc("@title:menu menubar:file", "Save Project...") title: catalog.i18nc("@title:menu menubar:file", "Save Project...")
@ -18,7 +18,7 @@ Menu
Instantiator Instantiator
{ {
id: projectOutputDevices id: projectOutputDevices
MenuItem Cura.MenuItem
{ {
text: model.name text: model.name
onTriggered: onTriggered:
@ -40,9 +40,8 @@ Menu
UM.OutputDeviceManager.requestWriteToDevice(model.id, PrintInformation.jobName, args) UM.OutputDeviceManager.requestWriteToDevice(model.id, PrintInformation.jobName, args)
} }
} }
// Unassign the shortcuts when the submenu is invisible (i.e. when there is only one project output device) to avoid ambiguous shortcuts. shortcut: model.shortcut
// When there is only the LocalFileOutputDevice, the Ctrl+S shortcut is assigned to the saveWorkspaceMenu MenuItem enabled: saveProjectMenu.shouldBeVisible
shortcut: saveProjectMenu.visible ? model.shortcut : ""
} }
onObjectAdded: saveProjectMenu.insertItem(index, object) onObjectAdded: saveProjectMenu.insertItem(index, object)
onObjectRemoved: saveProjectMenu.removeItem(object) onObjectRemoved: saveProjectMenu.removeItem(object)
@ -53,6 +52,6 @@ Menu
id: saveWorkspaceDialog id: saveWorkspaceDialog
property var args property var args
property var deviceId property var deviceId
onYes: UM.OutputDeviceManager.requestWriteToDevice(deviceId, PrintInformation.jobName, args) onAccepted: UM.OutputDeviceManager.requestWriteToDevice(deviceId, PrintInformation.jobName, args)
} }
} }

View File

@ -2,70 +2,76 @@
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Cura.Menu
{ {
id: base id: base
title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings") title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") } PrinterMenu { }
property var activeMachine: Cura.MachineManager.activeMachine property var activeMachine: Cura.MachineManager.activeMachine
Instantiator Instantiator
{ {
id: extruderInstantiator id: extruderInstantiator
model: activeMachine == null ? null : activeMachine.extruderList model: activeMachine == null ? null : activeMachine.extruderList
Menu Cura.Menu
{ {
title: modelData.name title: modelData.name
property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index] property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index]
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index } NozzleMenu
{
title: Cura.MachineManager.activeDefinitionVariantsName
shouldBeVisible: activeMachine.hasVariants
extruderIndex: index
}
MaterialMenu MaterialMenu
{ {
title: catalog.i18nc("@title:menu", "&Material") title: catalog.i18nc("@title:menu", "&Material")
visible: Cura.MachineManager.activeMachine.hasMaterials shouldBeVisible: activeMachine.hasMaterials
extruderIndex: index extruderIndex: index
updateModels: false updateModels: false
onAboutToShow: updateModels = true onAboutToShow: updateModels = true
onAboutToHide: updateModels = false onAboutToHide: updateModels = false
} }
MenuSeparator Cura.MenuSeparator
{ {
visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials
} }
MenuItem Cura.MenuItem
{ {
text: catalog.i18nc("@action:inmenu", "Set as Active Extruder") text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index)
} }
MenuItem Cura.MenuItem
{ {
text: catalog.i18nc("@action:inmenu", "Enable Extruder") text: catalog.i18nc("@action:inmenu", "Enable Extruder")
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true) onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
visible: (extruder === null || extruder === undefined) ? false : !extruder.isEnabled visible: (extruder === null || extruder === undefined) ? false : !extruder.isEnabled
height: visible ? implicitHeight: 0
} }
MenuItem Cura.MenuItem
{ {
text: catalog.i18nc("@action:inmenu", "Disable Extruder") text: catalog.i18nc("@action:inmenu", "Disable Extruder")
onTriggered: Cura.MachineManager.setExtruderEnabled(index, false) onTriggered: Cura.MachineManager.setExtruderEnabled(index, false)
visible: (extruder === null || extruder === undefined) ? false : extruder.isEnabled visible: (extruder === null || extruder === undefined) ? false : extruder.isEnabled
enabled: Cura.MachineManager.numberExtrudersEnabled > 1 enabled: Cura.MachineManager.numberExtrudersEnabled > 1
height: visible ? implicitHeight: 0
}
}
onObjectAdded: base.insertMenu(index, object)
onObjectRemoved: base.removeMenu(object)
} }
} Cura.MenuSeparator { }
onObjectAdded: base.insertItem(index, object)
onObjectRemoved: base.removeItem(object)
}
MenuSeparator { } Cura.MenuItem { action: Cura.Actions.configureSettingVisibility }
MenuItem { action: Cura.Actions.configureSettingVisibility }
} }

Some files were not shown because too many files have changed in this diff Show More