This commit is contained in:
zhuzichu 2023-07-07 11:47:03 +08:00
parent a273aa4588
commit 9223d5f937
12 changed files with 57 additions and 79 deletions

View File

@ -23,8 +23,6 @@ FluScrollablePage{
text:"此颜色组件是Github上的开源项目"
}
FluTextButton{
leftPadding: 0
rightPadding: 0
text:"https://github.com/rshest/qml-colorpicker"
onClicked: {
Qt.openUrlExternally(text)

View File

@ -168,9 +168,9 @@ CustomWindow {
width: parent.width
height: parent.height
z:999
//NoStack
// pageMode: FluNavigationView.NoStack
//StackpopFluPagelaunchMode
// pageMode: FluNavigationView.Stack
//NoStack
pageMode: FluNavigationView.NoStack
items: ItemsOriginal
footerItems:ItemsFooter

View File

@ -30,15 +30,10 @@ FluTextBox{
duration: 83
}
}
onVisibleChanged: {
if(visible){
list_view.currentIndex = -1
}
}
background: Rectangle{
background: FluRectangle{
id:container
width: control.width
radius: 4
radius: [4,4,4,4]
FluShadow{
radius: 4
}
@ -48,7 +43,7 @@ FluTextBox{
id:list_view
anchors.fill: parent
clip: true
currentIndex: -1
boundsBehavior: ListView.StopAtBounds
ScrollBar.vertical: FluScrollBar {}
header: Item{
width: control.width
@ -63,49 +58,30 @@ FluTextBox{
}
}
}
delegate:Control{
delegate:FluControl{
id:item_control
height: 38
width: control.width
padding:10
background: Rectangle{
color: {
if(list_view.currentIndex === index){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
onClicked:{
handleClick(modelData)
}
background: Rectangle{
FluFocusRectangle{
visible: item_control.activeFocus
radius:4
}
color: {
if(hovered){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
}
MouseArea{
id:mouse_area
anchors.fill: parent
Connections{
target: control
function onHandleClicked(){
if((list_view.currentIndex === index)){
handleClick(modelData)
}
}
}
onClicked: handleClick(modelData)
}
Rectangle{
width: 3
color:FluTheme.primaryColor.dark
visible: list_view.currentIndex === index
radius: 3
height: 20
anchors{
left: parent.left
verticalCenter: parent.verticalCenter
}
}
}
contentItem: FluText{
text:modelData.title
anchors{
verticalCenter: parent.verticalCenter
}
leftPadding: 10
rightPadding: 10
verticalAlignment : Qt.AlignVCenter
}
}
}

View File

@ -2,38 +2,41 @@ import QtQuick
import QtQuick.Controls
import FluentUI
Item {
property alias sourceSize : image.sourceSize
property alias fillMode : image.fillMode
property url source
Image {
property string errorButtonText: "重新加载"
property var status
property var clickErrorListener : function(){
image.source = ""
image.source = control.source
}
property Component errorItem : com_error
property Component loadingItem: com_loading
id: control
Image{
id:image
Loader{
anchors.fill: parent
source: control.source
opacity: control.status === Image.Ready
onStatusChanged:{
control.status = image.status
}
Behavior on opacity {
NumberAnimation{
duration: 83
sourceComponent: {
if(control.status === Image.Loading){
return com_loading
}else if(control.status == Image.Error){
return com_error
}else{
return undefined
}
}
}
Component{
id:com_loading
Rectangle{
anchors.fill: parent
color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
FluProgressRing{
anchors.centerIn: parent
visible: control.status === Image.Loading
}
}
}
Component{
id:com_error
Rectangle{
color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
FluFilledButton{
text: control.errorButtonText
anchors.centerIn: parent
@ -41,4 +44,5 @@ Item {
onClicked: clickErrorListener()
}
}
}
}

View File

@ -1097,7 +1097,7 @@ Item {
var items = getItems()
for(var i=0;i<items.length;i++){
var item = items[i]
if(item._key === data._key){
if(item.key === data.key){
if(getCurrentIndex() === i){
return
}

View File

@ -3,7 +3,7 @@ import QtQuick.Controls
import FluentUI
QtObject {
readonly property string _key : FluTools.uuid()
readonly property string key : FluTools.uuid()
property int _idx
property var _ext
property string title

View File

@ -3,7 +3,7 @@ import QtQuick.Controls
import FluentUI
QtObject {
readonly property string _key : FluTools.uuid()
readonly property string key : FluTools.uuid()
property int _idx
property var _ext
property var parent

View File

@ -3,7 +3,7 @@ import QtQuick.Controls
import FluentUI
FluObject {
readonly property string _key : FluTools.uuid()
readonly property string key : FluTools.uuid()
property int _idx
property string title
property var icon

View File

@ -3,7 +3,7 @@ import QtQuick.Controls
import FluentUI
QtObject {
readonly property string _key : FluTools.uuid()
readonly property string key : FluTools.uuid()
property int _idx
property string title
property var parent

View File

@ -3,7 +3,7 @@ import QtQuick.Controls
import FluentUI
QtObject {
readonly property string _key : FluTools.uuid()
readonly property string key : FluTools.uuid()
property int _idx
property var parent
}

View File

@ -42,7 +42,7 @@ Item{
if(statusMode === FluStatusView.Error){
return errorItem
}
return null
return undefined
}
}
Component{

View File

@ -246,7 +246,7 @@ Rectangle {
}
onClicked:
(event)=>{
item_loader.sourceComponent = null
item_loader.sourceComponent = undefined
if(!(event.modifiers & Qt.ControlModifier)){
selection_model.clear()
}
@ -279,7 +279,7 @@ Rectangle {
property int column
property int row
property var tableView: control
sourceComponent: null
sourceComponent: undefined
onDisplayChanged: {
var obj = table_model.getRow(row)
obj[columnSource[column].dataIndex] = display