mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Make the expandable content header to be a common header for every expandable component.
Contributes to CURA-5941.
This commit is contained in:
parent
dff364ee30
commit
af37f51cf8
7 changed files with 64 additions and 101 deletions
|
@ -11,10 +11,11 @@ Cura.ExpandableComponent
|
|||
{
|
||||
id: printSetupSelector
|
||||
|
||||
property string enabledText: catalog.i18nc("@label:Should be short", "On")
|
||||
property string disabledText: catalog.i18nc("@label:Should be short", "Off")
|
||||
property bool preSlicedData: PrintInformation.preSliced
|
||||
|
||||
contentPadding: UM.Theme.getSize("default_lining").width
|
||||
contentHeaderTitle: catalog.i18nc("@label", "Print settings")
|
||||
enabled: !preSlicedData
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
|
@ -22,10 +23,7 @@ Cura.ExpandableComponent
|
|||
name: "cura"
|
||||
}
|
||||
|
||||
headerItem: PrintSetupSelectorHeader
|
||||
{
|
||||
anchors.fill: parent
|
||||
}
|
||||
headerItem: PrintSetupSelectorHeader {}
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ import "Custom"
|
|||
|
||||
Item
|
||||
{
|
||||
id: popup
|
||||
id: content
|
||||
|
||||
width: UM.Theme.getSize("print_setup_widget").width - 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
@ -36,79 +36,6 @@ Item
|
|||
}
|
||||
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex)
|
||||
|
||||
|
||||
// Header of the popup
|
||||
Cura.RoundedRectangle
|
||||
{
|
||||
id: header
|
||||
height: UM.Theme.getSize("print_setup_widget_header").height
|
||||
color: UM.Theme.getColor("secondary")
|
||||
cornerSide: Cura.RoundedRectangle.Direction.Up
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: headerLabel
|
||||
text: catalog.i18nc("@label", "Print settings")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: UM.Theme.getColor("text")
|
||||
height: parent.height
|
||||
|
||||
anchors
|
||||
{
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: closeButton
|
||||
width: UM.Theme.getSize("message_close").width
|
||||
height: UM.Theme.getSize("message_close").height
|
||||
hoverEnabled: true
|
||||
|
||||
anchors
|
||||
{
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
contentItem: UM.RecolorImage
|
||||
{
|
||||
anchors.fill: parent
|
||||
sourceSize.width: width
|
||||
color: closeButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text")
|
||||
source: UM.Theme.getIcon("cross1")
|
||||
}
|
||||
|
||||
background: Item {}
|
||||
|
||||
onClicked: toggleContent() // Will hide the popup item
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: topSeparator
|
||||
|
||||
anchors.bottom: header.bottom
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("default_lining").height
|
||||
color: UM.Theme.getColor("lining")
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: contents
|
||||
|
@ -118,7 +45,7 @@ Item
|
|||
|
||||
anchors
|
||||
{
|
||||
top: header.bottom
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@ import Cura 1.0 as Cura
|
|||
|
||||
RowLayout
|
||||
{
|
||||
property string enabledText: catalog.i18nc("@label:Should be short", "On")
|
||||
property string disabledText: catalog.i18nc("@label:Should be short", "Off")
|
||||
|
||||
Cura.IconWithText
|
||||
{
|
||||
source: UM.Theme.getIcon("category_layer_height")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue