Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Diego Prado Gesto 2018-05-04 15:01:16 +02:00
commit be81d4c4cc
13 changed files with 93 additions and 75 deletions

View File

@ -12,6 +12,8 @@ Window
property var selection: null property var selection: null
title: catalog.i18nc("@title", "Toolbox") title: catalog.i18nc("@title", "Toolbox")
modality: Qt.ApplicationModal modality: Qt.ApplicationModal
flags: Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
width: 720 * screenScaleFactor width: 720 * screenScaleFactor
height: 640 * screenScaleFactor height: 640 * screenScaleFactor
minimumWidth: 720 * screenScaleFactor minimumWidth: 720 * screenScaleFactor

View File

@ -1,7 +1,7 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// 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.3
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
@ -9,7 +9,7 @@ import UM 1.1 as UM
Item Item
{ {
id: page id: page
property var details: base.selection property var details: base.selection || {}
anchors.fill: parent anchors.fill: parent
ToolboxBackColumn ToolboxBackColumn
{ {
@ -32,6 +32,7 @@ Item
height: UM.Theme.getSize("toolbox_thumbnail_medium").height height: UM.Theme.getSize("toolbox_thumbnail_medium").height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: details.icon_url || "../images/logobot.svg" source: details.icon_url || "../images/logobot.svg"
mipmap: true
anchors anchors
{ {
top: parent.top top: parent.top
@ -53,7 +54,7 @@ Item
rightMargin: UM.Theme.getSize("wide_margin").width rightMargin: UM.Theme.getSize("wide_margin").width
bottomMargin: UM.Theme.getSize("default_margin").height bottomMargin: UM.Theme.getSize("default_margin").height
} }
text: details.name text: details.name || ""
font: UM.Theme.getFont("large") font: UM.Theme.getFont("large")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width width: parent.width
@ -62,7 +63,7 @@ Item
Label Label
{ {
id: description id: description
text: details.description text: details.description || ""
anchors anchors
{ {
top: title.bottom top: title.bottom
@ -114,6 +115,7 @@ Item
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
} }

View File

@ -37,8 +37,8 @@ Item
Label Label
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: styleData.elideMode elide: Text.ElideRight
text: styleData.value text: styleData.value || ""
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default_bold") font: UM.Theme.getFont("default_bold")
} }
@ -56,8 +56,8 @@ Item
Label Label
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: styleData.elideMode elide: Text.ElideRight
text: styleData.value text: styleData.value || ""
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
} }
@ -68,8 +68,8 @@ Item
Label Label
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: styleData.elideMode elide: Text.ElideRight
text: styleData.value text: styleData.value || ""
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
} }

View File

@ -1,7 +1,7 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// 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.3
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
@ -33,6 +33,7 @@ Item
height: UM.Theme.getSize("toolbox_thumbnail_medium").height height: UM.Theme.getSize("toolbox_thumbnail_medium").height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: details.icon_url || "../images/logobot.svg" source: details.icon_url || "../images/logobot.svg"
mipmap: true
anchors anchors
{ {
top: parent.top top: parent.top
@ -54,8 +55,9 @@ Item
rightMargin: UM.Theme.getSize("wide_margin").width rightMargin: UM.Theme.getSize("wide_margin").width
bottomMargin: UM.Theme.getSize("default_margin").height bottomMargin: UM.Theme.getSize("default_margin").height
} }
text: details.name text: details.name || ""
font: UM.Theme.getFont("large") font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width width: parent.width
height: UM.Theme.getSize("toolbox_property_label").height height: UM.Theme.getSize("toolbox_property_label").height
@ -133,6 +135,7 @@ Item
} }
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
} }

View File

@ -11,7 +11,7 @@ Item
id: tile id: tile
property bool installed: toolbox.isInstalled(model.id) property bool installed: toolbox.isInstalled(model.id)
width: detailList.width - UM.Theme.getSize("wide_margin").width width: detailList.width - UM.Theme.getSize("wide_margin").width
height: Math.max(UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height) height: normalData.height + compatibilityChart.height + 4 * UM.Theme.getSize("default_margin").height
Item Item
{ {
id: normalData id: normalData
@ -76,58 +76,9 @@ Item
} }
enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) //Don't allow installing while another download is running. enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) //Don't allow installing while another download is running.
opacity: enabled ? 1.0 : 0.5 opacity: enabled ? 1.0 : 0.5
style: ButtonStyle
{
background: Rectangle
{
implicitWidth: 96
implicitHeight: 30
color:
{
if (installed)
{
return UM.Theme.getColor("action_button_disabled")
}
else
{
if ( control.hovered )
{
return UM.Theme.getColor("primary_hover")
}
else
{
return UM.Theme.getColor("primary")
}
}
} property alias installed: tile.installed
} style: UM.Theme.styles.toolbox_action_button
label: Label
{
text: control.text
color:
{
if (installed)
{
return UM.Theme.getColor("action_button_disabled_text")
}
else
{
if ( control.hovered )
{
return UM.Theme.getColor("button_text_hover")
}
else
{
return UM.Theme.getColor("button_text")
}
}
}
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font: UM.Theme.getFont("default_bold")
}
}
onClicked: onClicked:
{ {
if (installed) if (installed)

View File

@ -1,7 +1,7 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// 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.3
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,10 +34,11 @@ Item
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 - UM.Theme.getSize("wide_margin").width
height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26 height: UM.Theme.getSize("toolbox_thumbnail_small").height - UM.Theme.getSize("wide_margin").width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: model.icon_url || "../images/logobot.svg" source: model.icon_url || "../images/logobot.svg"
mipmap: true
} }
} }
Column Column

View File

@ -1,7 +1,7 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// 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.3
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
@ -9,7 +9,7 @@ import UM 1.1 as UM
Item Item
{ {
width: UM.Theme.getSize("toolbox_thumbnail_large").width width: UM.Theme.getSize("toolbox_thumbnail_large").width
height: childrenRect.height height: thumbnail.height + packageName.height
Rectangle Rectangle
{ {
id: highlight id: highlight
@ -40,14 +40,16 @@ Item
height: UM.Theme.getSize("toolbox_thumbnail_large").height - 2 * UM.Theme.getSize("default_margin").height height: UM.Theme.getSize("toolbox_thumbnail_large").height - 2 * UM.Theme.getSize("default_margin").height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: model.icon_url || "../images/logobot.svg" source: model.icon_url || "../images/logobot.svg"
mipmap: true
} }
} }
Label Label
{ {
id: packageName
text: model.name text: model.name
anchors anchors
{ {
bottom: parent.bottom top: thumbnail.bottom
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter

View File

@ -49,7 +49,7 @@ Item
implicitHeight: Math.floor(UM.Theme.getSize("toolbox_footer_button").height) implicitHeight: Math.floor(UM.Theme.getSize("toolbox_footer_button").height)
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: Label
{ {
color: UM.Theme.getColor("button_text") color: UM.Theme.getColor("button_text")
font: UM.Theme.getFont("default_bold") font: UM.Theme.getFont("default_bold")

View File

@ -89,6 +89,7 @@ Item
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
onLinkActivated: Qt.openUrlExternally("mailto:" + model.author_email + "?Subject=Cura: " + model.name + " Plugin") onLinkActivated: Qt.openUrlExternally("mailto:" + model.author_email + "?Subject=Cura: " + model.name + " Plugin")
color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining")
linkColor: UM.Theme.getColor("text_link")
} }
} }
Column Column
@ -130,7 +131,7 @@ Item
color: UM.Theme.getColor("lining") color: UM.Theme.getColor("lining")
} }
} }
label: Text label: Label
{ {
text: control.text text: control.text
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")

View File

@ -42,7 +42,7 @@ UM.Dialog
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
readOnly: true readOnly: true
text: licenseDialog.licenseContent text: licenseDialog.licenseContent || ""
} }
} }
rightButtons: rightButtons:

View File

@ -25,7 +25,7 @@ Button
height: UM.Theme.getSize("sidebar_header_highlight").height height: UM.Theme.getSize("sidebar_header_highlight").height
} }
} }
label: Text label: Label
{ {
text: control.text text: control.text
color: color:

View File

@ -1033,4 +1033,59 @@ QtObject {
label: Item { } label: Item { }
} }
} }
property Component toolbox_action_button: Component {
ButtonStyle
{
background: Rectangle
{
implicitWidth: UM.Theme.getSize("toolbox_action_button").width
implicitHeight: UM.Theme.getSize("toolbox_action_button").height
color:
{
if (control.installed)
{
return UM.Theme.getColor("action_button_disabled")
}
else
{
if (control.hovered)
{
return UM.Theme.getColor("primary_hover")
}
else
{
return UM.Theme.getColor("primary")
}
}
}
}
label: Label
{
text: control.text
color:
{
if (control.installed)
{
return UM.Theme.getColor("action_button_disabled_text")
}
else
{
if (control.hovered)
{
return UM.Theme.getColor("button_text_hover")
}
else
{
return UM.Theme.getColor("button_text")
}
}
}
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font: UM.Theme.getFont("default_bold")
}
}
}
} }

View File

@ -460,6 +460,7 @@
"toolbox_header": [1.0, 4.0], "toolbox_header": [1.0, 4.0],
"toolbox_action_button": [8.0, 2.5], "toolbox_action_button": [8.0, 2.5],
"toolbox_progress_bar": [8.0, 0.5], "toolbox_progress_bar": [8.0, 0.5],
"toolbox_chart_row": [1.0, 2.0] "toolbox_chart_row": [1.0, 2.0],
"toolbox_action_button": [8.0, 2.5]
} }
} }