mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-28 13:21:10 -07:00
Merge pull request #11535 from Ultimaker/CURA-8688_qt6_cleanup
[CURA-8688] QT6 cleanup
This commit is contained in:
commit
901dc55733
63 changed files with 1109 additions and 855 deletions
|
|
@ -2,11 +2,9 @@
|
|||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls 2.15 as NewControls
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
|
@ -585,7 +583,7 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: exitConfirmationDialog
|
||||
title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName)
|
||||
|
|
@ -743,14 +741,14 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: packageInstallDialog
|
||||
title: catalog.i18nc("@window:title", "Install Package")
|
||||
standardButtons: StandardButton.Ok
|
||||
}
|
||||
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: infoMultipleFilesWithGcodeDialog
|
||||
title: catalog.i18nc("@title:window", "Open File(s)")
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ UM.Dialog
|
|||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: version
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ UM.Dialog
|
|||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: description
|
||||
width: parent.width
|
||||
|
|
@ -76,7 +76,7 @@ UM.Dialog
|
|||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: creditsNotes
|
||||
width: parent.width
|
||||
|
|
@ -105,20 +105,20 @@ UM.Dialog
|
|||
delegate: Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("narrow_margin").width
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
|
||||
width: (projectsList.width * 0.25) | 0
|
||||
elide: Text.ElideRight
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: model.description
|
||||
elide: Text.ElideRight
|
||||
width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: model.license
|
||||
elide: Text.ElideRight
|
||||
|
|
@ -165,12 +165,11 @@ UM.Dialog
|
|||
}
|
||||
}
|
||||
|
||||
rightButtons: Cura.SecondaryButton
|
||||
rightButtons: Cura.TertiaryButton
|
||||
{
|
||||
//: Close about dialog button
|
||||
id: closeButton
|
||||
text: catalog.i18nc("@action:button", "Close")
|
||||
|
||||
onClicked: base.visible = false;
|
||||
onClicked: reject()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ UM.Dialog
|
|||
anchors.fill: parent
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: questionText
|
||||
width: parent.width
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ UM.Dialog
|
|||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
margin: UM.Theme.getSize("thick_margin").width
|
||||
|
||||
property var changesModel: Cura.UserChangesModel { id: userChangesModel }
|
||||
|
||||
onVisibilityChanged:
|
||||
|
|
@ -91,6 +93,9 @@ UM.Dialog
|
|||
leftButtons: [
|
||||
Cura.ComboBox
|
||||
{
|
||||
implicitHeight: UM.Theme.getSize("combobox_wide").height
|
||||
implicitWidth: UM.Theme.getSize("combobox_wide").width
|
||||
|
||||
id: discardOrKeepProfileChangesDropDownButton
|
||||
textRole: "text"
|
||||
|
||||
|
|
|
|||
20
resources/qml/Dialogs/MessageDialog.qml
Normal file
20
resources/qml/Dialogs/MessageDialog.qml
Normal 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
|
||||
}
|
||||
}
|
||||
|
|
@ -45,11 +45,7 @@ UM.Dialog
|
|||
visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
|
||||
}
|
||||
|
||||
SystemPalette
|
||||
{
|
||||
id: palette
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: mainHeading
|
||||
width: parent.width
|
||||
|
|
@ -86,7 +82,7 @@ UM.Dialog
|
|||
spacing: UM.Theme.getSize("default_margin").height
|
||||
Column
|
||||
{
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: settingsHeading
|
||||
text: catalog.i18nc("@action:label", "Printer settings")
|
||||
|
|
@ -96,14 +92,14 @@ UM.Dialog
|
|||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Type")
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
@ -111,12 +107,12 @@ UM.Dialog
|
|||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text:
|
||||
{
|
||||
|
|
@ -155,7 +151,7 @@ UM.Dialog
|
|||
var material_name = extruder.material.name
|
||||
return (material_name !== undefined) ? material_name : ""
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: {
|
||||
var extruder = Number(modelData.position)
|
||||
|
|
@ -179,7 +175,7 @@ UM.Dialog
|
|||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text:
|
||||
{
|
||||
|
|
@ -192,7 +188,7 @@ UM.Dialog
|
|||
width: Math.floor(scroll.width / 3) | 0
|
||||
enabled: modelData.isEnabled
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text:
|
||||
{
|
||||
|
|
@ -212,7 +208,7 @@ UM.Dialog
|
|||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Profile settings")
|
||||
font.bold: true
|
||||
|
|
@ -220,12 +216,12 @@ UM.Dialog
|
|||
Row
|
||||
{
|
||||
width: parent.width
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Not in profile")
|
||||
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)
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
|
|
@ -236,12 +232,12 @@ UM.Dialog
|
|||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
|
|
@ -253,12 +249,12 @@ UM.Dialog
|
|||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Intent")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeIntentCategory
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
|
|
@ -273,10 +269,9 @@ UM.Dialog
|
|||
|
||||
leftButtons:
|
||||
[
|
||||
CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
id: dontShowAgainCheckbox
|
||||
anchors.left: parent.left
|
||||
text: catalog.i18nc("@action:label", "Don't show project summary on save again")
|
||||
checked: dontShowAgain
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ Item
|
|||
property color contentBackgroundColor: UM.Theme.getColor("action_button")
|
||||
|
||||
property color headerBackgroundColor: UM.Theme.getColor("action_button")
|
||||
property color headerActiveColor: UM.Theme.getColor("secondary")
|
||||
property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
|
||||
property color headerActiveColor: UM.Theme.getColor("expandable_active")
|
||||
property color headerHoverColor: UM.Theme.getColor("expandable_hover")
|
||||
|
||||
property alias enabled: mouseArea.enabled
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Cura.RoundedRectangle
|
|||
property alias xPosCloseButton: closeButton.left
|
||||
|
||||
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
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
|
@ -27,7 +27,6 @@ Cura.RoundedRectangle
|
|||
id: headerLabel
|
||||
text: ""
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
height: parent.height
|
||||
|
||||
anchors
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ Item
|
|||
property color contentBackgroundColor: UM.Theme.getColor("action_button")
|
||||
|
||||
property color headerBackgroundColor: UM.Theme.getColor("action_button")
|
||||
property color headerActiveColor: UM.Theme.getColor("secondary")
|
||||
property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
|
||||
property color headerActiveColor: UM.Theme.getColor("expandable_active")
|
||||
property color headerHoverColor: UM.Theme.getColor("expandable_hover")
|
||||
|
||||
property alias mouseArea: headerMouseArea
|
||||
property alias enabled: headerMouseArea.enabled
|
||||
|
|
|
|||
|
|
@ -83,13 +83,12 @@ UM.TooltipArea
|
|||
height: numericTextFieldWithUnit.controlHeight
|
||||
|
||||
// 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.margins: Math.round(UM.Theme.getSize("default_lining").width)
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
|
||||
border.color:
|
||||
liningColor:
|
||||
{
|
||||
if (!textFieldWithUnit.enabled)
|
||||
{
|
||||
|
|
@ -108,9 +107,9 @@ UM.TooltipArea
|
|||
// Validation is OK.
|
||||
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:
|
||||
|
|
|
|||
|
|
@ -20,13 +20,35 @@ Item
|
|||
{
|
||||
id: applicationMenu
|
||||
width: parent.width
|
||||
FileMenu {}
|
||||
height: UM.Theme.getSize("context_menu").height
|
||||
|
||||
background: Rectangle {
|
||||
color: UM.Theme.getColor("background_1")
|
||||
}
|
||||
|
||||
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 {}
|
||||
|
||||
background: Rectangle {}
|
||||
|
||||
SettingsMenu
|
||||
{
|
||||
//On MacOS, don't translate the "Settings" word.
|
||||
|
|
@ -38,13 +60,9 @@ Item
|
|||
//- 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")
|
||||
}
|
||||
|
||||
ExtensionMenu { id: extensionMenu }
|
||||
|
||||
PreferencesMenu {}
|
||||
|
||||
HelpMenu {}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -60,7 +78,7 @@ Item
|
|||
onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
|
||||
}
|
||||
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: newProjectDialog
|
||||
|
||||
|
|
@ -97,7 +115,6 @@ Item
|
|||
target: Cura.Actions.browsePackages
|
||||
function onTriggered()
|
||||
{
|
||||
print("beepboop")
|
||||
extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ Item
|
|||
background: Rectangle
|
||||
{
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
width: contents.width
|
||||
color:
|
||||
{
|
||||
if (stageSelectorButton.checked)
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@ Item
|
|||
|
||||
width: selectors.controlWidth
|
||||
height: parent.height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
focusPolicy: Qt.ClickFocus
|
||||
|
||||
|
|
@ -289,6 +290,7 @@ Item
|
|||
}
|
||||
onClicked: materialsMenu.popup()
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width
|
||||
|
|
@ -331,6 +333,7 @@ Item
|
|||
tooltip: text
|
||||
height: parent.height
|
||||
width: selectors.controlWidth
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
focusPolicy: Qt.ClickFocus
|
||||
enabled: enabledCheckbox.checked
|
||||
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ Cura.Menu
|
|||
focus: true
|
||||
from: 1
|
||||
to: 99
|
||||
width: 2 * UM.Theme.getSize("button").width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ Cura.Menu
|
|||
Instantiator
|
||||
{
|
||||
model: brandMaterials
|
||||
delegate: Menu
|
||||
delegate: Cura.Menu
|
||||
{
|
||||
id: brandMaterialsMenu
|
||||
title: materialName
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import QtQuick.Controls 2.4
|
|||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
title: "Printer type"
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ Item
|
|||
onClicked: confirmationDialog.visible = true
|
||||
}
|
||||
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: confirmationDialog
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ UM.PreferencesPage
|
|||
title: catalog.i18nc("@title:tab", "General")
|
||||
id: generalPreferencesPage
|
||||
|
||||
width: parent.width
|
||||
width: parent ? parent.width: 0
|
||||
|
||||
function setDefaultLanguage(languageCode)
|
||||
{
|
||||
|
|
@ -554,8 +554,8 @@ UM.PreferencesPage
|
|||
|
||||
model: comboBoxList
|
||||
textRole: "text"
|
||||
width: UM.Theme.getSize("setting_control").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: UM.Theme.getSize("combobox_wide").width
|
||||
height: UM.Theme.getSize("combobox_wide").height
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
|
|
@ -711,8 +711,8 @@ UM.PreferencesPage
|
|||
Cura.ComboBox
|
||||
{
|
||||
id: choiceOnOpenProjectDropDownButton
|
||||
width: UM.Theme.getSize("setting_control").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: UM.Theme.getSize("combobox_wide").width
|
||||
height: UM.Theme.getSize("combobox_wide").height
|
||||
|
||||
model: ListModel
|
||||
{
|
||||
|
|
@ -779,8 +779,8 @@ UM.PreferencesPage
|
|||
Cura.ComboBox
|
||||
{
|
||||
id: choiceOnProfileOverrideDropDownButton
|
||||
width: UM.Theme.getSize("setting_control").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: UM.Theme.getSize("combobox_wide").width
|
||||
height: UM.Theme.getSize("combobox_wide").height
|
||||
model: ListModel
|
||||
{
|
||||
id: discardOrKeepProfileListModel
|
||||
|
|
@ -849,6 +849,7 @@ UM.PreferencesPage
|
|||
hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover")
|
||||
backgroundRadius: width / 2
|
||||
height: UM.Theme.getSize("small_button_icon").height
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
width: height
|
||||
}
|
||||
}
|
||||
|
|
@ -894,7 +895,7 @@ UM.PreferencesPage
|
|||
text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
RadioButton
|
||||
Cura.RadioButton
|
||||
{
|
||||
id: checkUpdatesOptionStable
|
||||
text: catalog.i18nc("@option:radio", "Stable releases only")
|
||||
|
|
@ -910,7 +911,7 @@ UM.PreferencesPage
|
|||
text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
RadioButton
|
||||
Cura.RadioButton
|
||||
{
|
||||
id: checkUpdatesOptionBeta
|
||||
text: catalog.i18nc("@option:radio", "Stable and Beta releases")
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ UM.ManagementPage
|
|||
}
|
||||
}
|
||||
|
||||
UM.RenameDialog
|
||||
Cura.RenameDialog
|
||||
{
|
||||
id: renameDialog
|
||||
object: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ Item
|
|||
}
|
||||
|
||||
// Dialogs
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: confirmRemoveMaterialDialog
|
||||
title: catalog.i18nc("@title:window", "Confirm Remove")
|
||||
|
|
@ -337,7 +337,7 @@ Item
|
|||
{
|
||||
const result = Cura.ContainerManager.importMaterialContainer(fileUrl);
|
||||
|
||||
const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base);
|
||||
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
|
||||
messageDialog.standardButtons = Dialog.Ok;
|
||||
messageDialog.title = catalog.i18nc("@title:window", "Import Material");
|
||||
switch (result.status)
|
||||
|
|
@ -365,7 +365,7 @@ Item
|
|||
{
|
||||
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl);
|
||||
|
||||
const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base);
|
||||
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
|
||||
messageDialog.title = catalog.i18nc("@title:window", "Export Material");
|
||||
messageDialog.standardButtons = Dialog.Ok;
|
||||
switch (result.status)
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ Window
|
|||
border.color: UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
width: printerList.width - printerListScrollBar.width
|
||||
height: UM.Theme.getSize("card").height
|
||||
height: UM.Theme.getSize("machine_selector_icon").height + 2 * UM.Theme.getSize("default_margin").height
|
||||
|
||||
property string syncStatus:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ Item
|
|||
width: base.width
|
||||
property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height
|
||||
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: confirmDiameterChangeDialog
|
||||
|
||||
|
|
|
|||
|
|
@ -137,14 +137,14 @@ UM.ManagementPage
|
|||
base.toActivateNewQuality = false;
|
||||
}
|
||||
}
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: messageDialog
|
||||
standardButtons: Dialog.Ok
|
||||
}
|
||||
|
||||
// Dialog to request a name when creating a new profile
|
||||
UM.RenameDialog
|
||||
Cura.RenameDialog
|
||||
{
|
||||
id: createQualityDialog
|
||||
title: catalog.i18nc("@title:window", "Create Profile")
|
||||
|
|
@ -233,7 +233,7 @@ UM.ManagementPage
|
|||
}
|
||||
|
||||
// Dialog to request a name when duplicating a new profile
|
||||
UM.RenameDialog
|
||||
Cura.RenameDialog
|
||||
{
|
||||
id: duplicateQualityDialog
|
||||
title: catalog.i18nc("@title:window", "Duplicate Profile")
|
||||
|
|
@ -245,7 +245,7 @@ UM.ManagementPage
|
|||
}
|
||||
|
||||
// Confirmation dialog for removing a profile
|
||||
UM.MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: confirmRemoveQualityDialog
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ UM.ManagementPage
|
|||
}
|
||||
|
||||
// Dialog to rename a quality profile
|
||||
UM.RenameDialog
|
||||
Cura.RenameDialog
|
||||
{
|
||||
id: renameQualityDialog
|
||||
title: catalog.i18nc("@title:window", "Rename Profile")
|
||||
|
|
@ -293,11 +293,6 @@ UM.ManagementPage
|
|||
}
|
||||
}
|
||||
|
||||
SystemPalette
|
||||
{
|
||||
id: palette
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
id: detailsPanelHeaderColumn
|
||||
|
|
|
|||
86
resources/qml/Preferences/RenameDialog.qml
Normal file
86
resources/qml/Preferences/RenameDialog.qml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
id: base
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
property string object: ""
|
||||
|
||||
property alias newName: nameField.text
|
||||
property bool validName: true
|
||||
property string validationError
|
||||
property string dialogTitle: catalog.i18nc("@title:window", "Rename")
|
||||
property string explanation: catalog.i18nc("@info", "Please provide a new name.")
|
||||
|
||||
title: dialogTitle
|
||||
|
||||
minimumWidth: UM.Theme.getSize("small_popup_dialog").width
|
||||
minimumHeight: UM.Theme.getSize("small_popup_dialog").height
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
property variant catalog: UM.I18nCatalog { name: "cura" }
|
||||
|
||||
signal textChanged(string text)
|
||||
signal selectText()
|
||||
onSelectText:
|
||||
{
|
||||
nameField.selectAll();
|
||||
nameField.focus = true;
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: base.explanation + "\n" //Newline to make some space using system theming.
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Cura.TextField
|
||||
{
|
||||
id: nameField
|
||||
width: parent.width
|
||||
text: base.object
|
||||
maximumLength: 40
|
||||
selectByMouse: true
|
||||
onTextChanged: base.textChanged(text)
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
visible: !base.validName
|
||||
text: base.validationError
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: cancelButton
|
||||
text: catalog.i18nc("@action:button","Cancel")
|
||||
onClicked: base.reject()
|
||||
},
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: okButton
|
||||
text: catalog.i18nc("@action:button", "OK")
|
||||
onClicked: base.accept()
|
||||
enabled: base.validName
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
TextField
|
||||
Cura.TextField
|
||||
{
|
||||
id: filter
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ UM.PreferencesPage
|
|||
Cura.ComboBox
|
||||
{
|
||||
id: visibilityPreset
|
||||
width: 150 * screenScaleFactor
|
||||
width: UM.Theme.getSize("action_button").width
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
|
|
@ -189,7 +189,6 @@ UM.PreferencesPage
|
|||
}
|
||||
|
||||
UM.I18nCatalog { name: "cura" }
|
||||
SystemPalette { id: palette }
|
||||
|
||||
Component
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ ToolButton
|
|||
{
|
||||
target: background
|
||||
color: UM.Theme.getColor("setting_control_disabled")
|
||||
border.color: UM.Theme.getColor("setting_control_disabled_border")
|
||||
liningColor: UM.Theme.getColor("setting_control_disabled_border")
|
||||
}
|
||||
},
|
||||
State
|
||||
|
|
@ -47,7 +47,7 @@ ToolButton
|
|||
{
|
||||
target: background
|
||||
color: UM.Theme.getColor("setting_validation_error_background")
|
||||
border.color: UM.Theme.getColor("setting_validation_error")
|
||||
liningColor: UM.Theme.getColor("setting_validation_error")
|
||||
}
|
||||
},
|
||||
State
|
||||
|
|
@ -58,7 +58,7 @@ ToolButton
|
|||
{
|
||||
target: background
|
||||
color: UM.Theme.getColor("setting_validation_warning_background")
|
||||
border.color: UM.Theme.getColor("setting_validation_warning")
|
||||
liningColor: UM.Theme.getColor("setting_validation_warning")
|
||||
}
|
||||
},
|
||||
State
|
||||
|
|
@ -69,7 +69,7 @@ ToolButton
|
|||
{
|
||||
target: background
|
||||
color: UM.Theme.getColor("setting_control")
|
||||
border.color: UM.Theme.getColor("setting_control_border_highlight")
|
||||
liningColor: UM.Theme.getColor("border_main_light")
|
||||
}
|
||||
},
|
||||
State
|
||||
|
|
@ -80,20 +80,15 @@ ToolButton
|
|||
{
|
||||
target: background
|
||||
color: UM.Theme.getColor("setting_control")
|
||||
border.color: UM.Theme.getColor("setting_control_border")
|
||||
liningColor: UM.Theme.getColor("border_field_light")
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
background: Rectangle
|
||||
background: UM.UnderlineBackground
|
||||
{
|
||||
id: background
|
||||
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
color: UM.Theme.getColor("setting_control")
|
||||
border.color: UM.Theme.getColor("setting_control_border")
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: downArrow
|
||||
|
|
|
|||
|
|
@ -126,13 +126,10 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
background: UM.UnderlineBackground
|
||||
{
|
||||
id: backgroundItem
|
||||
border.color: intentSelection.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
color: UM.Theme.getColor("main_background")
|
||||
liningColor: intentSelection.hovered ? UM.Theme.getColor("border_main_light") : UM.Theme.getColor("border_field_light")
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
|
@ -87,10 +86,9 @@ Item
|
|||
width: parent.width
|
||||
height: UM.Theme.getSize("print_setup_slider_handle").height // The handle is the widest element of the slider
|
||||
|
||||
minimumValue: 0
|
||||
maximumValue: 100
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
tickmarksEnabled: true
|
||||
|
||||
// disable slider when gradual support is enabled
|
||||
enabled: parseInt(infillSteps.properties.value) == 0
|
||||
|
|
@ -98,53 +96,37 @@ Item
|
|||
// set initial value from stack
|
||||
value: parseInt(infillDensity.properties.value)
|
||||
|
||||
style: SliderStyle
|
||||
//Draw line
|
||||
background: Rectangle
|
||||
{
|
||||
//Draw line
|
||||
groove: Item
|
||||
{
|
||||
Rectangle
|
||||
{
|
||||
height: UM.Theme.getSize("print_setup_slider_groove").height
|
||||
width: control.width - UM.Theme.getSize("print_setup_slider_handle").width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||
}
|
||||
}
|
||||
id: backgroundLine
|
||||
height: UM.Theme.getSize("print_setup_slider_groove").height
|
||||
width: infillSlider.width - UM.Theme.getSize("print_setup_slider_handle").width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||
|
||||
handle: Rectangle
|
||||
{
|
||||
id: handleButton
|
||||
color: control.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable")
|
||||
implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width
|
||||
implicitHeight: implicitWidth
|
||||
radius: Math.round(implicitWidth / 2)
|
||||
border.color: UM.Theme.getColor("slider_groove_fill")
|
||||
border.width: UM.Theme.getSize("default_lining").height
|
||||
}
|
||||
|
||||
tickmarks: Repeater
|
||||
Repeater
|
||||
{
|
||||
id: repeater
|
||||
model: control.maximumValue / control.stepSize + 1
|
||||
anchors.fill: parent
|
||||
model: infillSlider.to / infillSlider.stepSize + 1
|
||||
|
||||
Rectangle
|
||||
{
|
||||
color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||
color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||
implicitWidth: UM.Theme.getSize("print_setup_slider_tickmarks").width
|
||||
implicitHeight: UM.Theme.getSize("print_setup_slider_tickmarks").height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
// Do not use Math.round otherwise the tickmarks won't be aligned
|
||||
x: ((styleData.handleWidth / 2) - (implicitWidth / 2) + (index * ((repeater.width - styleData.handleWidth) / (repeater.count-1))))
|
||||
radius: Math.round(implicitWidth / 2)
|
||||
x: ((handleButton.width / 2) - (backgroundLine.implicitWidth / 2) + (index * ((repeater.width - handleButton.width) / (repeater.count-1))))
|
||||
radius: Math.round(backgroundLine.implicitWidth / 2)
|
||||
visible: (index % 10) == 0 // Only show steps of 10%
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: index
|
||||
font: UM.Theme.getFont("default")
|
||||
visible: (index % 20) == 0 // Only show steps of 20%
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: UM.Theme.getSize("thin_margin").height
|
||||
|
|
@ -155,29 +137,46 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
onValueChanged:
|
||||
handle: Rectangle
|
||||
{
|
||||
// Don't round the value if it's already the same
|
||||
if (parseInt(infillDensity.properties.value) == infillSlider.value)
|
||||
id: handleButton
|
||||
x: infillSlider.leftPadding + infillSlider.visualPosition * (infillSlider.availableWidth - width)
|
||||
y: infillSlider.topPadding + infillSlider.availableHeight / 2 - height / 2
|
||||
color: infillSlider.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable")
|
||||
implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width
|
||||
implicitHeight: implicitWidth
|
||||
radius: Math.round(implicitWidth / 2)
|
||||
border.color: UM.Theme.getColor("slider_groove_fill")
|
||||
border.width: UM.Theme.getSize("default_lining").height
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: infillSlider
|
||||
function onValueChanged()
|
||||
{
|
||||
return
|
||||
}
|
||||
// Don't round the value if it's already the same
|
||||
if (parseInt(infillDensity.properties.value) == infillSlider.value)
|
||||
{
|
||||
return
|
||||
}
|
||||
|
||||
// Round the slider value to the nearest multiple of 10 (simulate step size of 10)
|
||||
var roundedSliderValue = Math.round(infillSlider.value / 10) * 10
|
||||
// Round the slider value to the nearest multiple of 10 (simulate step size of 10)
|
||||
var roundedSliderValue = Math.round(infillSlider.value / 10) * 10
|
||||
|
||||
// Update the slider value to represent the rounded value
|
||||
infillSlider.value = roundedSliderValue
|
||||
// Update the slider value to represent the rounded value
|
||||
infillSlider.value = roundedSliderValue
|
||||
|
||||
// Update value only if the Recommended mode is Active,
|
||||
// Otherwise if I change the value in the Custom mode the Recommended view will try to repeat
|
||||
// same operation
|
||||
var active_mode = UM.Preferences.getValue("cura/active_mode")
|
||||
// Update value only if the Recommended mode is Active,
|
||||
// Otherwise if I change the value in the Custom mode the Recommended view will try to repeat
|
||||
// same operation
|
||||
const active_mode = UM.Preferences.getValue("cura/active_mode")
|
||||
|
||||
if (active_mode == 0 || active_mode == "simple")
|
||||
{
|
||||
Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue)
|
||||
Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance")
|
||||
if (active_mode == 0 || active_mode == "simple")
|
||||
{
|
||||
Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue)
|
||||
Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
// Copyright (c) 2019 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.Controls 1.4
|
||||
import QtQuick.Controls 2.3 as Controls2
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
|
@ -29,7 +28,7 @@ Item
|
|||
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Controls2.ButtonGroup
|
||||
ButtonGroup
|
||||
{
|
||||
id: activeProfileButtonGroup
|
||||
exclusive: true
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
//Copyright (c) 2019 Ultimaker B.V.
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
|
@ -35,17 +34,17 @@ Item
|
|||
id: background
|
||||
anchors.fill: parent
|
||||
|
||||
Label //Extruder name.
|
||||
// Extruder name.
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeMachine.extruderList[position].name !== "" ? Cura.MachineManager.activeMachine.extruderList[position].name : catalog.i18nc("@label", "Extruder")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Label //Target temperature.
|
||||
// Target temperature.
|
||||
UM.Label
|
||||
{
|
||||
id: extruderTargetTemperature
|
||||
text: Math.round(extruderModel.targetHotendTemperature) + "°C"
|
||||
|
|
@ -55,7 +54,8 @@ Item
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.bottom: extruderCurrentTemperature.bottom
|
||||
|
||||
MouseArea //For tooltip.
|
||||
//For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: extruderTargetTemperatureTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -77,17 +77,20 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Label //Temperature indication.
|
||||
|
||||
//Temperature indication.
|
||||
UM.Label
|
||||
{
|
||||
id: extruderCurrentTemperature
|
||||
text: Math.round(extruderModel.hotendTemperature) + "°C"
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
anchors.right: extruderTargetTemperature.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
MouseArea //For tooltip.
|
||||
|
||||
//For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: extruderCurrentTemperatureTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -110,7 +113,8 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle //Input field for pre-heat temperature.
|
||||
//Input field for pre-heat temperature.
|
||||
Rectangle
|
||||
{
|
||||
id: preheatTemperatureControl
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok")
|
||||
|
|
@ -152,14 +156,16 @@ Item
|
|||
width: UM.Theme.getSize("monitor_preheat_temperature_control").width
|
||||
height: UM.Theme.getSize("monitor_preheat_temperature_control").height
|
||||
visible: extruderModel != null ? enabled && extruderModel.canPreHeatHotends && !extruderModel.isPreheating : true
|
||||
Rectangle //Highlight of input field.
|
||||
//Highlight of input field.
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.getSize("default_lining").width
|
||||
color: UM.Theme.getColor("setting_control_highlight")
|
||||
opacity: preheatTemperatureControl.hovered ? 1.0 : 0
|
||||
}
|
||||
MouseArea //Change cursor on hovering.
|
||||
//Change cursor on hovering.
|
||||
MouseArea
|
||||
{
|
||||
id: preheatTemperatureInputMouseArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -182,7 +188,7 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: unit
|
||||
anchors.right: parent.right
|
||||
|
|
@ -191,7 +197,6 @@ Item
|
|||
|
||||
text: "°C";
|
||||
color: UM.Theme.getColor("setting_unit")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
TextInput
|
||||
{
|
||||
|
|
@ -299,7 +304,8 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle //Material colour indication.
|
||||
//Material colour indication.
|
||||
Rectangle
|
||||
{
|
||||
id: materialColor
|
||||
width: Math.floor(materialName.height * 0.75)
|
||||
|
|
@ -313,7 +319,8 @@ Item
|
|||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: materialName.verticalCenter
|
||||
|
||||
MouseArea //For tooltip.
|
||||
//For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: materialColorTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -335,17 +342,17 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Label //Material name.
|
||||
//Material name.
|
||||
UM.Label
|
||||
{
|
||||
id: materialName
|
||||
text: extruderModel.activeMaterial != null ? extruderModel.activeMaterial.type : ""
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.left: materialColor.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
MouseArea //For tooltip.
|
||||
//For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: materialNameTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -367,17 +374,18 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Label //Variant name.
|
||||
|
||||
//Variant name.
|
||||
UM.Label
|
||||
{
|
||||
id: variantName
|
||||
text: extruderModel.hotendID
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
MouseArea //For tooltip.
|
||||
//For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: variantNameTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -388,7 +396,7 @@ Item
|
|||
{
|
||||
base.showTooltip(
|
||||
base,
|
||||
{x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y},
|
||||
{ x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y },
|
||||
catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.")
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
// Copyright (c) 2017 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.Controls 1.4
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
|
@ -20,17 +19,17 @@ Item
|
|||
color: UM.Theme.getColor("main_background")
|
||||
anchors.fill: parent
|
||||
|
||||
Label //Build plate label.
|
||||
// Build plate label.
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Build plate")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Label //Target temperature.
|
||||
// Target temperature.
|
||||
UM.Label
|
||||
{
|
||||
id: bedTargetTemperature
|
||||
text: printerModel != null ? printerModel.targetBedTemperature + "°C" : ""
|
||||
|
|
@ -40,7 +39,8 @@ Item
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.bottom: bedCurrentTemperature.bottom
|
||||
|
||||
MouseArea //For tooltip.
|
||||
// For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: bedTargetTemperatureTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -62,17 +62,18 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Label //Current temperature.
|
||||
// Current temperature.
|
||||
UM.Label
|
||||
{
|
||||
id: bedCurrentTemperature
|
||||
text: printerModel != null ? printerModel.bedTemperature + "°C" : ""
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.right: bedTargetTemperature.left
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
MouseArea //For tooltip.
|
||||
//For tooltip.
|
||||
MouseArea
|
||||
{
|
||||
id: bedTemperatureTooltipArea
|
||||
hoverEnabled: true
|
||||
|
|
@ -94,7 +95,8 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Rectangle //Input field for pre-heat temperature.
|
||||
//Input field for pre-heat temperature.
|
||||
Rectangle
|
||||
{
|
||||
id: preheatTemperatureControl
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok")
|
||||
|
|
@ -166,7 +168,7 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: unit
|
||||
anchors.right: parent.right
|
||||
|
|
@ -175,7 +177,6 @@ Item
|
|||
|
||||
text: "°C";
|
||||
color: UM.Theme.getColor("setting_unit")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
TextInput
|
||||
{
|
||||
|
|
@ -213,7 +214,8 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Cura.SecondaryButton // The pre-heat button.
|
||||
// The pre-heat button.
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: preheatButton
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
|
@ -248,14 +250,15 @@ Item
|
|||
|
||||
text:
|
||||
{
|
||||
if(printerModel == null)
|
||||
if (printerModel == null)
|
||||
{
|
||||
return ""
|
||||
}
|
||||
if(printerModel.isPreheating )
|
||||
if (printerModel.isPreheating )
|
||||
{
|
||||
return catalog.i18nc("@button Cancel pre-heating", "Cancel")
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
return catalog.i18nc("@button", "Pre-heat")
|
||||
}
|
||||
|
|
@ -279,7 +282,7 @@ Item
|
|||
{
|
||||
base.showTooltip(
|
||||
base,
|
||||
{x: 0, y: preheatButton.mapToItem(base, 0, 0).y},
|
||||
{ x: 0, y: preheatButton.mapToItem(base, 0, 0).y },
|
||||
catalog.i18nc("@tooltip of pre-heat", "Heat the bed in advance before printing. You can continue adjusting your print while it is heating, and you won't have to wait for the bed to heat up when you're ready to print.")
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
|
@ -27,7 +29,7 @@ Item
|
|||
height: childrenRect.height
|
||||
color: UM.Theme.getColor("setting_category")
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: outputDeviceNameLabel
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
|
|
@ -38,7 +40,7 @@ Item
|
|||
text: outputDevice != null ? outputDevice.activePrinter.name : ""
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: outputDeviceAddressLabel
|
||||
text: (outputDevice != null && outputDevice.address != null) ? outputDevice.address : ""
|
||||
|
|
@ -49,11 +51,10 @@ Item
|
|||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.")
|
||||
color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Cura.ActionButton
|
|||
{
|
||||
color: UM.Theme.getColor("secondary_button")
|
||||
textColor: UM.Theme.getColor("secondary_button_text")
|
||||
outlineColor: UM.Theme.getColor("secondary_button_text")
|
||||
outlineColor: UM.Theme.getColor("border_accent_1")
|
||||
disabledColor: UM.Theme.getColor("action_button_disabled")
|
||||
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
|
||||
hoverColor: UM.Theme.getColor("secondary_button_hover")
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import QtQuick 2.7
|
|||
import QtQuick.Controls 2.0
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
SettingItem
|
||||
{
|
||||
id: base
|
||||
property var focusItem: control
|
||||
|
||||
contents: ComboBox
|
||||
contents: Cura.ComboBox
|
||||
{
|
||||
id: control
|
||||
anchors.fill: parent
|
||||
|
|
@ -113,7 +113,7 @@ SettingItem
|
|||
color: UM.Theme.getColor("setting_control_button");
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
background: UM.UnderlineBackground
|
||||
{
|
||||
color:
|
||||
{
|
||||
|
|
@ -127,9 +127,7 @@ SettingItem
|
|||
}
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
liningColor:
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
|
|
@ -137,9 +135,9 @@ SettingItem
|
|||
}
|
||||
if (control.hovered || control.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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -227,7 +225,6 @@ SettingItem
|
|||
background: Rectangle
|
||||
{
|
||||
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
|
||||
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import QtQuick 2.7
|
|||
import QtQuick.Controls 2.0
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
SettingItem
|
||||
{
|
||||
|
|
@ -19,7 +19,7 @@ SettingItem
|
|||
// this extra property to keep the ExtrudersModel and use this in the rest of the code.
|
||||
property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional()
|
||||
|
||||
contents: ComboBox
|
||||
contents: Cura.ComboBox
|
||||
{
|
||||
id: control
|
||||
anchors.fill: parent
|
||||
|
|
@ -111,26 +111,24 @@ SettingItem
|
|||
sourceSize.width: width + 5 * screenScaleFactor
|
||||
sourceSize.height: width + 5 * screenScaleFactor
|
||||
|
||||
color: UM.Theme.getColor("setting_control_button");
|
||||
color: UM.Theme.getColor("setting_control_button")
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
background: UM.UnderlineBackground
|
||||
{
|
||||
color:
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled");
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
}
|
||||
if (control.hovered || control.activeFocus)
|
||||
if (control.hovered || base.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_highlight");
|
||||
return UM.Theme.getColor("setting_control_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control");
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
liningColor:
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
|
|
@ -138,9 +136,9 @@ SettingItem
|
|||
}
|
||||
if (control.hovered || control.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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -214,7 +212,7 @@ SettingItem
|
|||
if (model.enabled) {
|
||||
UM.Theme.getColor("setting_control_text")
|
||||
} else {
|
||||
UM.Theme.getColor("action_button_disabled_text");
|
||||
UM.Theme.getColor("action_button_disabled_text")
|
||||
}
|
||||
}
|
||||
elide: Text.ElideRight
|
||||
|
|
@ -237,7 +235,6 @@ SettingItem
|
|||
background: Rectangle
|
||||
{
|
||||
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
|
||||
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,15 +26,13 @@ SettingItem
|
|||
}
|
||||
}
|
||||
|
||||
contents: Rectangle
|
||||
contents: UM.UnderlineBackground
|
||||
{
|
||||
id: control
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
liningColor:
|
||||
{
|
||||
if(!enabled)
|
||||
{
|
||||
|
|
@ -54,9 +52,9 @@ SettingItem
|
|||
//Validation is OK.
|
||||
if(hovered || input.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: {
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: contextMenu
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
// This component extends the funtionality of QtControls 2.x Spinboxes to
|
||||
// - be able to contain fractional values
|
||||
// - hava a "prefix" and a "suffix". A validator is added that recognizes this pre-, suf-fix combo. When adding a custom
|
||||
|
|
@ -33,11 +36,15 @@ Item
|
|||
signal editingFinished()
|
||||
implicitWidth: spinBox.implicitWidth
|
||||
implicitHeight: spinBox.implicitHeight
|
||||
|
||||
SpinBox
|
||||
{
|
||||
id: spinBox
|
||||
anchors.fill: base
|
||||
editable: base.editable
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
padding: UM.Theme.getSize("narrow_margin").width
|
||||
|
||||
// The stepSize of the SpinBox is intentionally set to be always `1`
|
||||
// As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution
|
||||
|
|
@ -65,20 +72,60 @@ Item
|
|||
base.value = value * base.stepSize;
|
||||
}
|
||||
|
||||
contentItem: TextField
|
||||
background: Item {}
|
||||
|
||||
contentItem: Cura.TextField
|
||||
{
|
||||
text: spinBox.textFromValue(spinBox.value, spinBox.locale)
|
||||
selectByMouse: base.editable
|
||||
background: Item {}
|
||||
validator: base.validator
|
||||
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
if(!activeFocus)
|
||||
if (!activeFocus)
|
||||
{
|
||||
base.editingFinished();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
down.indicator: Rectangle
|
||||
{
|
||||
x: spinBox.mirrored ? parent.width - width : 0
|
||||
height: parent.height
|
||||
width: height
|
||||
|
||||
UM.UnderlineBackground {
|
||||
color: spinBox.down.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background")
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.centerIn: parent
|
||||
height: parent.height / 2.5
|
||||
width: height
|
||||
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
|
||||
source: UM.Theme.getIcon("Minus")
|
||||
}
|
||||
}
|
||||
|
||||
up.indicator: Rectangle
|
||||
{
|
||||
x: spinBox.mirrored ? 0 : parent.width - width
|
||||
height: parent.height
|
||||
width: height
|
||||
|
||||
UM.UnderlineBackground {
|
||||
color: spinBox.up.pressed ? spinBox.palette.mid : UM.Theme.getColor("detail_background")
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.centerIn: parent
|
||||
height: parent.height / 2.5
|
||||
width: height
|
||||
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
|
||||
source: UM.Theme.getIcon("Plus")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,29 +26,18 @@ ComboBox
|
|||
{
|
||||
name: "disabled"
|
||||
when: !control.enabled
|
||||
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")}
|
||||
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")}
|
||||
PropertyChanges { target: background; color: UM.Theme.getColor("setting_control_disabled")}
|
||||
PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "highlighted"
|
||||
when: control.hovered || control.activeFocus
|
||||
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") }
|
||||
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")}
|
||||
PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main_light")}
|
||||
}
|
||||
]
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
id: backgroundRectangle
|
||||
color: UM.Theme.getColor("setting_control")
|
||||
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("setting_control_border")
|
||||
|
||||
}
|
||||
background: UM.UnderlineBackground{}
|
||||
|
||||
indicator: UM.RecolorImage
|
||||
{
|
||||
|
|
@ -157,7 +146,6 @@ ComboBox
|
|||
Rectangle
|
||||
{
|
||||
color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
|
||||
border.color: delegateItem.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
|
||||
anchors.fill: parent
|
||||
}
|
||||
text: delegateLabel.truncated ? delegateItem.text : ""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ UM.Menu
|
|||
delegate: Cura.MenuItem {}
|
||||
background: Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("setting_control")
|
||||
border.color: UM.Theme.getColor("setting_control_border")
|
||||
color: UM.Theme.getColor("main_background")
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,6 @@ UM.MenuItem
|
|||
y: UM.Theme.getSize("default_lining").width
|
||||
width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width
|
||||
height: menuItem.height - 2 * UM.Theme.getSize("default_lining").height
|
||||
|
||||
color: menuItem.highlighted ? UM.Theme.getColor("secondary"): UM.Theme.getColor("setting_control_highlight")
|
||||
color: menuItem.highlighted ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1")
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,31 @@ RadioButton
|
|||
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "checked"
|
||||
when: radioButton.checked
|
||||
PropertyChanges
|
||||
{
|
||||
target: indicator
|
||||
color: UM.Theme.getColor("accent_1")
|
||||
border.width: 0
|
||||
}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "disabled"
|
||||
when: !radioButton.enabled
|
||||
PropertyChanges { target: indicator; color: UM.Theme.getColor("background_1")}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "highlighted"
|
||||
when: radioButton.hovered || radioButton.activeFocus
|
||||
PropertyChanges { target: indicator; border.color: UM.Theme.getColor("border_main_light")}
|
||||
}
|
||||
]
|
||||
|
||||
background: Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
|
@ -29,8 +54,9 @@ RadioButton
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.alignWhenCentered: false
|
||||
radius: width / 2
|
||||
color: UM.Theme.getColor("background_2")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover")
|
||||
border.color: UM.Theme.getColor("text_disabled")
|
||||
|
||||
Rectangle
|
||||
{
|
||||
|
|
@ -38,7 +64,7 @@ RadioButton
|
|||
height: width
|
||||
anchors.centerIn: parent
|
||||
radius: width / 2
|
||||
color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button")
|
||||
color: radioButton.enabled ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
||||
visible: radioButton.checked
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
|
|
@ -17,11 +17,14 @@ TextField
|
|||
|
||||
property alias leftIcon: iconLeft.source
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
hoverEnabled: true
|
||||
selectByMouse: true
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
selectionColor: UM.Theme.getColor("text_selection")
|
||||
leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width
|
||||
|
||||
states: [
|
||||
|
|
@ -29,45 +32,25 @@ TextField
|
|||
{
|
||||
name: "disabled"
|
||||
when: !textField.enabled
|
||||
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_disabled_border")}
|
||||
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "invalid"
|
||||
when: !textField.acceptableInput
|
||||
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_validation_error")}
|
||||
PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")}
|
||||
},
|
||||
State
|
||||
{
|
||||
name: "hovered"
|
||||
when: textField.hovered || textField.activeFocus
|
||||
PropertyChanges { target: backgroundRectangle.border; color: UM.Theme.getColor("setting_control_border_highlight") }
|
||||
PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main_light")}
|
||||
}
|
||||
]
|
||||
|
||||
background: Rectangle
|
||||
background: UM.UnderlineBackground
|
||||
{
|
||||
id: backgroundRectangle
|
||||
|
||||
color: UM.Theme.getColor("main_background")
|
||||
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
|
||||
border.color:
|
||||
{
|
||||
if (!textField.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
}
|
||||
if (textField.hovered || textField.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
|
||||
//Optional icon added on the left hand side.
|
||||
UM.RecolorImage
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,3 +47,4 @@ GcodeTextArea 1.0 GcodeTextArea.qml
|
|||
NumericTextFieldWithUnit 1.0 NumericTextFieldWithUnit.qml
|
||||
PrintHeadMinMaxTextField 1.0 PrintHeadMinMaxTextField.qml
|
||||
SimpleCheckBox 1.0 SimpleCheckBox.qml
|
||||
RenameDialog 1.0 RenameDialog.qml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue