This commit is contained in:
朱子楚\zhuzi 2024-05-10 19:23:30 +08:00
parent cd3abc01e9
commit 4997b991db
2 changed files with 52 additions and 48 deletions

View File

@ -20,6 +20,30 @@ Rectangle {
property color selectedBorderColor: FluTheme.primaryColor property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3) property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view property alias view: table_view
property var columnWidthProvider: function(column) {
var columnModel = control.columnSource[column]
var width = columnModel.width
if(width){
return width
}
var minimumWidth = columnModel.minimumWidth
if(minimumWidth){
return minimumWidth
}
return d.defaultItemWidth
}
property var rowHeightProvider: function(row) {
var rowModel = control.getRow(row)
var height = rowModel.height
if(height){
return height
}
var minimumHeight = rowModel._minimumHeight
if(minimumHeight){
return minimumHeight
}
return d.defaultItemHeight
}
id:control id:control
color: { color: {
if(Window.active){ if(Window.active){
@ -438,30 +462,8 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
ScrollBar.horizontal:scroll_bar_h ScrollBar.horizontal:scroll_bar_h
ScrollBar.vertical:scroll_bar_v ScrollBar.vertical:scroll_bar_v
columnWidthProvider: function(column) { columnWidthProvider: control.columnWidthProvider
var columnModel = control.columnSource[column] rowHeightProvider: control.rowHeightProvider
var width = columnModel.width
if(width){
return width
}
var minimumWidth = columnModel.minimumWidth
if(minimumWidth){
return minimumWidth
}
return d.defaultItemWidth
}
rowHeightProvider: function(row) {
var rowModel = control.getRow(row)
var height = rowModel.height
if(height){
return height
}
var minimumHeight = rowModel._minimumHeight
if(minimumHeight){
return minimumHeight
}
return d.defaultItemHeight
}
model: table_sort_model model: table_sort_model
clip: true clip: true
onRowsChanged: { onRowsChanged: {

View File

@ -20,6 +20,30 @@ Rectangle {
property color selectedBorderColor: FluTheme.primaryColor property color selectedBorderColor: FluTheme.primaryColor
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3) property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
property alias view: table_view property alias view: table_view
property var columnWidthProvider: function(column) {
var columnModel = control.columnSource[column]
var width = columnModel.width
if(width){
return width
}
var minimumWidth = columnModel.minimumWidth
if(minimumWidth){
return minimumWidth
}
return d.defaultItemWidth
}
property var rowHeightProvider: function(row) {
var rowModel = control.getRow(row)
var height = rowModel.height
if(height){
return height
}
var minimumHeight = rowModel._minimumHeight
if(minimumHeight){
return minimumHeight
}
return d.defaultItemHeight
}
id:control id:control
color: { color: {
if(Window.active){ if(Window.active){
@ -438,30 +462,8 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
ScrollBar.horizontal:scroll_bar_h ScrollBar.horizontal:scroll_bar_h
ScrollBar.vertical:scroll_bar_v ScrollBar.vertical:scroll_bar_v
columnWidthProvider: function(column) { columnWidthProvider: control.columnWidthProvider
var columnModel = control.columnSource[column] rowHeightProvider: control.rowHeightProvider
var width = columnModel.width
if(width){
return width
}
var minimumWidth = columnModel.minimumWidth
if(minimumWidth){
return minimumWidth
}
return d.defaultItemWidth
}
rowHeightProvider: function(row) {
var rowModel = control.getRow(row)
var height = rowModel.height
if(height){
return height
}
var minimumHeight = rowModel._minimumHeight
if(minimumHeight){
return minimumHeight
}
return d.defaultItemHeight
}
model: table_sort_model model: table_sort_model
clip: true clip: true
onRowsChanged: { onRowsChanged: {