CURA-5035 UI pretty much built

This commit is contained in:
Ian Paschal 2018-03-29 16:52:28 +02:00
parent 138fc668a7
commit f63e67dc22
10 changed files with 254 additions and 52 deletions

View file

@ -41,7 +41,13 @@ Window
ToolboxViewDownloads
{
id: viewDownloads
visible: manager.viewing == "available" ? true : false
visible: manager.viewing == "available" && manager.detailView == "" ? true : false
}
ToolboxViewDetail
{
id: viewDetail
visible: manager.viewing == "available" && manager.detailView != "" ? true : false
}
ToolboxViewInstalled
{
@ -49,53 +55,23 @@ Window
visible: manager.viewing == "installed" ? true : false
}
}
Rectangle
SectionShadow
{
anchors
{
top: topBar.bottom
}
width: parent.width
height: 8
gradient: Gradient
{
GradientStop
{
position: 0.0
color: Qt.rgba(0,0,0,0.1)
}
GradientStop
{
position: 1.0
color: Qt.rgba(0,0,0,0)
}
}
}
ToolboxFooter
{
id: bottomBar
}
Rectangle
SectionShadow
{
anchors
{
top: bottomBar.top
}
width: parent.width
height: 8
gradient: Gradient
{
GradientStop
{
position: 0.0
color: Qt.rgba(0,0,0,0.1)
}
GradientStop
{
position: 1.0
color: Qt.rgba(0,0,0,0)
}
}
}

View file

@ -0,0 +1,23 @@
// Copyright (c) 2018 Ultimaker B.V.
// PluginBrowser is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
Rectangle
{
width: parent.width
height: 8
gradient: Gradient
{
GradientStop
{
position: 0.0
color: Qt.rgba(0,0,0,0.2)
}
GradientStop
{
position: 1.0
color: Qt.rgba(0,0,0,0)
}
}
}

View file

@ -0,0 +1,108 @@
// Copyright (c) 2018 Ultimaker B.V.
// PluginBrowser 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
{
width: parent.width
height: childrenRect.height
color: "transparent"
Column
{
anchors
{
left: parent.left
right: controls.left
rightMargin: UM.Theme.getSize("default_margin").width
top: parent.top
leftMargin: UM.Theme.getSize("default_margin").width
topMargin: UM.Theme.getSize("default_margin").height
}
Label
{
width: parent.width
height: UM.Theme.getSize("base_unit").height * 2
text: "DSM Abrasive"
wrapMode: Text.WordWrap
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default_bold")
}
Label
{
width: parent.width
text: "DSM abrasive material provides extra stiffness. Its suitable for printing \"Functional prototypes\" and \"End parts\"."
wrapMode: Text.WordWrap
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("normal")
}
}
Rectangle
{
id: controls
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: childrenRect.width
Button {
id: installButton
text: catalog.i18nc("@action:button", "Install")
enabled:
{
if ( manager.isDownloading )
{
return pluginList.activePlugin == model ? true : false
}
else
{
return true
}
}
opacity: enabled ? 1.0 : 0.5
style: ButtonStyle {
background: Rectangle
{
implicitWidth: 96
implicitHeight: 30
color: UM.Theme.getColor("primary")
}
label: Label
{
text: control.text
color: "white"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
}
onClicked:
{
if ( manager.isDownloading && pluginList.activePlugin == model )
{
manager.cancelDownload();
}
else
{
pluginList.activePlugin = model;
if ( model.can_upgrade )
{
manager.downloadAndInstallPlugin( model.update_url );
}
else {
manager.downloadAndInstallPlugin( model.file_location );
}
}
}
}
}
Rectangle
{
color: UM.Theme.getColor("text_medium")
width: parent.width
height: UM.Theme.getSize("default_lining").height
anchors.top: parent.top
}
}

View file

@ -15,7 +15,7 @@ Rectangle
{
id: base
width: parent.width
height: 1200
height: childrenRect.height + UM.Theme.getSize("double_margin").height * 8
color: "transparent"
Label
{
@ -38,6 +38,7 @@ Rectangle
columns: 3
columnSpacing: UM.Theme.getSize("base_unit").width
rowSpacing: UM.Theme.getSize("base_unit").height
ToolboxGridTile {}
ToolboxGridTile {}
ToolboxGridTile {}

View file

@ -6,13 +6,14 @@ 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
import UM 1.1 as UM
Item
{
id: base
width: parent.columnSize
height: childrenRect.height
Layout.fillWidth: true
Row
{
width: parent.width
@ -21,8 +22,8 @@ Item
Rectangle
{
id: thumbnail
width: UM.Theme.getSize("base_unit").width * 6
height: UM.Theme.getSize("base_unit").height * 6
width: UM.Theme.getSize("toolbox_thumbnail_small").width
height: UM.Theme.getSize("toolbox_thumbnail_small").height
color: "white"
border.width: 1
}

View file

@ -16,8 +16,8 @@ theme makers/modfiers. Thus, "base_unit" is used wherever it can be. */
Item
{
width: UM.Theme.getSize("base_unit").width * 12
height: UM.Theme.getSize("base_unit").width * 12
width: UM.Theme.getSize("toolbox_thumbnail_large").width
height: UM.Theme.getSize("toolbox_thumbnail_large").width
Rectangle
{
color: "white"

View file

@ -0,0 +1,84 @@
// Copyright (c) 2018 Ultimaker B.V.
// PluginBrowser 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
Item
{
id: base
anchors.fill: parent
Rectangle
{
id: backMargin
height: parent.height
width: UM.Theme.getSize("base_unit").width * 6
anchors
{
top: parent.top
left: parent.left
topMargin: UM.Theme.getSize("double_margin").height
leftMargin: UM.Theme.getSize("default_margin").width
rightMargin: UM.Theme.getSize("default_margin").width
}
Button
{
text: "Back"
onClicked: {
manager.setDetailView("")
}
}
color: "transparent"
}
ScrollView
{
id: scroll
frameVisible: false
anchors.right: base.right
anchors.left: backMargin.right
height: parent.height
style: UM.Theme.styles.scrollview
Column
{
width: scroll.width
spacing: UM.Theme.getSize("base_unit").height
height: childrenRect.height + (UM.Theme.getSize("double_margin").height * 2)
anchors
{
fill: parent
topMargin: UM.Theme.getSize("double_margin").height
bottomMargin: UM.Theme.getSize("double_margin").height
leftMargin: UM.Theme.getSize("double_margin").width
rightMargin: UM.Theme.getSize("double_margin").width
}
Rectangle
{
width: parent.width
height: UM.Theme.getSize("base_unit").height * 12
color: "transparent"
Rectangle
{
id: thumbnail
width: UM.Theme.getSize("toolbox_thumbnail_medium").width
height: UM.Theme.getSize("toolbox_thumbnail_medium").height
color: "white"
border.width: 1
}
}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
ToolboxDetailBlock {}
}
}
}

View file

@ -32,7 +32,7 @@ ScrollView
{
id: showcase
}
ToolboxItemGrid
ToolboxGrid
{
id: allPlugins
}