From 17e5d1f83557d536a8aaa44e82a46fe6a36ff99c Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 6 Jul 2015 18:08:53 +0200 Subject: [PATCH] Fix styling of USB Printing control and firmware window Contributes to Ultimaker/Uranium#8 --- plugins/USBPrinting/ControlWindow.qml | 90 ++++++++++---------- plugins/USBPrinting/FirmwareUpdateWindow.qml | 10 +++ 2 files changed, 54 insertions(+), 46 deletions(-) diff --git a/plugins/USBPrinting/ControlWindow.qml b/plugins/USBPrinting/ControlWindow.qml index 91ef37c555..7d83bd9ce1 100644 --- a/plugins/USBPrinting/ControlWindow.qml +++ b/plugins/USBPrinting/ControlWindow.qml @@ -4,66 +4,64 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 +import QtQuick.Window 2.1 import UM 1.0 as UM UM.Dialog { - width: 300; height: 100 + width: 500 * Screen.devicePixelRatio; + height: 100 * Screen.devicePixelRatio; - Rectangle + title: "Print with USB" + + Column { anchors.fill: parent; - ColumnLayout + Row { - RowLayout + spacing: UM.Theme.sizes.default_margin.width; + Text { - Text - { - //: USB Printing dialog label, %1 is head temperature - text: qsTr("Extruder Temperature %1").arg(manager.extruderTemperature) - } - Text - { - //: USB Printing dialog label, %1 is bed temperature - text: qsTr("Bed Temperature %1").arg(manager.bedTemperature) - } - Text - { - text: "" + manager.error - } - + //: USB Printing dialog label, %1 is head temperature + text: qsTr("Extruder Temperature %1").arg(manager.extruderTemperature) } - RowLayout + Text { - Button - { - //: USB Printing dialog start print button - text: qsTr("Print"); - onClicked: { manager.startPrint() } - enabled: manager.progress == 0 ? true : false - } - Button - { - //: USB Printing dialog cancel print button - text: qsTr("Cancel"); - onClicked: { manager.cancelPrint() } - enabled: manager.progress == 0 ? false: true - } + //: USB Printing dialog label, %1 is bed temperature + text: qsTr("Bed Temperature %1").arg(manager.bedTemperature) } - ProgressBar + Text { - id: prog; - value: manager.progress - minimumValue: 0; - maximumValue: 100; - Layout.maximumWidth:parent.width - Layout.preferredWidth:230 - Layout.preferredHeight:25 - Layout.minimumWidth:230 - Layout.minimumHeight:25 - width: 230 - height: 25 + text: "" + manager.error } + + } + + ProgressBar + { + id: prog; + anchors.left: parent.left; + anchors.right: parent.right; + + minimumValue: 0; + maximumValue: 100; + value: manager.progress } } + + rightButtons: [ + Button { + //: USB Printing dialog start print button + text: qsTr("Print"); + onClicked: { manager.startPrint() } + enabled: manager.progress == 0 ? true : false + }, + Button + { + //: USB Printing dialog cancel print button + text: qsTr("Cancel"); + onClicked: { manager.cancelPrint() } + enabled: manager.progress == 0 ? false: true + } + ] } diff --git a/plugins/USBPrinting/FirmwareUpdateWindow.qml b/plugins/USBPrinting/FirmwareUpdateWindow.qml index 571270008c..5217e59aa1 100644 --- a/plugins/USBPrinting/FirmwareUpdateWindow.qml +++ b/plugins/USBPrinting/FirmwareUpdateWindow.qml @@ -17,6 +17,8 @@ UM.Dialog visible: true; modality: Qt.ApplicationModal; + title: "Firmware Update"; + Column { anchors.fill: parent; @@ -66,4 +68,12 @@ UM.Dialog id: palette; } } + + rightButtons: [ + Button { + text: "Close"; + enabled: manager.progress >= 100; + onClicked: base.visible = false; + } + ] }