From 668a92952cdc9420d09c120045f8cae3ce3e14d8 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 20 Apr 2018 13:26:23 +0200 Subject: [PATCH] CURA-5035 Review changes --- plugins/Toolbox/resources/qml/Toolbox.qml | 2 +- .../resources/qml/ToolboxAuthorPage.qml | 16 +++++++------- .../resources/qml/ToolboxBackColumn.qml | 4 ++-- .../resources/qml/ToolboxDetailList.qml | 4 ++-- .../resources/qml/ToolboxDetailPage.qml | 22 +++++++++++-------- .../resources/qml/ToolboxDetailTile.qml | 4 ++-- .../qml/ToolboxDownloadsGridTile.qml | 4 ++-- .../resources/qml/ToolboxDownloadsPage.qml | 2 +- .../qml/ToolboxDownloadsShowcase.qml | 2 +- .../Toolbox/resources/qml/ToolboxFooter.qml | 4 ++-- .../resources/qml/ToolboxInstalledPage.qml | 6 ++--- .../resources/qml/ToolboxTabButton.qml | 4 ++-- resources/themes/cura-light/theme.json | 17 ++++++++++---- 13 files changed, 52 insertions(+), 39 deletions(-) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index e3ee654710..3fe5e75bb0 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -70,7 +70,7 @@ Window { id: footer visible: toolbox.restartRequired - height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0 + height: toolbox.restartRequired ? UM.Theme.getSize("toolbox_footer").height : 0 } // TODO: Clean this up: Connections diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 1cc61a07be..2fd8d7b99a 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -22,9 +22,9 @@ Item { left: sidebar.right right: parent.right - rightMargin: UM.Theme.getSize("double_margin").width + rightMargin: UM.Theme.getSize("wide_margin").width } - height: UM.Theme.getSize("base_unit").height * 12 + height: UM.Theme.getSize("toolbox_detail_header").height Image { id: thumbnail @@ -36,8 +36,8 @@ Item { top: parent.top left: parent.left - leftMargin: UM.Theme.getSize("double_margin").width - topMargin: UM.Theme.getSize("double_margin").height + leftMargin: UM.Theme.getSize("wide_margin").width + topMargin: UM.Theme.getSize("wide_margin").height } } @@ -50,7 +50,7 @@ Item left: thumbnail.right leftMargin: UM.Theme.getSize("default_margin").width right: parent.right - rightMargin: UM.Theme.getSize("double_margin").width + rightMargin: UM.Theme.getSize("wide_margin").width bottomMargin: UM.Theme.getSize("default_margin").height } text: details.name @@ -79,7 +79,7 @@ Item left: description.left topMargin: UM.Theme.getSize("default_margin").height } - spacing: Math.floor(UM.Theme.getSize("default_margin").height / 2) + spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) width: childrenRect.width Label { @@ -98,8 +98,8 @@ Item leftMargin: UM.Theme.getSize("default_margin").width topMargin: UM.Theme.getSize("default_margin").height } - spacing: Math.floor(UM.Theme.getSize("default_margin").height/2) - width: UM.Theme.getSize("base_unit").width * 12 + spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) + // width: UM.Theme.getSize("base_unit").width * 12 Label { text: diff --git a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml index 87a8f665de..0b82364fa2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml +++ b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml @@ -10,12 +10,12 @@ Item { id: sidebar height: parent.height - width: UM.Theme.getSize("base_unit").width * 6 + width: UM.Theme.getSize("toolbox_back_column").width anchors { top: parent.top left: parent.left - topMargin: UM.Theme.getSize("double_margin").height + topMargin: UM.Theme.getSize("wide_margin").height leftMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml index ebb1ae073d..1b9e6e5b45 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml @@ -19,8 +19,8 @@ Item anchors { right: base.right - topMargin: UM.Theme.getSize("double_margin").height - bottomMargin: UM.Theme.getSize("double_margin").height + topMargin: UM.Theme.getSize("wide_margin").height + bottomMargin: UM.Theme.getSize("wide_margin").height top: parent.top } height: childrenRect.height diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index d754e89ddb..9106c770ed 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -23,9 +23,9 @@ Item { left: sidebar.right right: parent.right - rightMargin: UM.Theme.getSize("double_margin").width + rightMargin: UM.Theme.getSize("wide_margin").width } - height: UM.Theme.getSize("base_unit").height * 12 + height: UM.Theme.getSize("toolbox_detail_header").height Image { id: thumbnail @@ -37,8 +37,8 @@ Item { top: parent.top left: parent.left - leftMargin: UM.Theme.getSize("double_margin").width - topMargin: UM.Theme.getSize("double_margin").height + leftMargin: UM.Theme.getSize("wide_margin").width + topMargin: UM.Theme.getSize("wide_margin").height } } @@ -51,7 +51,7 @@ Item left: thumbnail.right leftMargin: UM.Theme.getSize("default_margin").width right: parent.right - rightMargin: UM.Theme.getSize("double_margin").width + rightMargin: UM.Theme.getSize("wide_margin").width bottomMargin: UM.Theme.getSize("default_margin").height } text: details.name @@ -70,7 +70,7 @@ Item left: title.left topMargin: UM.Theme.getSize("default_margin").height } - spacing: Math.floor(UM.Theme.getSize("default_margin").height / 2) + spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) width: childrenRect.width Label { @@ -101,8 +101,8 @@ Item leftMargin: UM.Theme.getSize("default_margin").width topMargin: UM.Theme.getSize("default_margin").height } - spacing: Math.floor(UM.Theme.getSize("default_margin").height/2) - width: UM.Theme.getSize("base_unit").width * 12 + spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) + // width: UM.Theme.getSize("base_unit").width * 12 Label { text: details.version @@ -111,7 +111,11 @@ Item } Label { - text: Qt.formatDateTime(details.last_updated, "dd MMM yyyy") + text: + { + var date = new Date(details.last_updated) + return date.toLocaleString(Qt.locale()) + } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index 5c97117073..c09d3516ce 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -9,8 +9,8 @@ import UM 1.1 as UM Item { property bool installed: toolbox.isInstalled(model.id) - width: base.width - UM.Theme.getSize("double_margin").width - height: UM.Theme.getSize("base_unit").height * 8 + width: base.width - UM.Theme.getSize("wide_margin").width + height: UM.Theme.getSize("toolbox_detail_tile").height Column { anchors diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index c705f6c515..60183eadbe 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -23,7 +23,7 @@ Item { width: parent.width height: childrenRect.height - spacing: Math.floor(UM.Theme.getSize("base_unit").width / 2) + spacing: Math.floor(UM.Theme.getSize("narrow_margin").width) Rectangle { id: thumbnail @@ -44,7 +44,7 @@ Item Column { width: parent.width - thumbnail.width - parent.spacing - spacing: Math.floor(UM.Theme.getSize("base_unit").width / 2) + spacing: Math.floor(UM.Theme.getSize("narrow_margin").width) Label { id: name diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index ed905e7845..5b93ba74bc 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -18,7 +18,7 @@ ScrollView { width: base.width spacing: UM.Theme.getSize("default_margin").height - padding: UM.Theme.getSize("double_margin").height + padding: UM.Theme.getSize("wide_margin").height height: childrenRect.height + 2 * padding ToolboxDownloadsShowcase { diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml index c64c837314..f783e35305 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml @@ -14,7 +14,7 @@ Column { id: base height: childrenRect.height - spacing: UM.Theme.getSize("base_unit").height + spacing: UM.Theme.getSize("toolbox_showcase_spacing").width Label { id: heading diff --git a/plugins/Toolbox/resources/qml/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/ToolboxFooter.qml index 1dd144b0e2..eea208f552 100644 --- a/plugins/Toolbox/resources/qml/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/ToolboxFooter.qml @@ -22,7 +22,7 @@ Item { top: restartButton.top left: parent.left - leftMargin: UM.Theme.getSize("double_margin").width + leftMargin: UM.Theme.getSize("wide_margin").width right: restartButton.right rightMargin: UM.Theme.getSize("default_margin").width } @@ -36,7 +36,7 @@ Item top: parent.top topMargin: UM.Theme.getSize("default_margin").height right: parent.right - rightMargin: UM.Theme.getSize("double_margin").width + rightMargin: UM.Theme.getSize("wide_margin").width } visible: toolbox.restartRequired iconName: "dialog-restart" diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index eff055f330..c7904076dd 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -22,9 +22,9 @@ ScrollView { right: parent.right left: parent.left - leftMargin: UM.Theme.getSize("double_margin").width - topMargin: UM.Theme.getSize("double_margin").height - bottomMargin: UM.Theme.getSize("double_margin").height + leftMargin: UM.Theme.getSize("wide_margin").width + topMargin: UM.Theme.getSize("wide_margin").height + bottomMargin: UM.Theme.getSize("wide_margin").height top: parent.top } height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height diff --git a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml index 481afff67b..6991817ff5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml @@ -14,8 +14,8 @@ Button background: Rectangle { color: "transparent" - implicitWidth: UM.Theme.getSize("base_unit").height * 8 - implicitHeight: UM.Theme.getSize("base_unit").height * 4 + implicitWidth: UM.Theme.getSize("toolbox_header_tab").width + implicitHeight: UM.Theme.getSize("toolbox_header_tab").height Rectangle { visible: control.active diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 595c7307a9..f016d0eb79 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -323,13 +323,16 @@ "sizes": { "base_unit": [1.0, 1.0], "window_minimum_size": [70, 50], - "window_margin": [1.0, 1.0], - "default_margin": [1.0, 1.0], - "double_margin": [2.0, 2.0], + "default_lining": [0.08, 0.08], "default_arrow": [0.8, 0.8], "logo": [7.6, 1.6], + "default_margin": [1.0, 1.0], + "wide_margin": [2.0, 2.0], + "narrow_margin": [0.5, 0.5], + "window_margin": [1.0, 1.0], + "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], @@ -443,6 +446,12 @@ "toolbox_thumbnail_small": [6.0, 6.0], "toolbox_thumbnail_medium": [8.0, 8.0], - "toolbox_thumbnail_large": [12.0, 12.0] + "toolbox_thumbnail_large": [12.0, 12.0], + "toolbox_footer": [1.0, 5.0], + "toolbox_showcase_spacing": [1.0, 1.0], + "toolbox_header_tab": [8.0, 4.0], + "toolbox_detail_header": [1.0, 12.0], + "toolbox_detail_tile": [1.0, 8.0], + "toolbox_back_column": [6.0, 1.0] } }