mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
CURA-4870 Make the configuration selector only available for network
printers. Show the connection icon also for printers connected via USB or Octoprint.
This commit is contained in:
parent
7c875c154f
commit
1cf832653c
2 changed files with 23 additions and 22 deletions
|
|
@ -10,17 +10,22 @@ import UM 1.2 as UM
|
|||
import Cura 1.0 as Cura
|
||||
import "Menus"
|
||||
|
||||
ToolButton {
|
||||
ToolButton
|
||||
{
|
||||
id: base
|
||||
property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != ""
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property var printerStatus: Cura.MachineManager.printerOutputDevices.length != 0 ? "connected" : "disconnected"
|
||||
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||
|
||||
tooltip: Cura.MachineManager.activeMachineName
|
||||
|
||||
style: ButtonStyle {
|
||||
background: Rectangle {
|
||||
color: {
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
color:
|
||||
{
|
||||
if (control.pressed) {
|
||||
return UM.Theme.getColor("sidebar_header_active");
|
||||
}
|
||||
|
|
@ -33,7 +38,8 @@ ToolButton {
|
|||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
UM.RecolorImage {
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: downArrow
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
|
|
@ -46,18 +52,21 @@ ToolButton {
|
|||
source: UM.Theme.getIcon("arrow_bottom")
|
||||
}
|
||||
|
||||
PrinterStatusIcon {
|
||||
PrinterStatusIcon
|
||||
{
|
||||
id: printerStatusIcon
|
||||
visible: isNetworkPrinter
|
||||
visible: printerConnected
|
||||
status: printerStatus
|
||||
anchors {
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Label
|
||||
{
|
||||
id: sidebarComboBoxLabel
|
||||
color: UM.Theme.getColor("sidebar_header_text_active")
|
||||
text: control.text;
|
||||
|
|
@ -74,14 +83,4 @@ ToolButton {
|
|||
}
|
||||
|
||||
menu: PrinterMenu { }
|
||||
|
||||
// Make the toolbutton react when the outputdevice changes
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onOutputDevicesChanged:
|
||||
{
|
||||
base.isNetworkPrinter = Cura.MachineManager.activeMachineNetworkKey != ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue