Merge branch 'master' into PyQt6_upgrade

Conflicts:
	cura/PlatformPhysics.py -> Removed shapely on master, while QTimer import got updated to Qt6.
	plugins/Toolbox -> Entire folder is deleted in master, but it was updated to Qt6 here. This can all be removed.
This commit is contained in:
Ghostkeeper 2022-02-21 11:52:28 +01:00
commit c7d7dd11d1
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
415 changed files with 43396 additions and 36375 deletions

View file

@ -15,6 +15,7 @@ Button
property bool isIconOnRightSide: false
property alias iconSource: buttonIconLeft.source
property real iconSize: UM.Theme.getSize("action_button_icon").height
property alias textFont: buttonText.font
property alias cornerRadius: backgroundRect.radius
property alias tooltip: tooltip.tooltipText
@ -109,7 +110,7 @@ Button
{
id: buttonIconLeft
source: ""
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
height: visible ? button.iconSize : 0
width: visible ? height : 0
sourceSize.width: width
sourceSize.height: height
@ -148,8 +149,8 @@ Button
// Using parent.width is fine in fixedWidthMode.
target: buttonText
property: "width"
value: button.fixedWidthMode ? button.width - button.leftPadding - button.rightPadding
: ((maximumWidth != 0 && button.contentWidth > maximumWidth) ? maximumWidth : undefined)
value: button.fixedWidthMode ? (button.width - button.leftPadding - button.rightPadding)
: ((button.maximumWidth != 0 && button.implicitContentWidth > button.maximumWidth) ? (button.maximumWidth - (button.width - button.implicitContentWidth) * 2) : undefined)
}
}
@ -158,7 +159,7 @@ Button
{
id: buttonIconRight
source: buttonIconLeft.source
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
height: visible ? button.iconSize : 0
width: visible ? height : 0
sourceSize.width: width
sourceSize.height: height

View file

@ -1,4 +1,4 @@
// Copyright (c) 2021 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
pragma Singleton
@ -72,6 +72,7 @@ Item
property alias configureSettingVisibility: configureSettingVisibilityAction
property alias browsePackages: browsePackagesAction
property alias openMarketplace: openMarketplaceAction
UM.I18nCatalog{id: catalog; name: "cura"}
@ -215,14 +216,14 @@ Item
Action
{
id: marketplaceMaterialsAction
text: catalog.i18nc("@action:inmenu", "Add more materials from Marketplace")
text: catalog.i18nc("@action:inmenu Marketplace is a brand name of Ultimaker's, so don't translate.", "Add more materials from Marketplace")
}
Action
{
id: updateProfileAction;
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();
}
@ -480,6 +481,13 @@ Item
Action
{
id: browsePackagesAction
text: "&Marketplace"
iconName: "plugins_browse"
}
Action
{
id: openMarketplaceAction
text: catalog.i18nc("@action:menu", "&Marketplace")
iconName: "plugins_browse"
}

View file

@ -1,63 +0,0 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.1
import UM 1.3 as UM
CheckBox
{
id: checkbox
hoverEnabled: true
property alias tooltip: tooltip.text
indicator: Rectangle
{
implicitWidth: UM.Theme.getSize("checkbox").width
implicitHeight: UM.Theme.getSize("checkbox").height
x: 0
anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("main_background")
radius: UM.Theme.getSize("checkbox_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color: checkbox.hovered ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border")
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5)
sourceSize.height: width
color: UM.Theme.getColor("checkbox_mark")
source: UM.Theme.getIcon("Check")
opacity: checkbox.checked
Behavior on opacity { NumberAnimation { duration: 100; } }
}
}
contentItem: Label
{
anchors
{
left: checkbox.indicator.right
leftMargin: UM.Theme.getSize("narrow_margin").width
}
text: checkbox.text
color: UM.Theme.getColor("checkbox_text")
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
ToolTip
{
id: tooltip
text: ""
delay: 500
visible: text != "" && checkbox.hovered
}
}

View file

@ -145,13 +145,13 @@ UM.Dialog
projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" });
projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
projectsModel.append({ name: "Shapely", description: catalog.i18nc("@label", "Support library for handling planar objects"), license: "BSD", url: "https://github.com/Toblerity/Shapely" });
projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" });
projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" });
projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" });
projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
projectsModel.append({ name: "Pyclipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" });
projectsModel.append({ name: "mypy", description: catalog.i18nc("@Label", "Static type checker for Python"), license: "MIT", url: "http://mypy-lang.org/" });
projectsModel.append({ name: "certifi", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" });
projectsModel.append({ name: "cryptography", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" });

View file

@ -8,7 +8,7 @@ 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
@ -92,17 +92,11 @@ UM.Dialog
wrapMode: Text.WordWrap
}
CheckBox
UM.CheckBox
{
id: rememberChoiceCheckBox
text: catalog.i18nc("@text:window", "Remember my choice")
checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask"
style: CheckBoxStyle {
label: Label {
text: control.text
font: UM.Theme.getFont("default")
}
}
}
// Buttons

View file

@ -7,7 +7,7 @@ import QtQuick.Controls 2.0 as Controls2
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import UM 1.2 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
UM.Dialog
@ -275,7 +275,7 @@ UM.Dialog
width: parent.width
height: childrenRect.height
anchors.bottom: parent.bottom
CheckBox
UM.CheckBox
{
id: dontShowAgainCheckbox
anchors.left: parent.left

View file

@ -5,7 +5,7 @@ import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import UM 1.3 as UM
import UM 1.5 as UM
import Cura 1.1 as Cura
@ -20,7 +20,7 @@ UM.TooltipArea
property int controlHeight: UM.Theme.getSize("setting_control").height
height: childrenRect.height
height: controlHeight
width: childrenRect.width
text: tooltip
@ -57,13 +57,16 @@ UM.TooltipArea
renderType: Text.NativeRendering
}
Cura.CheckBox
UM.CheckBox
{
id: checkBox
anchors.left: fieldLabel.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors {
left: fieldLabel.right
leftMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter
}
checked: String(propertyProvider.properties.value).toLowerCase() != 'false'
height: simpleCheckBox.controlHeight
height: UM.Theme.getSize("checkbox").height
text: ""
onClicked:
{

View file

@ -196,13 +196,13 @@ Item
}
}
// show the Toolbox
// show the Marketplace
Connections
{
target: Cura.Actions.browsePackages
target: Cura.Actions.openMarketplace
function onTriggered()
{
curaExtensions.callExtensionMethod("Toolbox", "launch")
curaExtensions.callExtensionMethod("Marketplace", "show")
}
}
@ -212,8 +212,8 @@ Item
target: Cura.Actions.marketplaceMaterials
function onTriggered()
{
curaExtensions.callExtensionMethod("Toolbox", "launch")
curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials")
curaExtensions.callExtensionMethod("Marketplace", "show")
curaExtensions.callExtensionMethod("Marketplace", "setVisibleTabToMaterials")
}
}
}
}

View file

@ -83,19 +83,31 @@ Item
ExclusiveGroup { id: mainWindowHeaderMenuGroup }
}
// Shortcut button to quick access the Toolbox
Controls2.Button
{
id: marketplaceButton
text: catalog.i18nc("@action:button", "Marketplace")
height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
onClicked: Cura.Actions.browsePackages.trigger()
anchors
{
verticalCenter: parent.verticalCenter
right: applicationSwitcher.left
rightMargin: UM.Theme.getSize("default_margin").width
}
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
{
id: marketplaceButtonBorder
radius: UM.Theme.getSize("action_button_radius").width
color: UM.Theme.getColor("main_window_header_background")
border.width: UM.Theme.getSize("default_lining").width
@ -103,7 +115,6 @@ Item
Rectangle
{
id: marketplaceButtonFill
anchors.fill: parent
radius: parent.radius
color: UM.Theme.getColor("primary_text")
@ -112,33 +123,12 @@ Item
}
}
contentItem: Label
{
id: label
text: marketplaceButton.text
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("primary_text")
width: contentWidth
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
anchors
{
right: applicationSwitcher.left
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
horizontalCenter: parent.right
verticalCenter: parent.top
}
visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0

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.
import QtQuick 2.10
@ -8,7 +8,7 @@ import QtQuick.Controls.Styles 1.1
import QtQuick.Controls 2.3 as NewControls
import UM 1.1 as UM
import UM 1.5 as UM
import Cura 1.1 as Cura
UM.PreferencesPage
@ -17,6 +17,8 @@ UM.PreferencesPage
title: catalog.i18nc("@title:tab", "General")
id: generalPreferencesPage
width: parent.width
function setDefaultLanguage(languageCode)
{
//loops through the languageList and sets the language using the languageCode
@ -128,14 +130,14 @@ UM.PreferencesPage
ScrollView
{
id: preferencesScrollView
width: parent.width
height: parent.height
Column
{
//: Language selection label
UM.I18nCatalog{id: catalog; name: "cura"}
width: preferencesScrollView.viewport.width
Label
{
@ -162,16 +164,14 @@ UM.PreferencesPage
Component.onCompleted:
{
append({ text: "English", code: "en_US" })
// append({ text: "Čeština", code: "cs_CZ" })
append({ text: "Čeština", code: "cs_CZ" })
append({ text: "Deutsch", code: "de_DE" })
append({ text: "Español", code: "es_ES" })
//Finnish is disabled for being incomplete: append({ text: "Suomi", code: "fi_FI" })
append({ text: "Français", code: "fr_FR" })
append({ text: "Italiano", code: "it_IT" })
append({ text: "日本語", code: "ja_JP" })
append({ text: "한국어", code: "ko_KR" })
append({ text: "Nederlands", code: "nl_NL" })
//Polish is disabled for being incomplete: append({ text: "Polski", code: "pl_PL" })
append({ text: "Português do Brasil", code: "pt_BR" })
append({ text: "Português", code: "pt_PT" })
append({ text: "Русский", code: "ru_RU" })
@ -184,6 +184,12 @@ UM.PreferencesPage
{
append({ text: "Pirate", code: "en_7S" })
}
// incomplete and/or abandoned
append({ text: catalog.i18nc("@heading", "-- incomplete --"), code: "" })
append({ text: "Magyar", code: "hu_HU" })
append({ text: "Suomi", code: "fi_FI" })
append({ text: "Polski", code: "pl_PL" })
}
}
@ -195,8 +201,7 @@ UM.PreferencesPage
model: languageList
Layout.fillWidth: true
currentIndex:
{
function setCurrentIndex() {
var code = UM.Preferences.getValue("general/language");
for(var i = 0; i < languageList.count; ++i)
{
@ -206,13 +211,23 @@ UM.PreferencesPage
}
}
}
onActivated: UM.Preferences.setValue("general/language", model.get(index).code)
currentIndex: setCurrentIndex()
onActivated: if (model.get(index).code != "")
{
UM.Preferences.setValue("general/language", model.get(index).code);
}
else
{
currentIndex = setCurrentIndex();
}
}
Label
{
id: currencyLabel
text: catalog.i18nc("@label","Currency:")
text: catalog.i18nc("@label", "Currency:")
}
TextField
@ -289,7 +304,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.")
CheckBox
UM.CheckBox
{
id: autoSliceCheckbox
checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
@ -319,7 +334,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.")
CheckBox
UM.CheckBox
{
id: showOverhangCheckbox
@ -338,7 +353,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.")
CheckBox
UM.CheckBox
{
id: showXrayErrorCheckbox
@ -355,7 +370,7 @@ UM.PreferencesPage
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected")
CheckBox
UM.CheckBox
{
id: centerOnSelectCheckbox
text: catalog.i18nc("@action:button","Center camera when item is selected");
@ -370,7 +385,7 @@ UM.PreferencesPage
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?")
CheckBox
UM.CheckBox
{
id: invertZoomCheckbox
text: catalog.i18nc("@action:button", "Invert the direction of camera zoom.");
@ -391,7 +406,7 @@ UM.PreferencesPage
height: childrenRect.height;
text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.")
CheckBox
UM.CheckBox
{
id: zoomToMouseCheckbox
text: catalog.i18nc("@action:button", "Zoom toward mouse direction")
@ -422,7 +437,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
CheckBox
UM.CheckBox
{
id: pushFreeCheckbox
text: catalog.i18nc("@option:check", "Ensure models are kept apart")
@ -436,7 +451,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
CheckBox
UM.CheckBox
{
id: dropDownCheckbox
text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
@ -453,7 +468,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.")
CheckBox
UM.CheckBox
{
id: gcodeShowCautionCheckbox
@ -470,7 +485,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
CheckBox
UM.CheckBox
{
id: forceLayerViewCompatibilityModeCheckbox
text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
@ -485,7 +500,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?")
CheckBox
UM.CheckBox
{
id: restoreWindowPositionCheckbox
text: catalog.i18nc("@option:check", "Restore window position on start")
@ -560,7 +575,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?")
CheckBox
UM.CheckBox
{
id: singleInstanceCheckbox
text: catalog.i18nc("@option:check","Use a single instance of Cura")
@ -576,7 +591,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?")
enabled: singleInstanceCheckbox.checked
CheckBox
UM.CheckBox
{
id: singleInstanceClearBeforeLoadCheckbox
text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance")
@ -591,7 +606,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
CheckBox
UM.CheckBox
{
id: scaleToFitCheckbox
text: catalog.i18nc("@option:check","Scale large models")
@ -606,7 +621,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?")
CheckBox
UM.CheckBox
{
id: scaleTinyCheckbox
text: catalog.i18nc("@option:check","Scale extremely small models")
@ -621,7 +636,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?")
CheckBox
UM.CheckBox
{
id: selectModelsOnLoadCheckbox
text: catalog.i18nc("@option:check","Select models when loaded")
@ -636,7 +651,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
CheckBox
UM.CheckBox
{
id: prefixJobNameCheckbox
text: catalog.i18nc("@option:check", "Add machine prefix to job name")
@ -651,7 +666,7 @@ UM.PreferencesPage
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
CheckBox
UM.CheckBox
{
text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
@ -796,7 +811,7 @@ UM.PreferencesPage
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.")
CheckBox
UM.CheckBox
{
id: sendDataCheckbox
text: catalog.i18nc("@option:check","Send (anonymous) print information")
@ -835,7 +850,7 @@ UM.PreferencesPage
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?")
CheckBox
UM.CheckBox
{
id: checkUpdatesCheckbox
text: catalog.i18nc("@option:check","Check for updates on start")
@ -883,7 +898,7 @@ UM.PreferencesPage
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!")
CheckBox
UM.CheckBox
{
id: pluginNotificationsUpdateCheckbox
text: catalog.i18nc("@option:check", "Get notifications for plugin updates")

View file

@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.1
import QtQuick.Controls 2.3 as NewControls
import UM 1.2 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
@ -36,7 +36,7 @@ UM.PreferencesPage
id: base;
anchors.fill: parent;
CheckBox
UM.CheckBox
{
id: toggleVisibleSettings
anchors
@ -46,7 +46,7 @@ UM.PreferencesPage
leftMargin: UM.Theme.getSize("default_margin").width
}
text: catalog.i18nc("@label:textbox", "Check all")
checkedState:
checkState:
{
if(definitionsModel.visibleCount == definitionsModel.categoryCount)
{
@ -61,14 +61,13 @@ UM.PreferencesPage
return Qt.PartiallyChecked
}
}
partiallyCheckedEnabled: true
MouseArea
{
anchors.fill: parent;
onClicked:
{
if(parent.checkedState == Qt.Unchecked || parent.checkedState == Qt.PartiallyChecked)
if(parent.checkState == Qt.Unchecked || parent.checkState == Qt.PartiallyChecked)
{
definitionsModel.setAllExpandedVisible(true)
}

View file

@ -0,0 +1,35 @@
// Copyright (C) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import UM 1.6 as UM
import Cura 1.7 as Cura
Cura.TextField
{
UM.I18nCatalog { id: catalog; name: "cura" }
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
placeholderText: catalog.i18nc("@placeholder", "Search")
font.italic: true
UM.RecolorImage
{
id: searchIcon
anchors
{
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
}
source: UM.Theme.getIcon("Magnifier")
height: UM.Theme.getSize("small_button_icon").height
width: height
color: UM.Theme.getColor("text")
}
}

View file

@ -85,20 +85,20 @@ SettingItem
{
anchors
{
top: parent.top
bottom: parent.bottom
verticalCenter: parent.verticalCenter
left: parent.left
}
width: height
width: UM.Theme.getSize("checkbox").width
height: width
radius: UM.Theme.getSize("setting_control_radius").width
radius: UM.Theme.getSize("checkbox_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
if(!enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
return UM.Theme.getColor("checkbox_border")
}
switch (propertyProvider.properties.validationState)
{
@ -114,7 +114,7 @@ SettingItem
// Validation is OK.
if (control.containsMouse || control.activeFocus || hovered)
{
return UM.Theme.getColor("setting_control_border_highlight")
return UM.Theme.getColor("checkbox_border_hover")
}
return UM.Theme.getColor("setting_control_border")
}
@ -122,7 +122,7 @@ SettingItem
color: {
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled")
return UM.Theme.getColor("checkbox_disabled")
}
switch (propertyProvider.properties.validationState)
{
@ -140,18 +140,18 @@ SettingItem
{
return UM.Theme.getColor("setting_control_highlight")
}
return UM.Theme.getColor("setting_control")
return UM.Theme.getColor("checkbox")
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5)
height: UM.Theme.getSize("checkbox_mark").height
width: UM.Theme.getSize("checkbox_mark").width
sourceSize.height: width
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
source: UM.Theme.getIcon("Check")
source: UM.Theme.getIcon("Check", "low")
opacity: control.checked ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100; } }
}

View file

@ -41,39 +41,19 @@ Item
repeat: false
}
Cura.TextField
Cura.SearchBar
{
id: filter
height: parent.height
anchors.left: parent.left
anchors.right: parent.right
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
placeholderText: catalog.i18nc("@label:textbox", "Search settings")
font.italic: true
placeholderText: catalog.i18nc("@label:textbox", "Search settings") // Overwrite
property var expandedCategories
property bool lastFindingSettings: false
UM.RecolorImage
{
id: searchIcon
anchors
{
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
}
source: UM.Theme.getIcon("search")
height: UM.Theme.getSize("small_button_icon").height
width: height
color: UM.Theme.getColor("text")
}
onTextChanged:
{
settingsSearchTimer.restart()
}
onTextChanged: settingsSearchTimer.restart()
onEditingFinished:
{
@ -86,10 +66,7 @@ Item
}
}
Keys.onEscapePressed:
{
filter.text = ""
}
Keys.onEscapePressed: filter.text = ""
function updateDefinitionModel()
{
@ -363,7 +340,7 @@ Item
}
function onShowTooltip(text) { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) }
function onHideTooltip() { base.hideTooltip() }
function onShowAllHiddenInheritedSettings()
function onShowAllHiddenInheritedSettings(category_id)
{
var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id)
for(var i = 0; i < children_with_override.length; i++)

View file

@ -16,4 +16,5 @@ Cura.ActionButton
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
hoverColor: "transparent"
underlineTextOnHover: true
iconSize: UM.Theme.getSize("action_button_icon_small").height
}

View file

@ -38,7 +38,7 @@ ToolTip
onAboutToHide: hide()
// If the text is not set, just set the height to 0 to prevent it from showing
height: text != "" ? label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width: 0
height: label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width
x:
{
@ -74,7 +74,7 @@ ToolTip
}
function show() {
opacity = 1
opacity = text != "" ? 1 : 0
}
function hide() {

View file

@ -186,7 +186,7 @@ Item
checked: ListView.view.currentIndex == index
text: name
visible: base.currentSection == section
visible: base.currentSection.toLowerCase() === section.toLowerCase()
onClicked: ListView.view.currentIndex = index
}
}

View file

@ -1,77 +0,0 @@
// Copyright (c) 2020 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.3 as UM
import Cura 1.1 as Cura
//
// Checkbox with Cura styling.
//
CheckBox
{
id: control
hoverEnabled: true
indicator: Rectangle
{
width: control.height
height: control.height
color:
{
if (!control.enabled)
{
return UM.Theme.getColor("setting_control_disabled")
}
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_highlight")
}
return UM.Theme.getColor("setting_control")
}
radius: UM.Theme.getSize("setting_control_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5)
sourceSize.height: width
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
source: UM.Theme.getIcon("Check")
opacity: control.checked ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100; } }
}
}
contentItem: Label
{
id: textLabel
leftPadding: control.indicator.width + control.spacing
text: control.text
font: control.font
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
}
}

View file

@ -37,7 +37,7 @@ MenuItem
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
source: UM.Theme.getIcon("Check")
source: UM.Theme.getIcon("Check", "low")
color: UM.Theme.getColor("setting_control_text")
}

View file

@ -1,5 +1,5 @@
// Copyright (c) 2020 Ultimaker B.V.
// Toolbox 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.Controls 2.3

View file

@ -16,7 +16,6 @@ ViewsSelector 1.0 ViewsSelector.qml
ToolbarButton 1.0 ToolbarButton.qml
SettingView 1.0 SettingView.qml
ProfileMenu 1.0 ProfileMenu.qml
CheckBoxWithTooltip 1.0 CheckBoxWithTooltip.qml
ToolTip 1.0 ToolTip.qml
@ -28,7 +27,6 @@ WizardDialog 1.0 WizardDialog.qml
# Cura/Widgets
CheckBox 1.0 CheckBox.qml
ComboBox 1.0 ComboBox.qml
NotificationIcon 1.0 NotificationIcon.qml
RadioButton 1.0 RadioButton.qml