mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
87 lines
No EOL
2.1 KiB
QML
87 lines
No EOL
2.1 KiB
QML
// Copyright (c) 2021 Ultimaker B.V.
|
|
// Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
import QtQuick 2.15
|
|
import QtQuick.Controls 2.15
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import UM 1.6 as UM
|
|
import Cura 1.6 as Cura
|
|
|
|
// Onboarding banner.
|
|
Rectangle
|
|
{
|
|
property bool bannerVisible
|
|
property string bannerIcon
|
|
property string bannerBody
|
|
property var onRemoveBanner
|
|
|
|
visible: bannerVisible
|
|
|
|
Layout.preferredHeight: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height
|
|
anchors
|
|
{
|
|
margins: UM.Theme.getSize("default_margin").width
|
|
left: parent.left
|
|
right: parent.right
|
|
top: parent.top
|
|
}
|
|
|
|
color: UM.Theme.getColor("action_panel_secondary")
|
|
|
|
// Icon
|
|
Rectangle
|
|
{
|
|
id: onboardingIcon
|
|
anchors
|
|
{
|
|
top: parent.top
|
|
left: parent.left
|
|
margins: UM.Theme.getSize("default_margin").width
|
|
}
|
|
width: UM.Theme.getSize("button_icon").width
|
|
height: UM.Theme.getSize("button_icon").height
|
|
color: "transparent"
|
|
UM.RecolorImage
|
|
{
|
|
anchors.fill: parent
|
|
color: UM.Theme.getColor("primary_text")
|
|
source: UM.Theme.getIcon(bannerIcon)
|
|
}
|
|
}
|
|
|
|
// Close button
|
|
UM.SimpleButton
|
|
{
|
|
id: onboardingClose
|
|
anchors
|
|
{
|
|
top: parent.top
|
|
right: parent.right
|
|
margins: UM.Theme.getSize("default_margin").width
|
|
}
|
|
width: UM.Theme.getSize("message_close").width
|
|
height: UM.Theme.getSize("message_close").height
|
|
color: UM.Theme.getColor("primary_text")
|
|
hoverColor: UM.Theme.getColor("primary_text_hover")
|
|
iconSource: UM.Theme.getIcon("Cancel")
|
|
|
|
onClicked: onRemoveBanner()
|
|
}
|
|
|
|
// Body
|
|
Text {
|
|
anchors
|
|
{
|
|
top: parent.top
|
|
left: onboardingIcon.right
|
|
right: onboardingClose.left
|
|
margins: UM.Theme.getSize("default_margin").width
|
|
}
|
|
|
|
font: UM.Theme.getFont("medium")
|
|
color: UM.Theme.getColor("primary_text")
|
|
wrapMode: Text.WordWrap
|
|
text: bannerBody
|
|
}
|
|
} |