mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-01 16:24:41 +08:00
Added drop-down buttons
This commit is contained in:
parent
013f020a4a
commit
81b2f0f7cd
@ -5,11 +5,10 @@ import QtQuick.Window 2.2
|
|||||||
import QtQuick.Controls 1.1
|
import QtQuick.Controls 1.1
|
||||||
import QtQuick.Controls.Styles 1.4
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
UM.Dialog
|
UM.Dialog {
|
||||||
{
|
|
||||||
id: base
|
id: base
|
||||||
|
|
||||||
title: catalog.i18nc("@title:window", "Find & Update plugins")
|
title: catalog.i18nc("@title:tab", "Plugins");
|
||||||
width: 800 * screenScaleFactor
|
width: 800 * screenScaleFactor
|
||||||
height: 450 * screenScaleFactor
|
height: 450 * screenScaleFactor
|
||||||
minimumWidth: 350 * screenScaleFactor
|
minimumWidth: 350 * screenScaleFactor
|
||||||
@ -46,8 +45,7 @@ UM.Dialog
|
|||||||
anchors.bottom: bottomBar.top
|
anchors.bottom: bottomBar.top
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
frameVisible: true
|
frameVisible: true
|
||||||
ListView
|
ListView {
|
||||||
{
|
|
||||||
id: pluginList
|
id: pluginList
|
||||||
model: manager.pluginsModel
|
model: manager.pluginsModel
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -113,6 +111,7 @@ UM.Dialog
|
|||||||
pixelSize: 15
|
pixelSize: 15
|
||||||
bold: true
|
bold: true
|
||||||
}
|
}
|
||||||
|
color: model.enabled ? UM.Theme.getColor("text") : "grey"
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@ -169,6 +168,7 @@ UM.Dialog
|
|||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: removeControls
|
||||||
visible: model.already_installed
|
visible: model.already_installed
|
||||||
width: 108
|
width: 108
|
||||||
height: 30
|
height: 30
|
||||||
@ -188,7 +188,7 @@ UM.Dialog
|
|||||||
color: white
|
color: white
|
||||||
implicitWidth: 108
|
implicitWidth: 108
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
radius: 4
|
// radius: 4
|
||||||
border {
|
border {
|
||||||
width: 1
|
width: 1
|
||||||
color: "grey"
|
color: "grey"
|
||||||
@ -204,6 +204,7 @@ UM.Dialog
|
|||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
id: removeDropDown
|
id: removeDropDown
|
||||||
|
property bool open: false
|
||||||
UM.RecolorImage {
|
UM.RecolorImage {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
height: 10
|
height: 10
|
||||||
@ -224,7 +225,7 @@ UM.Dialog
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
implicitWidth: 30
|
implicitWidth: 30
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
radius: 4
|
// radius: 4
|
||||||
}
|
}
|
||||||
label: Text {
|
label: Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
@ -234,8 +235,21 @@ UM.Dialog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// For the disable option:
|
// For the disable option:
|
||||||
onClicked: pluginList.model.setEnabled(model.id, checked)
|
// onClicked: pluginList.model.setEnabled(model.id, checked)
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if ( !removeDropDown.open ) {
|
||||||
|
removeDropDown.open = true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
removeDropDown.open = false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: divider
|
id: divider
|
||||||
@ -244,6 +258,26 @@ UM.Dialog
|
|||||||
anchors.right: removeDropDown.left
|
anchors.right: removeDropDown.left
|
||||||
color: "grey"
|
color: "grey"
|
||||||
}
|
}
|
||||||
|
Column {
|
||||||
|
id: options
|
||||||
|
anchors {
|
||||||
|
top: removeButton.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
height: childrenRect.height
|
||||||
|
visible: removeDropDown.open
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Disable"
|
||||||
|
height: 30
|
||||||
|
width: parent.width
|
||||||
|
onClicked: {
|
||||||
|
removeDropDown.open = false
|
||||||
|
model.setEnabled(model.id, checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -265,7 +299,7 @@ UM.Dialog
|
|||||||
color: UM.Theme.getColor("primary")
|
color: UM.Theme.getColor("primary")
|
||||||
implicitWidth: 72
|
implicitWidth: 72
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
radius: 4
|
// radius: 4
|
||||||
}
|
}
|
||||||
label: Text {
|
label: Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
@ -299,7 +333,7 @@ UM.Dialog
|
|||||||
color: UM.Theme.getColor("primary")
|
color: UM.Theme.getColor("primary")
|
||||||
implicitWidth: 72
|
implicitWidth: 72
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
radius: 4
|
// radius: 4
|
||||||
}
|
}
|
||||||
label: Text {
|
label: Text {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user