diff --git a/example/global/ItemsOriginal.qml b/example/global/ItemsOriginal.qml
index 31e5c9e..81a92c7 100644
--- a/example/global/ItemsOriginal.qml
+++ b/example/global/ItemsOriginal.qml
@@ -9,7 +9,14 @@ FluObject{
FluPaneItem{
title:"Home"
- icon:FluentIcons.Home
+ // icon:FluentIcons.Home
+ cusIcon: Image{
+ anchors.centerIn: parent
+ source: "qrc:/res/svg/home.svg"
+ sourceSize: Qt.size(30,30)
+ width: 18
+ height: 18
+ }
onTap:{
navigationView.push("qrc:/T_Home.qml")
}
diff --git a/example/qml.qrc b/example/qml.qrc
index 343900b..53e542d 100644
--- a/example/qml.qrc
+++ b/example/qml.qrc
@@ -160,5 +160,6 @@
T_StatusView.qml
T_Settings.qml
global/MainEvent.qml
+ res/svg/home.svg
diff --git a/example/res/svg/home.svg b/example/res/svg/home.svg
new file mode 100644
index 0000000..6502662
--- /dev/null
+++ b/example/res/svg/home.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/controls/FluNavigationView.qml b/src/controls/FluNavigationView.qml
index 4bff317..5c07d68 100644
--- a/src/controls/FluNavigationView.qml
+++ b/src/controls/FluNavigationView.qml
@@ -246,22 +246,37 @@ Item {
return Qt.rgba(0,0,0,0)
}
}
- FluIcon{
- id:item_icon
- iconSource: {
- if(model.icon){
- return model.icon
+ Component{
+ id:com_icon
+ FluIcon{
+ iconSource: {
+ if(model.icon){
+ return model.icon
+ }
+ return 0
}
- return 0
+ iconSize: 15
}
+ }
+
+ Item{
+ id:item_icon
width: 30
height: 30
- iconSize: 15
anchors{
verticalCenter: parent.verticalCenter
left:parent.left
leftMargin: 3
}
+ Loader{
+ anchors.centerIn: parent
+ sourceComponent: {
+ if(model.cusIcon){
+ return model.cusIcon
+ }
+ return com_icon
+ }
+ }
}
FluText{
id:item_title
@@ -382,23 +397,39 @@ Item {
return Qt.rgba(0,0,0,0)
}
}
- FluIcon{
- id:item_icon
- iconSource: {
- if(model.icon){
- return model.icon
+ Component{
+ id:com_icon
+ FluIcon{
+ iconSource: {
+ if(model.icon){
+ return model.icon
+ }
+ return 0
}
- return 0
+ iconSize: 15
}
+ }
+
+ Item{
+ id:item_icon
width: 30
height: 30
- iconSize: 15
anchors{
verticalCenter: parent.verticalCenter
left:parent.left
leftMargin: 3
}
+ Loader{
+ anchors.centerIn: parent
+ sourceComponent: {
+ if(model.cusIcon){
+ return model.cusIcon
+ }
+ return com_icon
+ }
+ }
}
+
FluText{
id:item_title
text:model.title
diff --git a/src/controls/FluPaneItem.qml b/src/controls/FluPaneItem.qml
index ff99799..93e5e92 100644
--- a/src/controls/FluPaneItem.qml
+++ b/src/controls/FluPaneItem.qml
@@ -7,6 +7,7 @@ QtObject {
property string title
property int order : 0
property int icon
+ property Component cusIcon
property bool recentlyAdded: false
property bool recentlyUpdated: false
property string desc
diff --git a/src/controls/FluPaneItemExpander.qml b/src/controls/FluPaneItemExpander.qml
index 600df94..abdc8d6 100644
--- a/src/controls/FluPaneItemExpander.qml
+++ b/src/controls/FluPaneItemExpander.qml
@@ -4,7 +4,8 @@ import FluentUI
FluObject {
readonly property string key : FluApp.uuid()
property string title
- property int icon
+ property var icon
+ property Component cusIcon
property bool isExpand: false
property var parent
property int idx
diff --git a/src/controls/FluWindow.qml b/src/controls/FluWindow.qml
index b8adfa7..fb60469 100644
--- a/src/controls/FluWindow.qml
+++ b/src/controls/FluWindow.qml
@@ -56,6 +56,8 @@ ApplicationWindow {
Component.onCompleted: {
helper.initWindow(window)
initArgument(argument)
+ window.x = (Screen.width - window.width)/2
+ window.y = (Screen.desktopAvailableHeight - window.height)/2
}
function showSuccess(text,duration,moremsg){