CURA-5035 Clean-up

This commit is contained in:
Ian Paschal 2018-04-19 16:07:31 +02:00
parent 8f8d709b64
commit 921e8f7602
17 changed files with 181 additions and 350 deletions

View file

@ -4,17 +4,12 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2 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 import UM 1.1 as UM
Window Window
{ {
id: base id: base
title: catalog.i18nc("@title:tab", "Toolbox") title: catalog.i18nc("@title", "Toolbox")
modality: Qt.ApplicationModal modality: Qt.ApplicationModal
width: 720 * screenScaleFactor width: 720 * screenScaleFactor
height: 640 * screenScaleFactor height: 640 * screenScaleFactor
@ -22,6 +17,11 @@ Window
maximumWidth: 720 * screenScaleFactor maximumWidth: 720 * screenScaleFactor
minimumHeight: 350 * screenScaleFactor minimumHeight: 350 * screenScaleFactor
color: UM.Theme.getColor("sidebar") color: UM.Theme.getColor("sidebar")
UM.I18nCatalog
{
id: catalog
name:"cura"
}
Item Item
{ {
anchors.fill: parent anchors.fill: parent
@ -29,11 +29,11 @@ Window
{ {
id: header id: header
} }
Rectangle Item
{ {
id: mainView id: mainView
width: parent.width width: parent.width
color: "transparent" z: -1
anchors anchors
{ {
top: header.bottom top: header.bottom
@ -66,25 +66,13 @@ Window
visible: toolbox.viewCategory == "installed" visible: toolbox.viewCategory == "installed"
} }
} }
ToolboxShadow
{
anchors.top: header.bottom
}
ToolboxFooter ToolboxFooter
{ {
id: footer id: footer
visible: toolbox.restartRequired visible: toolbox.restartRequired
height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0 height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0
} }
ToolboxShadow // TODO: Clean this up:
{
visible: toolbox.restartRequired
anchors.bottom: footer.top
reversed: true
}
UM.I18nCatalog { id: catalog; name: "cura" }
Connections Connections
{ {
target: toolbox target: toolbox
@ -96,23 +84,9 @@ Window
licenseDialog.show(); licenseDialog.show();
} }
} }
Connections
{
target: toolbox
onShowRestartDialog:
{
restartDialog.message = toolbox.getRestartDialogMessage();
restartDialog.show();
}
}
ToolboxLicenseDialog ToolboxLicenseDialog
{ {
id: licenseDialog id: licenseDialog
} }
ToolboxRestartDialog
{
id: restartDialog
}
} }
} }

View file

@ -2,7 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
@ -127,7 +126,8 @@ Item
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
} }
} }
ToolboxDetailList { ToolboxDetailList
{
anchors anchors
{ {
top: header.bottom top: header.bottom

View file

@ -2,7 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
@ -23,17 +22,23 @@ Item
Button Button
{ {
id: button id: button
text: "Back" text: catalog.i18nc("@action:button", "Back")
UM.RecolorImage UM.RecolorImage
{ {
id: backArrow id: backArrow
anchors.verticalCenter: parent.verticalCenter anchors
anchors.left: parent.left {
anchors.rightMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter
left: parent.left
rightMargin: UM.Theme.getSize("default_margin").width
}
width: UM.Theme.getSize("standard_arrow").width width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width sourceSize
sourceSize.height: height {
width: width
height: height
}
color: button.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text") color: button.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text")
source: UM.Theme.getIcon("arrow_left") source: UM.Theme.getIcon("arrow_left")
} }

View file

@ -2,7 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM

View file

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

View file

@ -2,17 +2,15 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
Rectangle Item
{ {
property bool installed: toolbox.isInstalled(model.id) property bool installed: toolbox.isInstalled(model.id)
width: base.width - UM.Theme.getSize("double_margin").width width: base.width - UM.Theme.getSize("double_margin").width
height: UM.Theme.getSize("base_unit").height * 8 height: UM.Theme.getSize("base_unit").height * 8
color: "transparent"
Column Column
{ {
anchors anchors
@ -60,9 +58,11 @@ Rectangle
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
width: childrenRect.width width: childrenRect.width
Button { Button
{
id: installButton id: installButton
text: { text:
{
if (installed) if (installed)
{ {
return catalog.i18nc("@action:button", "Installed") return catalog.i18nc("@action:button", "Installed")
@ -95,7 +95,8 @@ Rectangle
} }
} }
opacity: enabled ? 1.0 : 0.5 opacity: enabled ? 1.0 : 0.5
style: ButtonStyle { style: ButtonStyle
{
background: Rectangle background: Rectangle
{ {
implicitWidth: 96 implicitWidth: 96

View file

@ -2,8 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
@ -19,7 +17,7 @@ Column
Label Label
{ {
id: heading 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 width: parent.width
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")

View file

@ -2,8 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
@ -34,7 +32,8 @@ Item
color: "white" color: "white"
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining") border.color: UM.Theme.getColor("lining")
Image { Image
{
anchors.centerIn: parent anchors.centerIn: parent
width: UM.Theme.getSize("toolbox_thumbnail_small").width - 26 width: UM.Theme.getSize("toolbox_thumbnail_small").width - 26
height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26 height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26
@ -89,19 +88,24 @@ Item
} }
onClicked: onClicked:
{ {
if ( toolbox.viewCategory == "material" ) switch(toolbox.viewCategory)
{ {
toolbox.viewSelection = model.name case "material":
toolbox.viewPage = "author" console.log("OKAY FILTER BY AUTHOR", model.name)
toolbox.filterModelByProp("packages", "author_name", model.name) toolbox.viewSelection = model.name
toolbox.filterModelByProp("authors", "name", model.name) toolbox.viewPage = "author"
} console.log(toolbox)
else var name = model.name
{ toolbox.filterModelByProp("authors", "name", name)
toolbox.viewSelection = model.id toolbox.filterModelByProp("packages", "author_name", name)
toolbox.viewPage = "detail" console.log(toolbox)
toolbox.filterModelByProp("packages", "id", model.id) break
toolbox.filterModelByProp("authors", "name", model.author_name) default:
toolbox.viewSelection = model.id
toolbox.viewPage = "detail"
toolbox.filterModelByProp("authors", "name", model.author_name)
toolbox.filterModelByProp("packages", "id", model.id)
break
} }
} }
} }

View file

@ -18,7 +18,7 @@ Column
Label Label
{ {
id: heading id: heading
text: "Featured" text: catalog.i18nc("@label", "Featured")
width: parent.width width: parent.width
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")

View file

@ -2,8 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
@ -28,8 +26,11 @@ Item
color: "white" color: "white"
width: UM.Theme.getSize("toolbox_thumbnail_medium").width width: UM.Theme.getSize("toolbox_thumbnail_medium").width
height: UM.Theme.getSize("toolbox_thumbnail_medium").height height: UM.Theme.getSize("toolbox_thumbnail_medium").height
border.width: 1 border
border.color: UM.Theme.getColor("lining") {
width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("lining")
}
anchors anchors
{ {
top: parent.top top: parent.top
@ -37,8 +38,8 @@ Item
} }
Image { Image {
anchors.centerIn: parent anchors.centerIn: parent
width: UM.Theme.getSize("toolbox_thumbnail_medium").width - 26 width: UM.Theme.getSize("toolbox_thumbnail_medium").width - 2 * UM.Theme.getSize("default_margin")
height: UM.Theme.getSize("toolbox_thumbnail_medium").height - 26 height: UM.Theme.getSize("toolbox_thumbnail_medium").height - 2 * UM.Theme.getSize("default_margin")
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: model.icon_url || "../images/logobot.svg" source: model.icon_url || "../images/logobot.svg"
} }
@ -61,7 +62,8 @@ Item
MouseArea MouseArea
{ {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked:
{
switch(toolbox.viewCategory) switch(toolbox.viewCategory)
{ {
case "material": case "material":

View file

@ -2,30 +2,29 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 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 import UM 1.1 as UM
Item Item
{ {
id: footer
width: parent.width width: parent.width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: visible ? Math.floor(UM.Theme.getSize("base_unit").height * 5.5) : 0
Label Label
{ {
visible: toolbox.restartRequired visible: toolbox.restartRequired
text: "You will need to restart Cura before changes in plugins have effect." 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 verticalAlignment: Text.AlignVCenter
anchors anchors
{ {
top: closeButton.top top: restartButton.top
left: parent.left 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 Button
@ -34,9 +33,10 @@ Item
text: "Quit Cura" text: "Quit Cura"
anchors anchors
{ {
top: closeButton.top top: parent.top
right: closeButton.left topMargin: UM.Theme.getSize("default_margin").height
rightMargin: UM.Theme.getSize("default_margin").width right: parent.right
rightMargin: UM.Theme.getSize("double_margin").width
} }
visible: toolbox.restartRequired visible: toolbox.restartRequired
iconName: "dialog-restart" iconName: "dialog-restart"
@ -45,65 +45,24 @@ Item
{ {
background: Rectangle background: Rectangle
{ {
implicitWidth: 96 implicitWidth: UM.Theme.getSize("base_unit").width * 8
implicitHeight: UM.Theme.getSize("base_unit").height * 2 implicitHeight: Math.floor(UM.Theme.getSize("base_unit").height * 2.5)
color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary") color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary")
} }
label: Text label: Text
{ {
verticalAlignment: Text.AlignVCenter
color: UM.Theme.getColor("button_text") color: UM.Theme.getColor("button_text")
font font: UM.Theme.getFont("default_bold")
{
pixelSize: 13
bold: true
}
text: control.text text: control.text
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
} }
} }
} }
ToolboxShadow
Button
{ {
id: closeButton visible: toolbox.restartRequired
text: catalog.i18nc("@action:button", "Close") anchors.bottom: footer.top
iconName: "dialog-close" reversed: true
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
}
}
} }
} }

View file

@ -2,54 +2,29 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
Rectangle { Item
{
id: header
width: parent.width width: parent.width
color: "transparent" height: UM.Theme.getSize("base_unit").height * 4
height: childrenRect.height
Row Row
{ {
id: bar
spacing: 12 spacing: 12
height: childrenRect.height height: childrenRect.height
width: childrenRect.width width: childrenRect.width
anchors.left: parent.left anchors
anchors.leftMargin: UM.Theme.getSize("default_margin").width
Button
{ {
text: "Plugins" left: parent.left
style: ButtonStyle leftMargin: UM.Theme.getSize("default_margin").width
{ }
background: Rectangle ToolboxTabButton
{ {
color: "transparent" text: catalog.i18nc("@title:tab", "Plugins")
implicitWidth: 96 active: toolbox.viewCategory == "plugin"
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
}
}
onClicked: onClicked:
{ {
toolbox.filterModelByProp("packages", "type", "plugin") toolbox.filterModelByProp("packages", "type", "plugin")
@ -58,35 +33,10 @@ Rectangle {
toolbox.viewPage = "overview" toolbox.viewPage = "overview"
} }
} }
ToolboxTabButton
Button
{ {
text: "Materials" text: catalog.i18nc("@title:tab", "Materials")
style: ButtonStyle active: toolbox.viewCategory == "material"
{
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
}
}
onClicked: onClicked:
{ {
toolbox.filterModelByProp("packages", "type", "material") toolbox.filterModelByProp("packages", "type", "material")
@ -96,36 +46,19 @@ Rectangle {
} }
} }
} }
ToolboxTabButton
Button
{ {
text: "Installed" text: catalog.i18nc("@title:tab", "Installed")
anchors.right: parent.right active: toolbox.viewCategory == "installed"
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors
style: ButtonStyle
{ {
background: Rectangle right: parent.right
{ rightMargin: UM.Theme.getSize("default_margin").width
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
}
} }
onClicked: toolbox.viewCategory = "installed" onClicked: toolbox.viewCategory = "installed"
} }
ToolboxShadow
{
anchors.top: bar.bottom
}
} }

View file

@ -31,7 +31,7 @@ ScrollView
Label Label
{ {
width: parent.width width: parent.width
text: "Plugins" text: catalog.i18nc("@title:tab", "Plugins")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
} }
@ -66,7 +66,7 @@ ScrollView
Label Label
{ {
width: base.width width: base.width
text: "Materials" text: catalog.i18nc("@title:tab", "Materials")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
} }

View file

@ -2,8 +2,6 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
@ -43,20 +41,17 @@ Item
{ {
text: model.name text: model.name
width: parent.width width: parent.width
height: 24 height: UM.Theme.getSize("base_unit").height * 2
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font { font: UM.Theme.getFont("default_bold")
pixelSize: 13
bold: true
}
color: pluginInfo.color color: pluginInfo.color
} }
Text Text
{ {
text: model.description text: model.description
width: parent.width width: parent.width
height: 36 height: UM.Theme.getSize("base_unit").height * 3
clip: true clip: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: pluginInfo.color color: pluginInfo.color
@ -66,7 +61,7 @@ Item
Column Column
{ {
id: authorInfo id: authorInfo
width: 192 width: UM.Theme.getSize("base_unit").width * 16
height: parent.height height: parent.height
anchors anchors
{ {
@ -89,7 +84,7 @@ Item
} }
} }
width: parent.width width: parent.width
height: 24 height: UM.Theme.getSize("base_unit").height * 3
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
@ -97,8 +92,6 @@ Item
color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining")
} }
} }
// Plugin actions
Column Column
{ {
id: pluginActions id: pluginActions
@ -111,7 +104,6 @@ Item
right: parent.right right: parent.right
topMargin: UM.Theme.getSize("default_margin").height topMargin: UM.Theme.getSize("default_margin").height
} }
Button { Button {
id: removeButton id: removeButton
text: text:
@ -131,7 +123,7 @@ Item
background: Rectangle background: Rectangle
{ {
implicitWidth: UM.Theme.getSize("base_unit").width * 8 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" color: "transparent"
border border
{ {
@ -139,7 +131,8 @@ Item
color: UM.Theme.getColor("lining") color: UM.Theme.getColor("lining")
} }
} }
label: Text { label: Text
{
text: control.text text: control.text
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -165,8 +158,8 @@ Item
} }
} }
} }
Button
Button { {
id: updateButton id: updateButton
text: catalog.i18nc("@action:button", "Update") text: catalog.i18nc("@action:button", "Update")
visible: canUpdate visible: canUpdate
@ -195,10 +188,13 @@ Item
ProgressBar ProgressBar
{ {
id: progressbar id: progressbar
anchors.left: updateButton.left anchors
anchors.right: updateButton.right {
anchors.top: updateButton.bottom left: updateButton.left
anchors.topMargin: 4 right: updateButton.right
top: updateButton.bottom
topMargin: Math.floor(UM.Theme.getSize("base_unit") / 4)
}
value: toolbox.isDownloading ? toolbox.downloadProgress : 0 value: toolbox.isDownloading ? toolbox.downloadProgress : 0
visible: toolbox.isDownloading visible: toolbox.isDownloading
style: ProgressBarStyle style: ProgressBarStyle

View file

@ -11,22 +11,19 @@ import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
UM.Dialog { UM.Dialog
{
title: catalog.i18nc("@title:window", "Plugin License Agreement") title: catalog.i18nc("@title:window", "Plugin License Agreement")
minimumWidth: UM.Theme.getSize("license_window_minimum").width minimumWidth: UM.Theme.getSize("license_window_minimum").width
minimumHeight: UM.Theme.getSize("license_window_minimum").height minimumHeight: UM.Theme.getSize("license_window_minimum").height
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
property var pluginName; property var pluginName;
property var licenseContent; property var licenseContent;
property var pluginFileLocation; property var pluginFileLocation;
Item Item
{ {
anchors.fill: parent anchors.fill: parent
Label Label
{ {
id: licenseTitle 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?") 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 wrapMode: Text.Wrap
} }
TextArea TextArea
{ {
id: licenseText id: licenseText
@ -49,8 +45,8 @@ UM.Dialog {
text: licenseDialog.licenseContent != null ? licenseDialog.licenseContent : "" text: licenseDialog.licenseContent != null ? licenseDialog.licenseContent : ""
} }
} }
rightButtons:
rightButtons: [ [
Button Button
{ {
id: acceptButton id: acceptButton

View file

@ -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
}
}
}
}

View file

@ -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
}
}
}