mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Monitor Tab - Accordion-style printer blocks
Includes some unsuccessful attempts at scaling the outer-shadow Contributes to CL-1048
This commit is contained in:
parent
0ecac9f01e
commit
0d67420601
1 changed files with 22 additions and 4 deletions
|
@ -15,7 +15,7 @@ Component
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
|
property var lineColor: "#DCDCDC" // TODO: Should be linked to theme.
|
||||||
|
property var shadowRadius: 5 * screenScaleFactor
|
||||||
property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
|
property var cornerRadius: 4 * screenScaleFactor // TODO: Should be linked to theme.
|
||||||
visible: OutputDevice != null
|
visible: OutputDevice != null
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -82,6 +82,8 @@ Component
|
||||||
|
|
||||||
ListView
|
ListView
|
||||||
{
|
{
|
||||||
|
id: printer_list
|
||||||
|
property var current_index: -1
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
@ -105,17 +107,23 @@ Component
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
id: base
|
id: base
|
||||||
property var shadowRadius: 5
|
property var shadowRadius: 5 * screenScaleFactor
|
||||||
property var collapsed: true
|
property var collapsed: true
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: DropShadow
|
layer.effect: DropShadow
|
||||||
{
|
{
|
||||||
radius: base.shadowRadius
|
radius: 5 * screenScaleFactor
|
||||||
verticalOffset: 2
|
verticalOffset: 2
|
||||||
color: "#3F000000" // 25% shadow
|
color: "#3F000000" // 25% shadow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: printer_list
|
||||||
|
onCurrent_indexChanged: { base.collapsed = printer_list.current_index != model.index }
|
||||||
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: printerInfo
|
id: printerInfo
|
||||||
|
@ -131,7 +139,17 @@ Component
|
||||||
MouseArea
|
MouseArea
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: base.collapsed = !base.collapsed
|
onClicked:
|
||||||
|
{
|
||||||
|
|
||||||
|
if (base.collapsed) {
|
||||||
|
printer_list.current_index = model.index
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printer_list.current_index = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue