From d536bbd6b9626fc354330a610b894ba76c59b3c0 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 2 Apr 2017 12:38:41 +0200 Subject: [PATCH 1/5] Fix Hi DPI issues with Workspace and Profile Changes dialogs --- plugins/3MFReader/WorkspaceDialog.qml | 12 ++++++------ resources/qml/DiscardOrKeepProfileChangesDialog.qml | 6 +++--- resources/qml/WorkspaceSummaryDialog.qml | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 6d196facc7..f9f7fbb29b 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -12,13 +12,13 @@ UM.Dialog { title: catalog.i18nc("@title:window", "Open Project") - width: 550 - minimumWidth: 550 - maximumWidth: 550 + width: 550 * Screen.devicePixelRatio + minimumWidth: 550 * Screen.devicePixelRatio + maximumWidth: minimumWidth - height: 400 - minimumHeight: 400 - maximumHeight: 400 + height: 400 * Screen.devicePixelRatio + minimumHeight: 400 * Screen.devicePixelRatio + maximumHeight: minimumHeight property int comboboxHeight: 15 property int spacerHeight: 10 onClosing: manager.notifyClosed() diff --git a/resources/qml/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/DiscardOrKeepProfileChangesDialog.qml index 51e26db2ce..7c8a21fb08 100644 --- a/resources/qml/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/DiscardOrKeepProfileChangesDialog.qml @@ -13,8 +13,8 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Discard or Keep changes") - width: 800 - height: 400 + width: 800 * Screen.devicePixelRatio + height: 400 * Screen.devicePixelRatio property var changesModel: Cura.UserChangesModel{ id: userChangesModel} onVisibilityChanged: { @@ -68,7 +68,7 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right - height: base.height - 150 + height: base.height - 150 * Screen.devicePixelRatio id: tableView Component { diff --git a/resources/qml/WorkspaceSummaryDialog.qml b/resources/qml/WorkspaceSummaryDialog.qml index 4c0a7bf86d..0a8df63a4d 100644 --- a/resources/qml/WorkspaceSummaryDialog.qml +++ b/resources/qml/WorkspaceSummaryDialog.qml @@ -13,13 +13,13 @@ UM.Dialog { title: catalog.i18nc("@title:window", "Save Project") - width: 550 - minimumWidth: 550 + width: 550 * Screen.devicePixelRatio + minimumWidth: 550 * Screen.devicePixelRatio - height: 350 - minimumHeight: 350 + height: 350 * Screen.devicePixelRatio + minimumHeight: 350 * Screen.devicePixelRatio - property int spacerHeight: 10 + property int spacerHeight: 10 * Screen.devicePixelRatio property bool dontShowAgain: true From c3e19b5ecb832f6054d3b4ede5a38a8ec64435b0 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 2 Apr 2017 14:36:40 +0200 Subject: [PATCH 2/5] Add missing import for Screen.devicePixelRatio to work --- resources/qml/DiscardOrKeepProfileChangesDialog.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/DiscardOrKeepProfileChangesDialog.qml index 7c8a21fb08..4233bb9e18 100644 --- a/resources/qml/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/DiscardOrKeepProfileChangesDialog.qml @@ -4,6 +4,7 @@ import QtQuick 2.1 import QtQuick.Controls 1.1 import QtQuick.Dialogs 1.2 +import QtQuick.Window 2.1 import UM 1.2 as UM import Cura 1.1 as Cura From 2e1dd46ea4f63cfaa61ff7469171d46611090a87 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 2 Apr 2017 14:38:11 +0200 Subject: [PATCH 3/5] Replace hardcoded color with system-theme color --- plugins/3MFReader/WorkspaceDialog.qml | 12 ++++++++---- resources/qml/WorkspaceSummaryDialog.qml | 10 +++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index f9f7fbb29b..544a717a91 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -45,8 +45,12 @@ UM.Dialog UM.I18nCatalog { - id: catalog; - name: "cura"; + id: catalog + name: "cura" + } + SystemPalette + { + id: palette } ListModel @@ -75,7 +79,7 @@ UM.Dialog Rectangle { id: separator - color: "black" + color: palette.text width: parent.width height: 1 } @@ -360,7 +364,7 @@ UM.Dialog height: width source: UM.Theme.getIcon("notice") - color: "black" + color: palette.text } Label diff --git a/resources/qml/WorkspaceSummaryDialog.qml b/resources/qml/WorkspaceSummaryDialog.qml index 0a8df63a4d..734e695579 100644 --- a/resources/qml/WorkspaceSummaryDialog.qml +++ b/resources/qml/WorkspaceSummaryDialog.qml @@ -63,8 +63,12 @@ UM.Dialog } UM.I18nCatalog { - id: catalog; - name: "cura"; + id: catalog + name: "cura" + } + SystemPalette + { + id: palette } Column @@ -80,7 +84,7 @@ UM.Dialog Rectangle { id: separator - color: "black" + color: palette.text width: parent.width height: 1 } From ed8954c1db4eefc2d87360b8830ea69fd4594a48 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 2 Apr 2017 15:31:35 +0200 Subject: [PATCH 4/5] Replace font.pixelSize with DPI-aware font.pointSize This also uses the same pointSize as eg the PreferencesPage.qml uses --- plugins/3MFReader/WorkspaceDialog.qml | 4 ++-- resources/qml/WorkspaceSummaryDialog.qml | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 544a717a91..2cf8f21012 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -74,7 +74,7 @@ UM.Dialog { id: titleLabel text: catalog.i18nc("@action:title", "Summary - Cura Project") - font.pixelSize: 22 + font.pointSize: 18 } Rectangle { @@ -97,7 +97,7 @@ UM.Dialog { text: catalog.i18nc("@action:label", "Printer settings") font.bold: true - width: parent.width /3 + width: parent.width / 3 } Item { diff --git a/resources/qml/WorkspaceSummaryDialog.qml b/resources/qml/WorkspaceSummaryDialog.qml index 734e695579..964bbf9872 100644 --- a/resources/qml/WorkspaceSummaryDialog.qml +++ b/resources/qml/WorkspaceSummaryDialog.qml @@ -66,7 +66,7 @@ UM.Dialog id: catalog name: "cura" } - SystemPalette + SystemPalette { id: palette } @@ -79,7 +79,7 @@ UM.Dialog { id: titleLabel text: catalog.i18nc("@action:title", "Summary - Cura Project") - font.pixelSize: 22 + font.pointSize: 18 } Rectangle { @@ -233,6 +233,13 @@ UM.Dialog width: parent.width / 3 } } + + Item // Spacer + { + height: spacerHeight + width: height + } + CheckBox { id: dontShowAgainCheckbox From fd09a1959b35505b3c4118d14236be2150dff397 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 2 Apr 2017 15:54:06 +0200 Subject: [PATCH 5/5] Simplify margins and make them DPI aware --- plugins/3MFReader/WorkspaceDialog.qml | 15 ++++----------- resources/qml/WorkspaceSummaryDialog.qml | 11 ++--------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index 2cf8f21012..1a8ace464d 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -19,8 +19,8 @@ UM.Dialog height: 400 * Screen.devicePixelRatio minimumHeight: 400 * Screen.devicePixelRatio maximumHeight: minimumHeight - property int comboboxHeight: 15 - property int spacerHeight: 10 + property int comboboxHeight: 15 * Screen.devicePixelRatio + property int spacerHeight: 10 * Screen.devicePixelRatio onClosing: manager.notifyClosed() onVisibleChanged: { @@ -33,15 +33,8 @@ UM.Dialog } Item { - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - - anchors.topMargin: 20 - anchors.bottomMargin: 20 - anchors.leftMargin:20 - anchors.rightMargin: 20 + anchors.fille: parent + anchors.margins: 20 * Screen.devicePixelRatio UM.I18nCatalog { diff --git a/resources/qml/WorkspaceSummaryDialog.qml b/resources/qml/WorkspaceSummaryDialog.qml index 964bbf9872..7da8495da0 100644 --- a/resources/qml/WorkspaceSummaryDialog.qml +++ b/resources/qml/WorkspaceSummaryDialog.qml @@ -41,15 +41,8 @@ UM.Dialog Item { - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - - anchors.topMargin: 20 - anchors.bottomMargin: 20 - anchors.leftMargin:20 - anchors.rightMargin: 20 + anchors.fill: parent + anchors.margins: 20 * Screen.devicePixelRatio UM.SettingDefinitionsModel {