Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc.lamboo <casperlamboo@gmail.com>2022-08-26 13:54:37 +0300
committerc.lamboo <casperlamboo@gmail.com>2022-08-26 13:54:37 +0300
commitd49e524bae765f4c51ffa40bc123ef2ea8e1512d (patch)
tree3b9def95b7587abc25676ff80efcb4aefb40702b /resources
parent5083d870ff9014ba760172b066723692f1c9d2ed (diff)
parentfe7960ee73f8a75fed56c3099f66164fcd25f8f3 (diff)
Merge branch 'main' into CURA-9289
Diffstat (limited to 'resources')
-rw-r--r--resources/definitions/fdmprinter.def.json4
-rw-r--r--resources/qml/PrinterSelector/MachineListButton.qml87
-rw-r--r--resources/qml/PrinterSelector/MachineSelector.qml9
-rw-r--r--resources/qml/PrinterSelector/MachineSelectorList.qml11
-rw-r--r--resources/qml/qmldir1
-rw-r--r--resources/themes/cura-light/theme.json3
6 files changed, 103 insertions, 12 deletions
diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json
index ce641cf032..4a40d1855a 100644
--- a/resources/definitions/fdmprinter.def.json
+++ b/resources/definitions/fdmprinter.def.json
@@ -6442,10 +6442,10 @@
"description": "The maximum extrusion area deviation allowed when removing intermediate points from a straight line. An intermediate point may serve as width-changing point in a long straight line. Therefore, if it is removed, it will cause the line to have a uniform width and, as a result, lose (or gain) a bit of extrusion area. If you increase this you may notice slight under- (or over-) extrusion in between straight parallel walls, as more intermediate width-changing points will be allowed to be removed. Your print will be less accurate, but the g-code will be smaller.",
"type": "float",
"unit": "μm²",
- "default_value": 2000,
+ "default_value": 50000,
"minimum_value": "0",
"minimum_value_warning": "500",
- "maximum_value_warning": "50000",
+ "maximum_value_warning": "100000",
"settable_per_mesh": true
}
}
diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml
new file mode 100644
index 0000000000..55ae5497d9
--- /dev/null
+++ b/resources/qml/PrinterSelector/MachineListButton.qml
@@ -0,0 +1,87 @@
+// Copyright (c) 2022 Ultimaker B.V.
+// Cura is released under the terms of the LGPLv3 or higher.
+
+import QtQuick 2.10
+import QtQuick.Controls 2.3
+
+import UM 1.5 as UM
+import Cura 1.0 as Cura
+
+
+Button
+{
+ id: machineListButton
+
+ width: parent.width
+ height: UM.Theme.getSize("large_button").height
+ leftPadding: UM.Theme.getSize("default_margin").width
+ rightPadding: UM.Theme.getSize("default_margin").width
+ checkable: true
+ hoverEnabled: true
+
+ contentItem: Item
+ {
+ width: machineListButton.width - machineListButton.leftPadding - machineListButton.rightPadding
+ height: UM.Theme.getSize("action_button").height
+
+ UM.ColorImage
+ {
+ id: printerIcon
+ height: UM.Theme.getSize("medium_button").height
+ width: UM.Theme.getSize("medium_button").width
+ color: UM.Theme.getColor("machine_selector_printer_icon")
+ visible: model.isAbstractMachine || !model.isOnline
+ source: model.isAbstractMachine ? UM.Theme.getIcon("PrinterTriple", "medium") : UM.Theme.getIcon("Printer", "medium")
+
+ anchors
+ {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ }
+ }
+
+ UM.Label
+ {
+ id: buttonText
+ anchors
+ {
+ left: printerIcon.right
+ right: printerCount.left
+ verticalCenter: parent.verticalCenter
+ leftMargin: UM.Theme.getSize("default_margin").width
+ }
+ text: machineListButton.text
+ font: model.isAbstractMachine ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium")
+ visible: text != ""
+ elide: Text.ElideRight
+ }
+
+ Rectangle
+ {
+ id: printerCount
+ color: UM.Theme.getColor("background_2")
+ radius: height
+ width: height
+ anchors
+ {
+ right: parent.right
+ top: buttonText.top
+ bottom: buttonText.bottom
+ }
+ visible: model.isAbstractMachine
+
+ UM.Label
+ {
+ text: model.machineCount
+ anchors.centerIn: parent
+ font: UM.Theme.getFont("default_bold")
+ }
+ }
+ }
+
+ background: Rectangle
+ {
+ id: backgroundRect
+ color: machineListButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
+ }
+}
diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml
index 77cd2be409..869d536a00 100644
--- a/resources/qml/PrinterSelector/MachineSelector.qml
+++ b/resources/qml/PrinterSelector/MachineSelector.qml
@@ -192,7 +192,7 @@ Cura.ExpandablePopup
contentItem: Item
{
id: popup
- implicitWidth: UM.Theme.getSize("machine_selector_widget_content").width
+ implicitWidth: Math.max(machineSelector.width, UM.Theme.getSize("machine_selector_widget_content").width)
implicitHeight: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry.
MachineSelectorList
{
@@ -224,6 +224,9 @@ Cura.ExpandablePopup
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+
padding: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
@@ -236,7 +239,7 @@ Cura.ExpandablePopup
// The maximum width of the button is half of the total space, minus the padding of the parent, the left
// padding of the component and half the spacing because of the space between buttons.
fixedWidthMode: true
- width: UM.Theme.getSize("machine_selector_widget_content").width / 2 - leftPadding
+ width: buttonRow.width / 2 - leftPadding * 1.5
onClicked:
{
toggleContent()
@@ -253,7 +256,7 @@ Cura.ExpandablePopup
fixedWidthMode: true
// The maximum width of the button is half of the total space, minus the padding of the parent, the right
// padding of the component and half the spacing because of the space between buttons.
- width: UM.Theme.getSize("machine_selector_widget_content").width / 2 - leftPadding
+ width: buttonRow.width / 2 - rightPadding * 1.5
onClicked:
{
toggleContent()
diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml
index ae2706f9ab..06c2fdb40c 100644
--- a/resources/qml/PrinterSelector/MachineSelectorList.qml
+++ b/resources/qml/PrinterSelector/MachineSelectorList.qml
@@ -10,8 +10,8 @@ import Cura 1.0 as Cura
ListView
{
id: listView
- model: Cura.GlobalStacksModel {}
- section.property: "hasRemoteConnection"
+ model: Cura.MachineListModel {}
+ section.property: "isOnline"
property real contentHeight: childrenRect.height
ScrollBar.vertical: UM.ScrollBar
@@ -21,7 +21,7 @@ ListView
section.delegate: UM.Label
{
- text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Preset printers")
+ text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Other printers")
width: parent.width - scrollBar.width
height: UM.Theme.getSize("action_button").height
leftPadding: UM.Theme.getSize("default_margin").width
@@ -29,13 +29,10 @@ ListView
color: UM.Theme.getColor("text_medium")
}
- delegate: MachineSelectorButton
+ delegate: MachineListButton
{
text: model.name ? model.name : ""
width: listView.width - scrollBar.width
- outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
-
- checked: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.id == model.id : false
onClicked:
{
diff --git a/resources/qml/qmldir b/resources/qml/qmldir
index a47d85545b..6ec3ca91c8 100644
--- a/resources/qml/qmldir
+++ b/resources/qml/qmldir
@@ -2,6 +2,7 @@ module Cura
MachineSelector 1.0 MachineSelector.qml
MachineSelectorButton 1.0 MachineSelectorButton.qml
+MachineListButton 1.0 MachineListButton.qml
CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml
PrintSetupSelector 1.0 PrintSetupSelector.qml
ProfileOverview 1.6 ProfileOverview.qml
diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json
index e7622bc685..809bcfdee8 100644
--- a/resources/themes/cura-light/theme.json
+++ b/resources/themes/cura-light/theme.json
@@ -564,6 +564,9 @@
"medium_button": [2.5, 2.5],
"medium_button_icon": [2, 2],
+ "large_button": [3.0, 3.0],
+ "large_button_icon": [2.8, 2.8],
+
"context_menu": [20, 2],
"icon_indicator": [1, 1],