This commit is contained in:
朱子楚\zhuzi 2023-06-29 22:30:15 +08:00
parent bfa5c93d40
commit 294606d019
7 changed files with 35 additions and 12 deletions

View File

@ -63,7 +63,7 @@ FluContentPage{
age:getRandomAge(),
address: getRandomAddresses(),
nickname: getRandomNickname(),
longstring:"测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试",
longstring:"你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好",
height:46,
minimumHeight:46,
maximumHeight:300,

View File

@ -44,8 +44,8 @@ ComboBox {
topPadding: 6 - control.padding
bottomPadding: 6 - control.padding
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
selectionColor: FluTheme.primaryColor.lightest
selectedTextColor: control.palette.highlightedText
selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
selectedTextColor: color
text: control.editable ? control.editText : control.displayText
enabled: control.editable
autoScroll: control.editable

View File

@ -15,9 +15,9 @@ TextEdit {
rightPadding: 0
topPadding: 0
selectByMouse: true
selectedTextColor: FluColors.Grey220
selectedTextColor: color
bottomPadding: 0
selectionColor: FluTheme.primaryColor.lightest
selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
font:FluTextStyle.Body
onSelectedTextChanged: {
control.forceActiveFocus()

View File

@ -23,7 +23,8 @@ TextArea{
font:FluTextStyle.Body
wrapMode: Text.WrapAnywhere
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
selectionColor: FluTheme.primaryColor.lightest
selectedTextColor: color
selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
placeholderTextColor: {
if(!enabled){
return placeholderDisableColor

View File

@ -24,7 +24,8 @@ TextField{
font:FluTextStyle.Body
echoMode:btn_reveal.pressed ? TextField.Normal : TextField.Password
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
selectionColor: FluTheme.primaryColor.lightest
selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
selectedTextColor: color
placeholderTextColor: {
if(!enabled){
return placeholderDisableColor

View File

@ -8,6 +8,7 @@ import FluentUI
Rectangle {
property var columnSource
property var dataSource
property color selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
id:control
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
onColumnSourceChanged: {
@ -185,17 +186,28 @@ Rectangle {
id:item_table
property var position: Qt.point(column,row)
required property bool selected
color: selected ? FluTheme.primaryColor.lightest: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
implicitHeight: 40
implicitWidth: columnSource[column].width
Rectangle{
anchors.fill: parent
visible: item_loader.sourceComponent === null
color: selected ? control.selectionColor : "#00000000"
}
MouseArea{
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onPressed:{
closeEditor()
table_view.interactive = false
}
onReleased: {
table_view.interactive = true
}
onDoubleClicked:{
if(display instanceof Component){
return
}
selection_model.clear()
item_loader.sourceComponent = d.obtEditDelegate(column,row)
}
onClicked:
@ -205,6 +217,7 @@ Rectangle {
selection_model.clear()
}
selection_model.select(table_model.index(row,column),ItemSelectionModel.Select)
event.accepted = true
}
}
Loader{
@ -231,6 +244,7 @@ Rectangle {
property int column
property int row
property var tableView: control
sourceComponent: null
onDisplayChanged: {
var obj = table_model.getRow(row)
obj[columnSource[column].dataIndex] = display
@ -252,6 +266,11 @@ Rectangle {
}
bottomRightHandle:com_handle
topLeftHandle: com_handle
onDraggingChanged: {
if(dragging === false){
table_view.interactive = true
}
}
}
TableView {
id: header_horizontal
@ -354,6 +373,7 @@ Rectangle {
id:row_text
anchors.centerIn: parent
text: row + 1
font.bold: true
}
TapHandler{
onDoubleTapped: {

View File

@ -23,7 +23,8 @@ TextField{
}
font:FluTextStyle.Body
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
selectionColor: FluTheme.primaryColor.lightest
selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
selectedTextColor: color
placeholderTextColor: {
if(!enabled){
return placeholderDisableColor