mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Apply screenScaleFactor to Cura Connect UI
Any pixel size specified in QML should not either use UM.Theme.getSize(), or use screenScaleFactor to make sure the pixel size is as intended on OSX, Windows and Linux regardless of display DPI. Contributes to CURA-4376
This commit is contained in:
parent
a7d06ff866
commit
940a8a44c8
6 changed files with 23 additions and 23 deletions
|
@ -12,7 +12,7 @@ Component
|
||||||
property var manager: Cura.MachineManager.printerOutputDevices[0]
|
property var manager: Cura.MachineManager.printerOutputDevices[0]
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
|
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
|
||||||
property var cornerRadius: 4 // TODO: Should be linked to theme.
|
property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
|
||||||
|
|
||||||
visible: manager != null
|
visible: manager != null
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Component
|
||||||
|
|
||||||
property var emphasisColor: "#44c0ff" //TODO: should be linked to theme.
|
property var emphasisColor: "#44c0ff" //TODO: should be linked to theme.
|
||||||
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
|
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
|
||||||
property var cornerRadius: 4 // TODO: Should be linked to theme.
|
property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
|
||||||
UM.I18nCatalog
|
UM.I18nCatalog
|
||||||
{
|
{
|
||||||
id: catalog
|
id: catalog
|
||||||
|
@ -50,7 +50,7 @@ Component
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
width: Math.min(800, maximumWidth)
|
width: Math.min(800 * screenScaleFactor, maximumWidth)
|
||||||
height: children.height
|
height: children.height
|
||||||
visible: OutputDevice.connectedPrinters.length != 0
|
visible: OutputDevice.connectedPrinters.length != 0
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ Component
|
||||||
delegate: PrinterInfoBlock
|
delegate: PrinterInfoBlock
|
||||||
{
|
{
|
||||||
printer: modelData
|
printer: modelData
|
||||||
width: Math.min(800, maximumWidth)
|
width: Math.min(800 * screenScaleFactor, maximumWidth)
|
||||||
height: 125
|
height: 125 * screenScaleFactor
|
||||||
|
|
||||||
// Add a 1 pix margin, as the border is sometimes cut off otherwise.
|
// Add a 1 pix margin, as the border is sometimes cut off otherwise.
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
|
@ -11,8 +11,8 @@ UM.Dialog
|
||||||
{
|
{
|
||||||
id: base;
|
id: base;
|
||||||
|
|
||||||
minimumWidth: 500
|
minimumWidth: 500 * screenScaleFactor
|
||||||
minimumHeight: 140
|
minimumHeight: 140 * screenScaleFactor
|
||||||
maximumWidth: minimumWidth
|
maximumWidth: minimumWidth
|
||||||
maximumHeight: minimumHeight
|
maximumHeight: minimumHeight
|
||||||
width: minimumWidth
|
width: minimumWidth
|
||||||
|
@ -31,7 +31,7 @@ UM.Dialog
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
height: 50
|
height: 50 * screenScaleFactor
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ UM.Dialog
|
||||||
}
|
}
|
||||||
text: "Printer selection"
|
text: "Printer selection"
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
height: 20
|
height: 20 * screenScaleFactor
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox
|
ComboBox
|
||||||
|
@ -54,7 +54,7 @@ UM.Dialog
|
||||||
textRole: "friendly_name"
|
textRole: "friendly_name"
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 40
|
height: 40 * screenScaleFactor
|
||||||
Behavior on height { NumberAnimation { duration: 100 } }
|
Behavior on height { NumberAnimation { duration: 100 } }
|
||||||
|
|
||||||
onActivated:
|
onActivated:
|
||||||
|
|
|
@ -137,7 +137,7 @@ Rectangle
|
||||||
Rectangle // Camera icon
|
Rectangle // Camera icon
|
||||||
{
|
{
|
||||||
id: showCameraIcon
|
id: showCameraIcon
|
||||||
width: 40
|
width: 40 * screenScaleFactor
|
||||||
height: width
|
height: width
|
||||||
radius: width
|
radius: width
|
||||||
anchors.right: printProgressArea.left
|
anchors.right: printProgressArea.left
|
||||||
|
@ -161,7 +161,7 @@ Rectangle
|
||||||
|
|
||||||
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
|
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
spacing: 10
|
spacing: 10 * screenScaleFactor
|
||||||
|
|
||||||
PrintCoreConfiguration
|
PrintCoreConfiguration
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@ Rectangle
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: extruderSeperator
|
id: extruderSeperator
|
||||||
width: 1
|
width: 1 * screenScaleFactor
|
||||||
height: parent.height
|
height: parent.height
|
||||||
color: lineColor
|
color: lineColor
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ Rectangle
|
||||||
width: parent.width
|
width: parent.width
|
||||||
//border.width: UM.Theme.getSize("default_lining").width
|
//border.width: UM.Theme.getSize("default_lining").width
|
||||||
//border.color: lineColor
|
//border.color: lineColor
|
||||||
height: 40
|
height: 40 * screenScaleFactor
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|
|
@ -8,8 +8,8 @@ import Cura 1.0 as Cura
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
width: 250
|
width: 250 * screenScaleFactor
|
||||||
height: 250
|
height: 250 * screenScaleFactor
|
||||||
signal clicked()
|
signal clicked()
|
||||||
MouseArea
|
MouseArea
|
||||||
{
|
{
|
||||||
|
@ -19,8 +19,8 @@ Rectangle
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
// TODO: Actually add UM icon / picture
|
// TODO: Actually add UM icon / picture
|
||||||
width: 100
|
width: 100 * screenScaleFactor
|
||||||
height: 100
|
height: 100 * screenScaleFactor
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
@ -47,7 +47,7 @@ Rectangle
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
height:10
|
height:10 * screenScaleFactor
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@ Item
|
||||||
anchors.right: cameraImage.right
|
anchors.right: cameraImage.right
|
||||||
|
|
||||||
// TODO: Harcoded sizes
|
// TODO: Harcoded sizes
|
||||||
width: 20
|
width: 20 * screenScaleFactor
|
||||||
height: 20
|
height: 20 * screenScaleFactor
|
||||||
|
|
||||||
onClicked: OutputDevice.selectAutomaticPrinter()
|
onClicked: OutputDevice.selectAutomaticPrinter()
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ Item
|
||||||
Image
|
Image
|
||||||
{
|
{
|
||||||
id: cameraImage
|
id: cameraImage
|
||||||
width: Math.min(sourceSize.width === 0 ? 800 : sourceSize.width, maximumWidth)
|
width: Math.min(sourceSize.width === 0 ? 800 * screenScaleFactor : sourceSize.width, maximumWidth)
|
||||||
height: (sourceSize.height === 0 ? 600 : sourceSize.height) * width / sourceSize.width
|
height: (sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
z: 1
|
z: 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue