Change width column widths in AddLocalPrinterScrollView

To make sure that printer names are not truncated.
From CCB
This commit is contained in:
Kostas Karmas 2020-08-03 13:50:29 +02:00
parent 877e2213de
commit f80dbefad3

View file

@ -15,7 +15,6 @@ import Cura 1.1 as Cura
Item Item
{ {
id: base id: base
height: childrenRect.height
// The currently selected machine item in the local machine list. // The currently selected machine item in the local machine list.
property var currentItem: (machineList.currentIndex >= 0) property var currentItem: (machineList.currentIndex >= 0)
@ -78,7 +77,6 @@ Item
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
height: childrenRect.height
// ScrollView + ListView for selecting a local printer to add // ScrollView + ListView for selecting a local printer to add
Cura.ScrollView Cura.ScrollView
@ -86,7 +84,7 @@ Item
id: scrollView id: scrollView
height: childrenHeight height: childrenHeight
width: Math.floor(parent.width * 0.4) width: Math.floor(parent.width * 0.48)
ListView ListView
{ {
@ -203,7 +201,7 @@ Item
// User-editable printer name row // User-editable printer name row
Column Column
{ {
width: Math.floor(parent.width * 0.6) width: Math.floor(parent.width * 0.52)
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
padding: UM.Theme.getSize("default_margin").width padding: UM.Theme.getSize("default_margin").width
@ -228,6 +226,7 @@ Item
Label Label
{ {
id: manufacturerLabel
text: catalog.i18nc("@label", "Manufacturer") text: catalog.i18nc("@label", "Manufacturer")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
@ -236,12 +235,15 @@ Item
Label Label
{ {
text: base.getMachineMetaDataEntry("manufacturer") text: base.getMachineMetaDataEntry("manufacturer")
width: parent.width - manufacturerLabel.width
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
renderType: Text.NativeRendering renderType: Text.NativeRendering
wrapMode: Text.WordWrap
} }
Label Label
{ {
id: profileAuthorLabel
text: catalog.i18nc("@label", "Profile author") text: catalog.i18nc("@label", "Profile author")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
@ -250,13 +252,16 @@ Item
Label Label
{ {
text: base.getMachineMetaDataEntry("author") text: base.getMachineMetaDataEntry("author")
width: parent.width - profileAuthorLabel.width
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
renderType: Text.NativeRendering renderType: Text.NativeRendering
wrapMode: Text.WordWrap
} }
Label Label
{ {
id: printerNameLabel
text: catalog.i18nc("@label", "Printer name") text: catalog.i18nc("@label", "Printer name")
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
@ -266,7 +271,7 @@ Item
Cura.TextField Cura.TextField
{ {
id: printerNameTextField id: printerNameTextField
placeholderText: catalog.i18nc("@text", "Please give your printer a name") placeholderText: catalog.i18nc("@text", "Please name your printer")
maximumLength: 40 maximumLength: 40
validator: RegExpValidator validator: RegExpValidator
{ {