Ian Paschal 7 лет назад
Родитель
Сommit
921e8f7602

+ 9 - 35
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
-        }
     }
 }

+ 2 - 2
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

+ 12 - 7
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")
         }

+ 0 - 1
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

+ 2 - 1
plugins/Toolbox/resources/qml/ToolboxDetailPage.qml

@@ -141,7 +141,8 @@ Item
             anchors.bottom: parent.bottom
         }
     }
-    ToolboxDetailList {
+    ToolboxDetailList
+    {
         anchors
         {
             top: header.bottom

+ 7 - 6
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

+ 1 - 3
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")

+ 19 - 15
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" )
-            {
-                toolbox.viewSelection = model.name
-                toolbox.viewPage = "author"
-                toolbox.filterModelByProp("packages", "author_name", model.name)
-                toolbox.filterModelByProp("authors", "name", model.name)
-            }
-            else
+            switch(toolbox.viewCategory)
             {
-                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
             }
         }
     }

+ 1 - 1
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")

+ 9 - 7
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":

Некоторые файлы не были показаны из-за большого количества измененных файлов