CURA-5035 Improved details pages

This commit is contained in:
Ian Paschal 2018-04-18 16:35:55 +02:00
parent 7a0fe74989
commit f8672ecbc6
9 changed files with 61 additions and 37 deletions

View file

@ -14,7 +14,7 @@ import UM 1.1 as UM
Window
{
id: base
title: catalog.i18nc("@title:tab", "Toolbox");
title: catalog.i18nc("@title:tab", "Toolbox")
modality: Qt.ApplicationModal
width: 720 * screenScaleFactor
height: 640 * screenScaleFactor
@ -73,10 +73,14 @@ Window
ToolboxFooter
{
id: footer
visible: toolbox.restartRequired
height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0
}
ToolboxShadow
{
anchors.top: footer.top
visible: toolbox.restartRequired
anchors.bottom: footer.top
reversed: true
}
UM.I18nCatalog { id: catalog; name: "cura" }

View file

@ -74,13 +74,7 @@ Item
width: childrenRect.width
Label
{
text: "Version:"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
Label
{
text: "Author:"
text: catalog.i18nc("@label", "Contact") + ":"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
@ -99,15 +93,21 @@ Item
width: UM.Theme.getSize("base_unit").width * 12
Label
{
text: details.name
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
}
Label
{
text: details.name
text:
{
if (details.email)
{
return "<a href=\"mailto:"+details.email+"\">"+details.name+"</a>"
}
else
{
console.log("<a href=\""+details.website+"\">"+details.author_name+"</a>")
return "<a href=\""+details.website+"\">"+details.name+"</a>"
}
}
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
onLinkActivated: Qt.openUrlExternally(link)
}
}
Rectangle

View file

@ -74,19 +74,19 @@ Item
width: childrenRect.width
Label
{
text: "Version:"
text: catalog.i18nc("@label", "Version") + ":"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
Label
{
text: "Last Update:"
text: catalog.i18nc("@label", "Last updated") + ":"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
Label
{
text: "Author:"
text: catalog.i18nc("@label", "Author") + ":"
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_medium")
}
@ -117,9 +117,20 @@ Item
}
Label
{
text: details.author_name
text:
{
if (details.author_email)
{
return "<a href=\"mailto:"+details.author_email+"?Subject=Cura: "+details.name+"\">"+details.author_name+"</a>"
}
else
{
return "<a href=\""+details.website+"\">"+details.author_name+"</a>"
}
}
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
onLinkActivated: Qt.openUrlExternally(link)
}
}
Rectangle

View file

@ -34,7 +34,21 @@ Rectangle
Label
{
width: parent.width
text: model.description
text:
{
if (model.description.length > 235)
{
if (model.description.substring(234, 235) == " ")
{
return model.description.substring(0, 234) + "..."
}
else
{
return model.description.substring(0, 235) + "..."
}
}
return model.description
}
wrapMode: Text.WordWrap
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")

View file

@ -58,7 +58,8 @@ Item
Label
{
id: info
text: {
text:
{
if (model.description.length > 50)
{
return model.description.substring(0, 50) + "..."

View file

@ -14,7 +14,6 @@ import UM 1.1 as UM
Item
{
width: parent.width
height: UM.Theme.getSize("base_unit").height * 4
anchors.bottom: parent.bottom
Label
{

View file

@ -5,18 +5,19 @@ import QtQuick 2.2
Rectangle
{
property bool reversed: false
width: parent.width
height: 8
gradient: Gradient
{
GradientStop
{
position: 0.0
color: Qt.rgba(0,0,0,0.2)
position: reversed ? 1.0 : 0.0
color: reversed ? Qt.rgba(0,0,0,0.05) : Qt.rgba(0,0,0,0.2)
}
GradientStop
{
position: 1.0
position: reversed ? 0.0 : 1.0
color: Qt.rgba(0,0,0,0)
}
}