mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 17:55:25 +08:00
update
This commit is contained in:
@ -104,7 +104,7 @@ FluObject {
|
||||
}
|
||||
}
|
||||
property Component fluent_sytle: Rectangle{
|
||||
width: rowlayout.width + (_super.moremsg ? 25 : 80);
|
||||
width: rowlayout.width + (btn_close.visible ? 30 : 48);
|
||||
height: rowlayout.height + 20;
|
||||
color: {
|
||||
if(FluTheme.dark){
|
||||
@ -154,7 +154,6 @@ FluObject {
|
||||
x:20;
|
||||
y:(parent.height - height) / 2;
|
||||
spacing: 10
|
||||
|
||||
FluIcon{
|
||||
iconSource:{
|
||||
switch(_super.type){
|
||||
@ -199,14 +198,15 @@ FluObject {
|
||||
visible: _super.moremsg
|
||||
wrapMode : Text.WordWrap
|
||||
textColor: FluColors.Grey120
|
||||
width: Math.min(implicitWidth,mcontrol.maxWidth)
|
||||
}
|
||||
}
|
||||
|
||||
FluIconButton{
|
||||
id:btn_close
|
||||
iconSource: FluentIcons.ChromeClose
|
||||
iconSize: 10
|
||||
y:5
|
||||
x:parent.width-35
|
||||
visible: _super.duration<=0
|
||||
iconColor: {
|
||||
if(FluTheme.dark){
|
||||
|
@ -57,9 +57,11 @@ Rectangle {
|
||||
}
|
||||
onDataSourceChanged: {
|
||||
table_model.clear()
|
||||
dataSource.forEach(function(item){
|
||||
table_model.appendRow(item)
|
||||
})
|
||||
for(var i =0;i<dataSource.length;i++){
|
||||
var row = dataSource[i]
|
||||
row.__index= i
|
||||
table_model.appendRow(row)
|
||||
}
|
||||
}
|
||||
TableModel {
|
||||
id:table_model
|
||||
@ -570,4 +572,18 @@ Rectangle {
|
||||
function updateRow(row,obj){
|
||||
table_model.setRow(row,obj)
|
||||
}
|
||||
function sort(order){
|
||||
let sortedArray = []
|
||||
for(var i =0;i<table_model.rowCount;i++){
|
||||
let row = table_model.getRow(i)
|
||||
sortedArray.push(row)
|
||||
}
|
||||
if(order === undefined){
|
||||
sortedArray.sort((a, b) => a.__index - b.__index)
|
||||
}else{
|
||||
sortedArray.sort(order)
|
||||
}
|
||||
table_model.clear()
|
||||
table_model.rows = sortedArray
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user