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:
casper 2022-03-10 10:15:31 +01:00
parent 418f88a4da
commit 9ba44f1d30
4 changed files with 154 additions and 186 deletions

View file

@ -50,29 +50,11 @@ Item
materialProperties.approximate_diameter = currentItem.approximate_diameter || "0"
}
// Material title Label
UM.Label {
id: profileName
width: parent.width
text: materialProperties.name
font: UM.Theme.getFont("large_bold")
elide: Text.ElideRight
}
// Material detailed information view below the title Label
MaterialsView
{
id: materialDetailsView
anchors
{
left: parent.left
right: parent.right
top: profileName.bottom
topMargin: UM.Theme.getSize("default_margin").height
bottom: parent.bottom
}
anchors.fill: parent
editingEnabled: currentItem != null && !currentItem.is_read_only
onResetSelectedMaterial: base.resetExpandedActiveMaterial()

View file

@ -68,6 +68,7 @@ UM.ManagementPage
}
title: catalog.i18nc("@title:tab", "Materials")
detailsPlaneCation: currentItem.name
scrollviewCaption: catalog.i18nc("@label", "Materials compatible with active printer:") + `<br /><b>${Cura.MachineManager.activeMachine.name}</b>`
buttons: [
@ -107,8 +108,13 @@ UM.ManagementPage
}
]
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;
}
listContent: ScrollView
{
id: materialScrollView
@ -137,12 +143,14 @@ UM.ManagementPage
}
}
MaterialsDetailsPanel
{
id: materialDetailsPanel
anchors.fill: parent
}
Item
{
id: content_item
anchors.fill: parent
Cura.Menu
{
id: menu
@ -197,12 +205,6 @@ UM.ManagementPage
}
}
MaterialsDetailsPanel
{
id: materialDetailsPanel
anchors.fill: parent
}
// Dialogs
Cura.MessageDialog
{