mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 11:17:15 +08:00
update
This commit is contained in:
parent
a273aa4588
commit
9223d5f937
@ -23,8 +23,6 @@ FluScrollablePage{
|
||||
text:"此颜色组件是Github上的开源项目"
|
||||
}
|
||||
FluTextButton{
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
text:"https://github.com/rshest/qml-colorpicker"
|
||||
onClicked: {
|
||||
Qt.openUrlExternally(text)
|
||||
|
@ -168,9 +168,9 @@ CustomWindow {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
z:999
|
||||
//NoStack模式,每次切换都会销毁之前的页面然后创建一个新的页面,只需消耗少量内存(推荐)
|
||||
// pageMode: FluNavigationView.NoStack
|
||||
//Stack模式,每次切换都会将页面压入栈中,随着栈的页面增多,消耗的内存也越多,内存消耗多就会卡顿,这时候就需要按返回将页面pop掉,释放内存。该模式可以配合FluPage中的launchMode属性,设置页面的启动模式
|
||||
// pageMode: FluNavigationView.Stack
|
||||
//NoStack模式,每次切换都会销毁之前的页面然后创建一个新的页面,只需消耗少量内存(推荐)
|
||||
pageMode: FluNavigationView.NoStack
|
||||
items: ItemsOriginal
|
||||
footerItems:ItemsFooter
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ Item{
|
||||
if(statusMode === FluStatusView.Error){
|
||||
return errorItem
|
||||
}
|
||||
return null
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
Component{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user