Adjust dialog margins.

Move title into full width white square.

CURA-9424

Co-authored-by: Casper Lamboo <casper.lamboo@ultimaker.com>
This commit is contained in:
Joey de l'Arago 2022-11-03 16:43:01 +01:00
parent c987ef5315
commit 6126135adb
2 changed files with 39 additions and 31 deletions

View file

@ -14,33 +14,45 @@ UM.Dialog
id: workspaceDialog id: workspaceDialog
title: catalog.i18nc("@title:window", "Open Project") title: catalog.i18nc("@title:window", "Open Project")
margin: UM.Theme.getSize("default_margin").width
minimumWidth: UM.Theme.getSize("modal_window_minimum").width minimumWidth: UM.Theme.getSize("modal_window_minimum").width
minimumHeight: UM.Theme.getSize("modal_window_minimum").height minimumHeight: UM.Theme.getSize("modal_window_minimum").height
width: minimumWidth
height: minimumHeight
backgroundColor: UM.Theme.getColor("main_background") backgroundColor: UM.Theme.getColor("detail_background")
Flickable headerComponent: Rectangle
{ {
clip: true height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height
width: parent.width color: UM.Theme.getColor("main_background")
height: parent.height
contentHeight: dialogSummaryItem.height
ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
Item UM.Label
{
id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project")
font: UM.Theme.getFont("large")
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.leftMargin: UM.Theme.getSize("default_margin").height
}
}
Rectangle
{
anchors.fill: parent
UM.I18nCatalog { id: catalog; name: "cura" }
color: UM.Theme.getColor("main_background")
Flickable
{ {
id: dialogSummaryItem id: dialogSummaryItem
width: verticalScrollBar.visible ? parent.width - verticalScrollBar.width - UM.Theme.getSize("default_margin").width : parent.width width: parent.width
height: childrenRect.height height: parent.height
anchors.margins: 10 * screenScaleFactor
UM.I18nCatalog clip: true
{
id: catalog contentHeight: contentColumn.height
name: "cura" ScrollBar.vertical: UM.ScrollBar { id: scrollbar }
}
ListModel ListModel
{ {
@ -57,20 +69,13 @@ UM.Dialog
Column Column
{ {
width: parent.width id: contentColumn
width: parent.width - scrollbar.width
height: childrenRect.height height: childrenRect.height
spacing: UM.Theme.getSize("wide_margin").height
UM.Label
{
id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project")
font: UM.Theme.getFont("large")
}
Column Column
{ {
width: parent.width width: parent.width - UM.Theme.getSize("default_margin").width
height: childrenRect.height height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("default_margin").width
@ -312,7 +317,7 @@ UM.Dialog
color: warning ? UM.Theme.getColor("warning") : "transparent" color: warning ? UM.Theme.getColor("warning") : "transparent"
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: parent.width width: parent.width
height: childrenRect.height + 2 * workspaceDialog.margin height: childrenRect.height + (warning ? 2 * workspaceDialog.margin : workspaceDialog.margin)
Column Column
{ {

View file

@ -26,18 +26,21 @@ Item
UM.TooltipArea UM.TooltipArea
{ {
id: comboboxTooltip id: comboboxTooltip
width: (parent.width / 3) | 0 width: (parent.width / 2.5) | 0
height: visible ? UM.Theme.getSize("default_margin").height : 0 height: visible ? UM.Theme.getSize("default_margin").height : 0
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
visible: comboboxVisible anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: comboboxTooltipText text: comboboxTooltipText
visible: comboboxVisible
UM.Label UM.Label
{ {
id: comboboxLabel id: comboboxLabel
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: UM.Theme.getSize("default_margin").height
visible: comboboxVisible && text != "" visible: comboboxVisible && text != ""
text: "" text: ""
font: UM.Theme.getFont("default_bold") font: UM.Theme.getFont("default_bold")