mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:35:53 +08:00
Add the print panel information as a popup that shows when the "i" icon
is clicked. Contributes to CURA-5786.
This commit is contained in:
parent
310539cb6d
commit
c862e72514
@ -91,7 +91,7 @@ Item
|
||||
{
|
||||
opacity: visible ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
radius: UM.Theme.getSize("default_radius")
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
color: UM.Theme.getColor("action_panel_secondary")
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
|
@ -4,7 +4,6 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 1.4 as Controls1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import Cura 1.0 as Cura
|
||||
@ -35,7 +34,7 @@ Column
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: moreInformationIcon.left
|
||||
right: printInformationPanel.left
|
||||
rightMargin: UM.Theme.getSize("thin_margin").height
|
||||
}
|
||||
|
||||
@ -83,24 +82,15 @@ Column
|
||||
}
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
PrintInformationWidget
|
||||
{
|
||||
id: moreInformationIcon
|
||||
id: printInformationPanel
|
||||
|
||||
anchors
|
||||
{
|
||||
right: parent.right
|
||||
verticalCenter: timeAndCostsInformation.verticalCenter
|
||||
}
|
||||
|
||||
source: UM.Theme.getIcon("info")
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
}
|
||||
|
||||
|
62
resources/qml/ActionPanel/PrintInformationWidget.qml
Normal file
62
resources/qml/ActionPanel/PrintInformationWidget.qml
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
{
|
||||
id: widget
|
||||
|
||||
implicitHeight: UM.Theme.getSize("section_icon").height
|
||||
implicitWidth: UM.Theme.getSize("section_icon").width
|
||||
|
||||
background: UM.RecolorImage
|
||||
{
|
||||
id: moreInformationIcon
|
||||
|
||||
source: UM.Theme.getIcon("info")
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
|
||||
color: widget.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium")
|
||||
}
|
||||
|
||||
onClicked: popup.opened ? popup.close() : popup.open()
|
||||
|
||||
Popup
|
||||
{
|
||||
id: popup
|
||||
|
||||
y: -(height + UM.Theme.getSize("default_arrow").height + UM.Theme.getSize("thin_margin").height)
|
||||
x: parent.width - width + UM.Theme.getSize("thin_margin").width
|
||||
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
|
||||
contentItem: Label
|
||||
{
|
||||
id: panel
|
||||
text: "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, \nsed do eiusmod tempor incididunt \nut labore et dolore magna aliqua. \nUt enim ad minim veniam, ..."
|
||||
}
|
||||
|
||||
background: UM.PointingRectangle
|
||||
{
|
||||
opacity: visible ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
color: UM.Theme.getColor("tool_panel_background")
|
||||
borderColor: UM.Theme.getColor("lining")
|
||||
borderWidth: UM.Theme.getSize("default_lining").width
|
||||
|
||||
target: Qt.point(width - (widget.width / 2) - UM.Theme.getSize("thin_margin").width,
|
||||
height + UM.Theme.getSize("default_arrow").height - UM.Theme.getSize("thin_margin").height)
|
||||
|
||||
arrowSize: UM.Theme.getSize("default_arrow").width
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user