mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Move details plane caption to management page
This way the caption can be correctly aligned with the hamburger menu button CURA-8979
This commit is contained in:
parent
418f88a4da
commit
9ba44f1d30
4 changed files with 154 additions and 186 deletions
|
@ -14,13 +14,21 @@ UM.ManagementPage
|
|||
id: base
|
||||
|
||||
title: catalog.i18nc("@title:tab", "Printers")
|
||||
detailsPlaneCation: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
||||
|
||||
model: Cura.GlobalStacksModel { }
|
||||
|
||||
sectionRole: "discoverySource"
|
||||
|
||||
activeId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id: ""
|
||||
activeIndex: activeMachineIndex()
|
||||
onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height)
|
||||
onHamburgeButtonClicked: {
|
||||
const hamburerButtonHeight = hamburger_button.height;
|
||||
menu.popup(hamburger_button, -menu.width + hamburger_button.width / 2, hamburger_button.height);
|
||||
// for some reason the height of the hamburger changes when opening the popup
|
||||
// reset height to initial heigt
|
||||
hamburger_button.height = hamburerButtonHeight;
|
||||
}
|
||||
hamburgerButtonVisible: Cura.MachineManager.activeMachine !== null
|
||||
|
||||
function activeMachineIndex()
|
||||
|
@ -43,60 +51,39 @@ UM.ManagementPage
|
|||
}
|
||||
]
|
||||
|
||||
Item
|
||||
Flow
|
||||
{
|
||||
id: content_item
|
||||
visible: base.currentItem != null
|
||||
visible: base.currentItem != null && currentItem && currentItem.id == Cura.MachineManager.activeMachine.id
|
||||
anchors.fill: parent
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
|
||||
UM.Label
|
||||
Repeater
|
||||
{
|
||||
id: machineName
|
||||
text: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
id: machineActionRepeater
|
||||
model: base.currentItem ? Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id)) : null
|
||||
|
||||
Flow
|
||||
{
|
||||
id: machineActions
|
||||
visible: currentItem && currentItem.id == Cura.MachineManager.activeMachine.id
|
||||
anchors
|
||||
Item
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: machineName.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Repeater
|
||||
{
|
||||
id: machineActionRepeater
|
||||
model: base.currentItem ? Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id)) : null
|
||||
|
||||
Item
|
||||
width: Math.round(childrenRect.width + 2 * screenScaleFactor)
|
||||
height: childrenRect.height
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
width: Math.round(childrenRect.width + 2 * screenScaleFactor)
|
||||
height: childrenRect.height
|
||||
Cura.SecondaryButton
|
||||
text: machineActionRepeater.model[index].label
|
||||
onClicked:
|
||||
{
|
||||
text: machineActionRepeater.model[index].label
|
||||
onClicked:
|
||||
{
|
||||
var currentItem = machineActionRepeater.model[index]
|
||||
actionDialog.loader.manager = currentItem
|
||||
actionDialog.loader.source = currentItem.qmlPath
|
||||
actionDialog.title = currentItem.label
|
||||
actionDialog.show()
|
||||
}
|
||||
var currentItem = machineActionRepeater.model[index]
|
||||
actionDialog.loader.manager = currentItem
|
||||
actionDialog.loader.source = currentItem.qmlPath
|
||||
actionDialog.title = currentItem.label
|
||||
actionDialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
UM.Dialog
|
||||
{
|
||||
id: actionDialog
|
||||
|
@ -139,6 +126,7 @@ UM.ManagementPage
|
|||
objectList.onCurrentIndexChanged()
|
||||
}
|
||||
}
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue