From c6eb1e668d3b89c60eab200943df2e7c5c679404 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Jan 2022 18:51:03 +0100 Subject: [PATCH] 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. --- plugins/DigitalLibrary/resources/qml/Table.qml | 16 ++++++++-------- resources/qml/TableView.qml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/Table.qml b/plugins/DigitalLibrary/resources/qml/Table.qml index 1b12c8ec38..cb4ca1fe37 100644 --- a/plugins/DigitalLibrary/resources/qml/Table.qml +++ b/plugins/DigitalLibrary/resources/qml/Table.qml @@ -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); } } } diff --git a/resources/qml/TableView.qml b/resources/qml/TableView.qml index 1b12c8ec38..cb4ca1fe37 100644 --- a/resources/qml/TableView.qml +++ b/resources/qml/TableView.qml @@ -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); } } }