mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Rename tableScrollView to tableBase
It is no longer a scrollview, after all, since the TableView itself already scrolls (and leaves the header nicely at the top this way). Contributes to issue CURA-8686.
This commit is contained in:
parent
83953b03b4
commit
c6eb1e668d
2 changed files with 16 additions and 16 deletions
|
@ -18,7 +18,7 @@ import UM 1.5 as UM
|
|||
*/
|
||||
Item
|
||||
{
|
||||
id: tableScrollView
|
||||
id: tableBase
|
||||
|
||||
required property var columnHeaders //The text to show in the headers of each column.
|
||||
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
||||
|
@ -35,7 +35,7 @@ Item
|
|||
model: columnHeaders
|
||||
Rectangle
|
||||
{
|
||||
width: Math.round(tableScrollView.width / headerRepeater.count)
|
||||
width: Math.round(tableBase.width / headerRepeater.count)
|
||||
height: UM.Theme.getSize("section").height
|
||||
|
||||
color: UM.Theme.getColor("secondary")
|
||||
|
@ -85,9 +85,9 @@ Item
|
|||
{
|
||||
sum_widths += headerBar.children[i].width;
|
||||
}
|
||||
if(sum_widths > tableScrollView.width)
|
||||
if(sum_widths > tableBase.width)
|
||||
{
|
||||
parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view.
|
||||
parent.parent.width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
|
||||
}
|
||||
}
|
||||
tableView.forceLayout();
|
||||
|
@ -119,7 +119,7 @@ Item
|
|||
{
|
||||
implicitHeight: Math.max(1, cellContent.height)
|
||||
|
||||
color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
|
||||
color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
|
||||
|
||||
Label
|
||||
{
|
||||
|
@ -136,14 +136,14 @@ Item
|
|||
{
|
||||
anchors.fill: parent
|
||||
|
||||
enabled: tableScrollView.allowSelection
|
||||
enabled: tableBase.allowSelection
|
||||
onClicked:
|
||||
{
|
||||
tableScrollView.currentRow = row; //Select this row.
|
||||
tableBase.currentRow = row; //Select this row.
|
||||
}
|
||||
onDoubleClicked:
|
||||
{
|
||||
tableScrollView.onDoubleClicked(row);
|
||||
tableBase.onDoubleClicked(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import UM 1.5 as UM
|
|||
*/
|
||||
Item
|
||||
{
|
||||
id: tableScrollView
|
||||
id: tableBase
|
||||
|
||||
required property var columnHeaders //The text to show in the headers of each column.
|
||||
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
||||
|
@ -35,7 +35,7 @@ Item
|
|||
model: columnHeaders
|
||||
Rectangle
|
||||
{
|
||||
width: Math.round(tableScrollView.width / headerRepeater.count)
|
||||
width: Math.round(tableBase.width / headerRepeater.count)
|
||||
height: UM.Theme.getSize("section").height
|
||||
|
||||
color: UM.Theme.getColor("secondary")
|
||||
|
@ -85,9 +85,9 @@ Item
|
|||
{
|
||||
sum_widths += headerBar.children[i].width;
|
||||
}
|
||||
if(sum_widths > tableScrollView.width)
|
||||
if(sum_widths > tableBase.width)
|
||||
{
|
||||
parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view.
|
||||
parent.parent.width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
|
||||
}
|
||||
}
|
||||
tableView.forceLayout();
|
||||
|
@ -119,7 +119,7 @@ Item
|
|||
{
|
||||
implicitHeight: Math.max(1, cellContent.height)
|
||||
|
||||
color: UM.Theme.getColor((tableScrollView.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
|
||||
color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
|
||||
|
||||
Label
|
||||
{
|
||||
|
@ -136,14 +136,14 @@ Item
|
|||
{
|
||||
anchors.fill: parent
|
||||
|
||||
enabled: tableScrollView.allowSelection
|
||||
enabled: tableBase.allowSelection
|
||||
onClicked:
|
||||
{
|
||||
tableScrollView.currentRow = row; //Select this row.
|
||||
tableBase.currentRow = row; //Select this row.
|
||||
}
|
||||
onDoubleClicked:
|
||||
{
|
||||
tableScrollView.onDoubleClicked(row);
|
||||
tableBase.onDoubleClicked(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue