diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index 5f45d5770d..e3ee654710 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -4,17 +4,12 @@ import QtQuick 2.2 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 - -// TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles - import UM 1.1 as UM Window { id: base - title: catalog.i18nc("@title:tab", "Toolbox") + title: catalog.i18nc("@title", "Toolbox") modality: Qt.ApplicationModal width: 720 * screenScaleFactor height: 640 * screenScaleFactor @@ -22,6 +17,11 @@ Window maximumWidth: 720 * screenScaleFactor minimumHeight: 350 * screenScaleFactor color: UM.Theme.getColor("sidebar") + UM.I18nCatalog + { + id: catalog + name:"cura" + } Item { anchors.fill: parent @@ -29,11 +29,11 @@ Window { id: header } - Rectangle + Item { id: mainView width: parent.width - color: "transparent" + z: -1 anchors { top: header.bottom @@ -66,25 +66,13 @@ Window visible: toolbox.viewCategory == "installed" } } - ToolboxShadow - { - anchors.top: header.bottom - } ToolboxFooter { id: footer visible: toolbox.restartRequired height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0 } - ToolboxShadow - { - visible: toolbox.restartRequired - anchors.bottom: footer.top - reversed: true - } - - UM.I18nCatalog { id: catalog; name: "cura" } - + // TODO: Clean this up: Connections { target: toolbox @@ -96,23 +84,9 @@ Window licenseDialog.show(); } } - Connections - { - target: toolbox - onShowRestartDialog: - { - restartDialog.message = toolbox.getRestartDialogMessage(); - restartDialog.show(); - } - } ToolboxLicenseDialog { id: licenseDialog } - - ToolboxRestartDialog - { - id: restartDialog - } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 3af4f4308a..1cc61a07be 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -2,7 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -127,7 +126,8 @@ Item anchors.bottom: parent.bottom } } - ToolboxDetailList { + ToolboxDetailList + { anchors { top: header.bottom diff --git a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml index faeac08b3c..87a8f665de 100644 --- a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml +++ b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml @@ -2,7 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -23,17 +22,23 @@ Item Button { id: button - text: "Back" + text: catalog.i18nc("@action:button", "Back") UM.RecolorImage { id: backArrow - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors + { + verticalCenter: parent.verticalCenter + left: parent.left + rightMargin: UM.Theme.getSize("default_margin").width + } width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width - sourceSize.height: height + sourceSize + { + width: width + height: height + } color: button.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text") source: UM.Theme.getIcon("arrow_left") } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml index 333b2c1673..ebb1ae073d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml @@ -2,7 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 62a6db41d2..d754e89ddb 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -141,7 +141,8 @@ Item anchors.bottom: parent.bottom } } - ToolboxDetailList { + ToolboxDetailList + { anchors { top: header.bottom diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index bb19f9b8a1..5c97117073 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -2,17 +2,15 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM -Rectangle +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 - color: "transparent" Column { anchors @@ -60,9 +58,11 @@ Rectangle anchors.right: parent.right anchors.top: parent.top width: childrenRect.width - Button { + Button + { id: installButton - text: { + text: + { if (installed) { return catalog.i18nc("@action:button", "Installed") @@ -95,7 +95,8 @@ Rectangle } } opacity: enabled ? 1.0 : 0.5 - style: ButtonStyle { + style: ButtonStyle + { background: Rectangle { implicitWidth: 96 diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index b3a3a89200..0f030401f2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -2,8 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 @@ -19,7 +17,7 @@ Column Label { id: heading - text: toolbox.viewCategory == "material" ? "Maker Choices" : "Community Plugins" + text: toolbox.viewCategory == "material" ? catalog.i18nc("@label", "Maker Choices") : catalog.i18nc("@label", "Community Plugins") width: parent.width color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 77e517dc08..c705f6c515 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -2,8 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 @@ -34,7 +32,8 @@ Item color: "white" border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") - Image { + Image + { anchors.centerIn: parent width: UM.Theme.getSize("toolbox_thumbnail_small").width - 26 height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26 @@ -89,19 +88,24 @@ Item } onClicked: { - if ( toolbox.viewCategory == "material" ) + switch(toolbox.viewCategory) { - toolbox.viewSelection = model.name - toolbox.viewPage = "author" - toolbox.filterModelByProp("packages", "author_name", model.name) - toolbox.filterModelByProp("authors", "name", model.name) - } - else - { - toolbox.viewSelection = model.id - toolbox.viewPage = "detail" - toolbox.filterModelByProp("packages", "id", model.id) - toolbox.filterModelByProp("authors", "name", model.author_name) + case "material": + console.log("OKAY FILTER BY AUTHOR", model.name) + toolbox.viewSelection = model.name + toolbox.viewPage = "author" + console.log(toolbox) + var name = model.name + toolbox.filterModelByProp("authors", "name", name) + toolbox.filterModelByProp("packages", "author_name", name) + console.log(toolbox) + break + default: + toolbox.viewSelection = model.id + toolbox.viewPage = "detail" + toolbox.filterModelByProp("authors", "name", model.author_name) + toolbox.filterModelByProp("packages", "id", model.id) + break } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml index 83740fa46f..c64c837314 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml @@ -18,7 +18,7 @@ Column Label { id: heading - text: "Featured" + text: catalog.i18nc("@label", "Featured") width: parent.width color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 4b28d74a72..08fc6a4343 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -2,8 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -28,8 +26,11 @@ Item color: "white" width: UM.Theme.getSize("toolbox_thumbnail_medium").width height: UM.Theme.getSize("toolbox_thumbnail_medium").height - border.width: 1 - border.color: UM.Theme.getColor("lining") + border + { + width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("lining") + } anchors { top: parent.top @@ -37,8 +38,8 @@ Item } Image { anchors.centerIn: parent - width: UM.Theme.getSize("toolbox_thumbnail_medium").width - 26 - height: UM.Theme.getSize("toolbox_thumbnail_medium").height - 26 + width: UM.Theme.getSize("toolbox_thumbnail_medium").width - 2 * UM.Theme.getSize("default_margin") + height: UM.Theme.getSize("toolbox_thumbnail_medium").height - 2 * UM.Theme.getSize("default_margin") fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" } @@ -61,7 +62,8 @@ Item MouseArea { anchors.fill: parent - onClicked: { + onClicked: + { switch(toolbox.viewCategory) { case "material": diff --git a/plugins/Toolbox/resources/qml/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/ToolboxFooter.qml index 58b1d959df..1dd144b0e2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/ToolboxFooter.qml @@ -2,30 +2,29 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 - -// TODO: Switch to QtQuick.Controls 2.x and remove QtQuick.Controls.Styles - import UM 1.1 as UM Item { + id: footer width: parent.width anchors.bottom: parent.bottom + height: visible ? Math.floor(UM.Theme.getSize("base_unit").height * 5.5) : 0 Label { visible: toolbox.restartRequired text: "You will need to restart Cura before changes in plugins have effect." - height: UM.Theme.getSize("base_unit").height * 2 + height: Math.floor(UM.Theme.getSize("base_unit").height * 2.5) verticalAlignment: Text.AlignVCenter anchors { - top: closeButton.top + top: restartButton.top left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width + leftMargin: UM.Theme.getSize("double_margin").width + right: restartButton.right + rightMargin: UM.Theme.getSize("default_margin").width } } Button @@ -34,9 +33,10 @@ Item text: "Quit Cura" anchors { - top: closeButton.top - right: closeButton.left - rightMargin: UM.Theme.getSize("default_margin").width + top: parent.top + topMargin: UM.Theme.getSize("default_margin").height + right: parent.right + rightMargin: UM.Theme.getSize("double_margin").width } visible: toolbox.restartRequired iconName: "dialog-restart" @@ -45,65 +45,24 @@ Item { background: Rectangle { - implicitWidth: 96 - implicitHeight: UM.Theme.getSize("base_unit").height * 2 + implicitWidth: UM.Theme.getSize("base_unit").width * 8 + implicitHeight: Math.floor(UM.Theme.getSize("base_unit").height * 2.5) color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary") } label: Text { - verticalAlignment: Text.AlignVCenter color: UM.Theme.getColor("button_text") - font - { - pixelSize: 13 - bold: true - } + font: UM.Theme.getFont("default_bold") text: control.text + verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } } } - - Button + ToolboxShadow { - id: closeButton - text: catalog.i18nc("@action:button", "Close") - iconName: "dialog-close" - onClicked: - { - if ( toolbox.isDownloading ) - { - toolbox.cancelDownload() - } - base.close(); - } - anchors - { - top: parent.top - topMargin: UM.Theme.getSize("default_margin").height - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width - } - style: ButtonStyle - { - background: Rectangle - { - color: "transparent" - implicitWidth: 96 - implicitHeight: UM.Theme.getSize("base_unit").height * 2 - border - { - width: 1 - color: UM.Theme.getColor("lining") - } - } - label: Text - { - verticalAlignment: Text.AlignVCenter - color: UM.Theme.getColor("text") - text: control.text - horizontalAlignment: Text.AlignHCenter - } - } + visible: toolbox.restartRequired + anchors.bottom: footer.top + reversed: true } } diff --git a/plugins/Toolbox/resources/qml/ToolboxHeader.qml b/plugins/Toolbox/resources/qml/ToolboxHeader.qml index 5604814afd..6049900051 100644 --- a/plugins/Toolbox/resources/qml/ToolboxHeader.qml +++ b/plugins/Toolbox/resources/qml/ToolboxHeader.qml @@ -2,54 +2,29 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM -Rectangle { - +Item +{ + id: header width: parent.width - color: "transparent" - height: childrenRect.height - + height: UM.Theme.getSize("base_unit").height * 4 Row { + id: bar spacing: 12 height: childrenRect.height width: childrenRect.width - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - - Button + anchors { - text: "Plugins" - style: ButtonStyle - { - background: Rectangle - { - color: "transparent" - implicitWidth: 96 - implicitHeight: 48 - Rectangle - { - visible: toolbox.viewCategory == "plugin" - color: UM.Theme.getColor("primary") - anchors.bottom: parent.bottom - width: parent.width - height: 3 - } - } - label: Text - { - text: control.text - color: UM.Theme.getColor("text") - font.pixelSize: 15 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + } + ToolboxTabButton + { + text: catalog.i18nc("@title:tab", "Plugins") + active: toolbox.viewCategory == "plugin" onClicked: { toolbox.filterModelByProp("packages", "type", "plugin") @@ -58,35 +33,10 @@ Rectangle { toolbox.viewPage = "overview" } } - - Button + ToolboxTabButton { - text: "Materials" - style: ButtonStyle - { - background: Rectangle - { - color: "transparent" - implicitWidth: 96 - implicitHeight: 48 - Rectangle - { - visible: toolbox.viewCategory == "material" - color: UM.Theme.getColor("primary") - anchors.bottom: parent.bottom - width: parent.width - height: 3 - } - } - label: Text - { - text: control.text - color: UM.Theme.getColor("text") - font.pixelSize: 15 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } + text: catalog.i18nc("@title:tab", "Materials") + active: toolbox.viewCategory == "material" onClicked: { toolbox.filterModelByProp("packages", "type", "material") @@ -96,36 +46,19 @@ Rectangle { } } } - - Button + ToolboxTabButton { - text: "Installed" - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_margin").width - style: ButtonStyle + text: catalog.i18nc("@title:tab", "Installed") + active: toolbox.viewCategory == "installed" + anchors { - background: Rectangle - { - color: "transparent" - implicitWidth: 96 - implicitHeight: 48 - Rectangle { - visible: toolbox.viewCategory == "installed" - color: UM.Theme.getColor("primary") - anchors.bottom: parent.bottom - width: parent.width - height: 3 - } - } - label: Text - { - text: control.text - color: UM.Theme.getColor("text") - font.pixelSize: 15 - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width } onClicked: toolbox.viewCategory = "installed" } + ToolboxShadow + { + anchors.top: bar.bottom + } } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index cfcd8acf32..eff055f330 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -31,7 +31,7 @@ ScrollView Label { width: parent.width - text: "Plugins" + text: catalog.i18nc("@title:tab", "Plugins") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") } @@ -66,7 +66,7 @@ ScrollView Label { width: base.width - text: "Materials" + text: catalog.i18nc("@title:tab", "Materials") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index 3bfcee8dd3..cd51ce6954 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -2,8 +2,6 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -43,20 +41,17 @@ Item { text: model.name width: parent.width - height: 24 + height: UM.Theme.getSize("base_unit").height * 2 wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter - font { - pixelSize: 13 - bold: true - } + font: UM.Theme.getFont("default_bold") color: pluginInfo.color } Text { text: model.description width: parent.width - height: 36 + height: UM.Theme.getSize("base_unit").height * 3 clip: true wrapMode: Text.WordWrap color: pluginInfo.color @@ -66,7 +61,7 @@ Item Column { id: authorInfo - width: 192 + width: UM.Theme.getSize("base_unit").width * 16 height: parent.height anchors { @@ -89,7 +84,7 @@ Item } } width: parent.width - height: 24 + height: UM.Theme.getSize("base_unit").height * 3 wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft @@ -97,8 +92,6 @@ Item color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") } } - - // Plugin actions Column { id: pluginActions @@ -111,7 +104,6 @@ Item right: parent.right topMargin: UM.Theme.getSize("default_margin").height } - Button { id: removeButton text: @@ -131,7 +123,7 @@ Item background: Rectangle { implicitWidth: UM.Theme.getSize("base_unit").width * 8 - implicitHeight: UM.Theme.getSize("base_unit").width * 2.5 + implicitHeight: Math.floor(UM.Theme.getSize("base_unit").width * 2.5) color: "transparent" border { @@ -139,7 +131,8 @@ Item color: UM.Theme.getColor("lining") } } - label: Text { + label: Text + { text: control.text color: UM.Theme.getColor("text") verticalAlignment: Text.AlignVCenter @@ -165,8 +158,8 @@ Item } } } - - Button { + Button + { id: updateButton text: catalog.i18nc("@action:button", "Update") visible: canUpdate @@ -195,10 +188,13 @@ Item ProgressBar { id: progressbar - anchors.left: updateButton.left - anchors.right: updateButton.right - anchors.top: updateButton.bottom - anchors.topMargin: 4 + anchors + { + left: updateButton.left + right: updateButton.right + top: updateButton.bottom + topMargin: Math.floor(UM.Theme.getSize("base_unit") / 4) + } value: toolbox.isDownloading ? toolbox.downloadProgress : 0 visible: toolbox.isDownloading style: ProgressBarStyle diff --git a/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml b/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml index 9109f407c8..655edc9447 100644 --- a/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml +++ b/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml @@ -11,22 +11,19 @@ import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM -UM.Dialog { +UM.Dialog +{ title: catalog.i18nc("@title:window", "Plugin License Agreement") - minimumWidth: UM.Theme.getSize("license_window_minimum").width minimumHeight: UM.Theme.getSize("license_window_minimum").height width: minimumWidth height: minimumHeight - property var pluginName; property var licenseContent; property var pluginFileLocation; - Item { anchors.fill: parent - Label { id: licenseTitle @@ -36,7 +33,6 @@ UM.Dialog { text: licenseDialog.pluginName + catalog.i18nc("@label", "This plugin contains a license.\nYou need to accept this license to install this plugin.\nDo you agree with the terms below?") wrapMode: Text.Wrap } - TextArea { id: licenseText @@ -49,8 +45,8 @@ UM.Dialog { text: licenseDialog.licenseContent != null ? licenseDialog.licenseContent : "" } } - - rightButtons: [ + rightButtons: + [ Button { id: acceptButton diff --git a/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml b/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml deleted file mode 100644 index 8970515cac..0000000000 --- a/plugins/Toolbox/resources/qml/ToolboxRestartDialog.qml +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Toolbox is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import UM 1.1 as UM - -Window { - // title: catalog.i18nc("@title:tab", "Plugins"); - width: 360 * screenScaleFactor - height: 120 * screenScaleFactor - minimumWidth: 360 * screenScaleFactor - minimumHeight: 120 * screenScaleFactor - color: UM.Theme.getColor("sidebar") - property var message; - - Text { - id: message - anchors { - left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width - top: parent.top - topMargin: UM.Theme.getSize("default_margin").height - } - text: restartDialog.message != null ? restartDialog.message : "" - } - Button { - id: laterButton - text: "Later" - onClicked: restartDialog.close(); - anchors { - left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width - bottom: parent.bottom - bottomMargin: UM.Theme.getSize("default_margin").height - } - style: ButtonStyle { - background: Rectangle { - color: "transparent" - implicitWidth: 96 - implicitHeight: 30 - border { - width: 1 - color: UM.Theme.getColor("lining") - } - } - label: Text { - verticalAlignment: Text.AlignVCenter - color: UM.Theme.getColor("text") - text: control.text - horizontalAlignment: Text.AlignHCenter - } - } - } - - - Button { - id: restartButton - text: "Quit Cura" - anchors { - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width - bottom: parent.bottom - bottomMargin: UM.Theme.getSize("default_margin").height - } - onClicked: toolbox.restart() - style: ButtonStyle { - background: Rectangle { - implicitWidth: 96 - implicitHeight: 30 - color: UM.Theme.getColor("primary") - } - label: Text { - verticalAlignment: Text.AlignVCenter - color: UM.Theme.getColor("button_text") - font { - pixelSize: 13 - bold: true - } - text: control.text - horizontalAlignment: Text.AlignHCenter - } - } - } -} diff --git a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml new file mode 100644 index 0000000000..481afff67b --- /dev/null +++ b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml @@ -0,0 +1,51 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Toolbox is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 +import UM 1.1 as UM + +Button +{ + property bool active: false + style: ButtonStyle + { + background: Rectangle + { + color: "transparent" + implicitWidth: UM.Theme.getSize("base_unit").height * 8 + implicitHeight: UM.Theme.getSize("base_unit").height * 4 + Rectangle + { + visible: control.active + color: UM.Theme.getColor("sidebar_header_highlight_hover") + anchors.bottom: parent.bottom + width: parent.width + height: UM.Theme.getSize("sidebar_header_highlight").height + } + } + label: Text + { + text: control.text + color: + { + if( control.hovered ) + { + return UM.Theme.getColor("topbar_button_text_hovered"); + } + if( control.active ) + { + return UM.Theme.getColor("topbar_button_text_active"); + } + else + { + return UM.Theme.getColor("topbar_button_text_inactive"); + } + } + font: control.active ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium") + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + } +}