mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 05:37:50 -06:00
CURA-5035 UI pretty much built
This commit is contained in:
parent
138fc668a7
commit
f63e67dc22
10 changed files with 254 additions and 52 deletions
108
plugins/PluginBrowser/resources/qml/ToolboxDetailBlock.qml
Normal file
108
plugins/PluginBrowser/resources/qml/ToolboxDetailBlock.qml
Normal 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. It’s 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue