Cura/resources/qml/WelcomePages/DropDownWidget.qml
Ghostkeeper 0a75c772ed
Unrevert new icon set for all of Cura's interface
We created a new set of icons for Cura. These icons had to be reverted though because they weren't working out in the interface for the last release yet.
This unreverts them, basically adding them back hoping that we'll get them fixed in time for the next release.

Contributes to issue CURA-8342.

Revert "Revert "Fix merge conflict""

This reverts commit bb20e3307f.

Revert "Revert "Merge pull request #9716 from Ultimaker/CURA-8010_new_icons""

This reverts commit 70e4e9640e.

Revert "Revert "Fix typo in icon name""

This reverts commit 38ce22ba7c.

Revert "Revert "Add list for deprecated icons""

This reverts commit 119a957e7f.

Revert "Revert "Add Function icon""

This reverts commit 760726cf0b.

Revert "Revert "Switch out inherit icon""

This reverts commit 26afff6093.

Revert "Revert "Merge branch 'CURA-8205_Introduce_new_icons_in_Cura' of github.com:Ultimaker/Cura""

This reverts commit 6483db3d47.

Revert "Fix incorrect icons"

This reverts commit 02a4ade2a5.
2021-06-28 17:16:56 +02:00

102 lines
3.4 KiB
QML

// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.3 as UM
import Cura 1.1 as Cura
//
// This is the dropdown list widget in the welcome wizard. The dropdown list has a header bar which is always present,
// and its content whose visibility can be toggled by clicking on the header bar. The content is displayed as an
// expandable dropdown box that will appear below the header bar.
//
// The content is configurable via the property "contentComponent", which will be loaded by a Loader when set.
//
Item
{
UM.I18nCatalog { id: catalog; name: "cura" }
id: base
implicitWidth: 200 * screenScaleFactor
height: header.contentShown ? (header.height + contentRectangle.height) : header.height
property var contentComponent: null
property alias contentItem: contentLoader.item
property alias title: header.title
property bool contentShown: false // indicates if this dropdown widget is expanded to show its content
signal clicked()
Connections
{
target: header
function onClicked()
{
base.contentShown = !base.contentShown
clicked()
}
}
DropDownHeader
{
id: header
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: UM.Theme.getSize("expandable_component_content_header").height
rightIconSource: contentShown ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleLeft")
contentShown: base.contentShown
}
Cura.RoundedRectangle
{
id: contentRectangle
// Move up a bit (exaclty the width of the border) to avoid double line
y: header.height - UM.Theme.getSize("default_lining").width
anchors.left: header.left
anchors.right: header.right
// Add 2x lining, because it needs a bit of space on the top and the bottom.
height: contentLoader.item.height + 2 * UM.Theme.getSize("thick_lining").height
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
color: UM.Theme.getColor("main_background")
radius: UM.Theme.getSize("default_radius").width
visible: base.contentShown
cornerSide: Cura.RoundedRectangle.Direction.Down
Loader
{
id: contentLoader
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
// Keep a small margin with the Rectangle container so its content will not overlap with the Rectangle
// border.
anchors.margins: UM.Theme.getSize("default_lining").width
sourceComponent: base.contentComponent != null ? base.contentComponent : emptyComponent
}
// This is the empty component/placeholder that will be shown when the widget gets expanded.
// It contains a text line "Empty"
Component
{
id: emptyComponent
Label
{
text: catalog.i18nc("@label", "Empty")
height: UM.Theme.getSize("action_button").height
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
}
}
}
}