This commit is contained in:
朱子楚\zhuzi 2023-10-19 22:52:36 +08:00
parent ac63514451
commit 83f94630f1
9 changed files with 173 additions and 62 deletions

View File

@ -6,6 +6,7 @@ import FluentUI
FluObject{
property var navigationView
property var paneItemMenu
id:footer_items
@ -21,6 +22,7 @@ FluObject{
FluPaneItem{
title:Lang.settings
menuDelegate: paneItemMenu
icon:FluentIcons.Settings
url:"qrc:/example/qml/page/T_Settings.qml"
onTap:{
@ -29,4 +31,3 @@ FluObject{
}
}

View File

@ -6,6 +6,7 @@ import FluentUI
FluObject{
property var navigationView
property var paneItemMenu
function rename(item, newName){
if(newName && newName.trim().length>0){
@ -17,6 +18,7 @@ FluObject{
id:item_home
count: 9
title:Lang.home
menuDelegate: paneItemMenu
infoBadge:FluBadge{
count: item_home.count
}
@ -28,20 +30,6 @@ FluObject{
}
navigationView.push(url)
}
editDelegate: FluTextBox{
text:item_home.title
}
menuDelegate: FluMenu{
id:nav_item_right_menu
width: 120
FluMenuItem{
text: "重命名"
visible: true
onClicked: {
item_home.showEdit = true
}
}
}
}
FluPaneItemExpander{
@ -54,18 +42,6 @@ FluObject{
id:item_expander_basic_input
title:Lang.basic_input
icon:FluentIcons.CheckboxComposite
editDelegate: FluTextBox{
text:item_expander_basic_input.title
}
menuDelegate: FluMenu{
FluMenuItem{
text: "重命名"
visible: true
onClicked: {
item_expander_basic_input.showEdit = true
}
}
}
FluPaneItem{
id:item_buttons
count: 99
@ -73,6 +49,7 @@ FluObject{
count: item_buttons.count
}
title:"Buttons"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Button.png"
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
@ -85,6 +62,7 @@ FluObject{
FluPaneItem{
id:item_text
title:"Text"
menuDelegate: paneItemMenu
count: 5
infoBadge:FluBadge{
count: item_text.count
@ -98,11 +76,13 @@ FluObject{
}
FluPaneItem{
title:"Image"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Image.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Slider"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Slider.png"
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
@ -111,6 +91,7 @@ FluObject{
}
FluPaneItem{
title:"CheckBox"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Checkbox.png"
recentlyUpdated:true
desc:"A control that a user can select or clear."
@ -119,11 +100,13 @@ FluObject{
}
FluPaneItem{
title:"RadioButton"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_RadioButton.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ToggleSwitch"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
onTap:{ navigationView.push(url) }
}
@ -139,26 +122,31 @@ FluObject{
icon:FluentIcons.GridView
FluPaneItem{
title:"TextBox"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_TextBox.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TimePicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_TimePicker.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"DatePicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_DatePicker.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"CalendarPicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ColorPicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_ColorPicker.qml"
onTap:{ navigationView.push(url) }
}
@ -169,6 +157,7 @@ FluObject{
icon:FluentIcons.SurfaceHub
FluPaneItem{
title:"InfoBar"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/InfoBar.png"
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
@ -177,51 +166,61 @@ FluObject{
}
FluPaneItem{
title:"Progress"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Progress.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"RatingControl"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_RatingControl.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Badge"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Badge.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Rectangle"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Rectangle.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Clip"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Clip.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StatusView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StatusView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Carousel"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Carousel.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Expander"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Expander.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StaggeredView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StaggeredView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Watermark"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Watermark.qml"
onTap:{ navigationView.push(url) }
}
@ -232,12 +231,14 @@ FluObject{
icon:FluentIcons.ButtonMenu
FluPaneItem{
title:"Dialog"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Dialog.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_combobox
title:"ComboBox"
menuDelegate: paneItemMenu
count: 9
infoBadge:FluBadge{
count: item_combobox.count
@ -251,11 +252,13 @@ FluObject{
}
FluPaneItem{
title:"Tooltip"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Tooltip.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Menu"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Menu.qml"
onTap:{ navigationView.push(url) }
}
@ -266,6 +269,7 @@ FluObject{
icon:FluentIcons.AllApps
FluPaneItem{
title:"Pivot"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Pivot.png"
recentlyAdded:true
order:3
@ -275,11 +279,13 @@ FluObject{
}
FluPaneItem{
title:"BreadcrumbBar"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TabView"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/TabView.png"
recentlyAdded:true
order:1
@ -289,11 +295,13 @@ FluObject{
}
FluPaneItem{
title:"TreeView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_TreeView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TableView"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/DataGrid.png"
recentlyAdded:true
order:4
@ -303,16 +311,19 @@ FluObject{
}
FluPaneItem{
title:"Pagination"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Pagination.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"MultiWindow"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_MultiWindow.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"FlipView"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/FlipView.png"
recentlyAdded:true
order:2
@ -327,21 +338,25 @@ FluObject{
icon:FluentIcons.Brightness
FluPaneItem{
title:"Acrylic"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Acrylic.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Theme"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Theme.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Typography"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Typography.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Awesome"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Awesome.qml"
onTap:{ navigationView.push(url) }
}
@ -357,42 +372,50 @@ FluObject{
icon:FluentIcons.Shop
FluPaneItem{
title:"QRCode"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_QRCode.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Tour"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Tour.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Timeline"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Timeline.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Screenshot(Todo)"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Screenshot.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Captcha"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Captcha.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Chart"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Chart.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Http"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Http.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_other
title:"RemoteLoader"
menuDelegate: paneItemMenu
count: 99
infoBadge:FluBadge{
count: item_other.count
@ -412,6 +435,7 @@ FluObject{
}
FluPaneItem{
title:"3D"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_3D.qml"
onTap:{ navigationView.push(url) }
}
@ -474,4 +498,3 @@ FluObject{
}
}

View File

@ -18,7 +18,6 @@ FluWindow {
minimumWidth: 520
minimumHeight: 200
launchMode: FluWindowType.SingleTask
appBar: undefined
SettingsViewModel{
@ -32,6 +31,7 @@ FluWindow {
checkUpdate(false)
}
}
Component.onCompleted: {
tour.open()
checkUpdate(true)
@ -51,7 +51,7 @@ FluWindow {
MenuItem {
text: "退出"
onTriggered: {
window.close()
FluApp.exit()
}
}
}
@ -78,7 +78,22 @@ FluWindow {
positiveText:"退出"
neutralText:"取消"
onPositiveClicked:{
FluApp.exit()
FluApp.exit(0)
}
}
Component{
id:nav_item_right_menu
FluMenu{
id:menu
width: 130
FluMenuItem{
text: "在独立窗口打开"
visible: true
onClicked: {
FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
}
}
}
}
@ -148,7 +163,7 @@ FluWindow {
id:loader
lazy: true
anchors.fill: parent
source: "https://zhu-zichu.gitee.io/Qt6_156_LieflatPage.qml"
source: "https://zhu-zichu.gitee.io/Qt5_156_LieflatPage.qml"
}
}
front: Item{
@ -164,8 +179,8 @@ FluWindow {
}
darkText: Lang.dark_mode
showDark: true
closeClickListener: ()=>{dialog_close.open()}
darkClickListener:(button)=>handleDarkChanged(button)
closeClickListener: ()=>{dialog_close.open()}
z:7
}
FluNavigationView{
@ -204,7 +219,9 @@ FluWindow {
}
Component.onCompleted: {
ItemsOriginal.navigationView = nav_view
ItemsOriginal.paneItemMenu = nav_item_right_menu
ItemsFooter.navigationView = nav_view
ItemsFooter.paneItemMenu = nav_item_right_menu
setCurrentIndex(0)
}
}

View File

@ -6,6 +6,7 @@ import FluentUI 1.0
FluObject{
property var navigationView
property var paneItemMenu
id:footer_items
@ -21,6 +22,7 @@ FluObject{
FluPaneItem{
title:Lang.settings
menuDelegate: paneItemMenu
icon:FluentIcons.Settings
url:"qrc:/example/qml/page/T_Settings.qml"
onTap:{

View File

@ -6,6 +6,7 @@ import FluentUI 1.0
FluObject{
property var navigationView
property var paneItemMenu
function rename(item, newName){
if(newName && newName.trim().length>0){
@ -17,6 +18,7 @@ FluObject{
id:item_home
count: 9
title:Lang.home
menuDelegate: paneItemMenu
infoBadge:FluBadge{
count: item_home.count
}
@ -28,20 +30,6 @@ FluObject{
}
navigationView.push(url)
}
editDelegate: FluTextBox{
text:item_home.title
}
menuDelegate: FluMenu{
id:nav_item_right_menu
width: 120
FluMenuItem{
text: "重命名"
visible: true
onClicked: {
item_home.showEdit = true
}
}
}
}
FluPaneItemExpander{
@ -54,18 +42,6 @@ FluObject{
id:item_expander_basic_input
title:Lang.basic_input
icon:FluentIcons.CheckboxComposite
editDelegate: FluTextBox{
text:item_expander_basic_input.title
}
menuDelegate: FluMenu{
FluMenuItem{
text: "重命名"
visible: true
onClicked: {
item_expander_basic_input.showEdit = true
}
}
}
FluPaneItem{
id:item_buttons
count: 99
@ -73,6 +49,7 @@ FluObject{
count: item_buttons.count
}
title:"Buttons"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Button.png"
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
@ -85,6 +62,7 @@ FluObject{
FluPaneItem{
id:item_text
title:"Text"
menuDelegate: paneItemMenu
count: 5
infoBadge:FluBadge{
count: item_text.count
@ -98,11 +76,13 @@ FluObject{
}
FluPaneItem{
title:"Image"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Image.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Slider"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Slider.png"
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
@ -111,6 +91,7 @@ FluObject{
}
FluPaneItem{
title:"CheckBox"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Checkbox.png"
recentlyUpdated:true
desc:"A control that a user can select or clear."
@ -119,11 +100,13 @@ FluObject{
}
FluPaneItem{
title:"RadioButton"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_RadioButton.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ToggleSwitch"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
onTap:{ navigationView.push(url) }
}
@ -139,26 +122,31 @@ FluObject{
icon:FluentIcons.GridView
FluPaneItem{
title:"TextBox"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_TextBox.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TimePicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_TimePicker.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"DatePicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_DatePicker.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"CalendarPicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ColorPicker"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_ColorPicker.qml"
onTap:{ navigationView.push(url) }
}
@ -169,6 +157,7 @@ FluObject{
icon:FluentIcons.SurfaceHub
FluPaneItem{
title:"InfoBar"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/InfoBar.png"
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
@ -177,51 +166,61 @@ FluObject{
}
FluPaneItem{
title:"Progress"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Progress.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"RatingControl"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_RatingControl.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Badge"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Badge.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Rectangle"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Rectangle.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Clip"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Clip.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StatusView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StatusView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Carousel"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Carousel.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Expander"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Expander.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StaggeredView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StaggeredView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Watermark"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Watermark.qml"
onTap:{ navigationView.push(url) }
}
@ -232,12 +231,14 @@ FluObject{
icon:FluentIcons.ButtonMenu
FluPaneItem{
title:"Dialog"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Dialog.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_combobox
title:"ComboBox"
menuDelegate: paneItemMenu
count: 9
infoBadge:FluBadge{
count: item_combobox.count
@ -251,11 +252,13 @@ FluObject{
}
FluPaneItem{
title:"Tooltip"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Tooltip.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Menu"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Menu.qml"
onTap:{ navigationView.push(url) }
}
@ -266,6 +269,7 @@ FluObject{
icon:FluentIcons.AllApps
FluPaneItem{
title:"Pivot"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Pivot.png"
recentlyAdded:true
order:3
@ -275,11 +279,13 @@ FluObject{
}
FluPaneItem{
title:"BreadcrumbBar"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TabView"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/TabView.png"
recentlyAdded:true
order:1
@ -289,11 +295,13 @@ FluObject{
}
FluPaneItem{
title:"TreeView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_TreeView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TableView"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/DataGrid.png"
recentlyAdded:true
order:4
@ -303,16 +311,19 @@ FluObject{
}
FluPaneItem{
title:"Pagination"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Pagination.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"MultiWindow"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_MultiWindow.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"FlipView"
menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/FlipView.png"
recentlyAdded:true
order:2
@ -327,21 +338,25 @@ FluObject{
icon:FluentIcons.Brightness
FluPaneItem{
title:"Acrylic"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Acrylic.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Theme"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Theme.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Typography"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Typography.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Awesome"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Awesome.qml"
onTap:{ navigationView.push(url) }
}
@ -357,42 +372,50 @@ FluObject{
icon:FluentIcons.Shop
FluPaneItem{
title:"QRCode"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_QRCode.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Tour"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Tour.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Timeline"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Timeline.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Screenshot(Todo)"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Screenshot.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Captcha"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Captcha.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Chart"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Chart.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Http"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_Http.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_other
title:"RemoteLoader"
menuDelegate: paneItemMenu
count: 99
infoBadge:FluBadge{
count: item_other.count
@ -412,6 +435,7 @@ FluObject{
}
FluPaneItem{
title:"3D"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_3D.qml"
onTap:{ navigationView.push(url) }
}

View File

@ -81,7 +81,22 @@ FluWindow {
positiveText:"退出"
neutralText:"取消"
onPositiveClicked:{
window.close()
FluApp.exit(0)
}
}
Component{
id:nav_item_right_menu
FluMenu{
id:menu
width: 130
FluMenuItem{
text: "在独立窗口打开"
visible: true
onClicked: {
FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
}
}
}
}
@ -207,7 +222,9 @@ FluWindow {
}
Component.onCompleted: {
ItemsOriginal.navigationView = nav_view
ItemsOriginal.paneItemMenu = nav_item_right_menu
ItemsFooter.navigationView = nav_view
ItemsFooter.paneItemMenu = nav_item_right_menu
setCurrentIndex(0)
}
}

View File

@ -88,6 +88,7 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
void FluApp::exit(int retCode){
for (const auto& pair : _windows.toStdMap()) {
pair.second->close();
removeWindow(pair.second);
}
qApp->exit(retCode);

View File

@ -184,7 +184,9 @@ Item {
if (mouse.button === Qt.RightButton) {
if(model.menuDelegate){
loader_item_menu.sourceComponent = model.menuDelegate
loader_item_menu.item.popup()
connection_item_menu.target = loader_item_menu.item
loader_item_menu.modelData = model
loader_item_menu.item.popup();
}
}
}
@ -497,6 +499,8 @@ Item {
if (mouse.button === Qt.RightButton) {
if(model.menuDelegate){
loader_item_menu.sourceComponent = model.menuDelegate
connection_item_menu.target = loader_item_menu.item
loader_item_menu.modelData = model
loader_item_menu.item.popup();
}
}else{
@ -1197,8 +1201,17 @@ Item {
}
}
Loader{
property var modelData
id:loader_item_menu
}
Connections{
id:connection_item_menu
function onVisibleChanged(visible){
if(target.visible === false){
loader_item_menu.sourceComponent = undefined
}
}
}
Component{
id:com_placeholder
Item{

View File

@ -185,7 +185,9 @@ Item {
if (mouse.button === Qt.RightButton) {
if(model.menuDelegate){
loader_item_menu.sourceComponent = model.menuDelegate
loader_item_menu.item.popup()
connection_item_menu.target = loader_item_menu.item
loader_item_menu.modelData = model
loader_item_menu.item.popup();
}
}
}
@ -498,6 +500,8 @@ Item {
if (mouse.button === Qt.RightButton) {
if(model.menuDelegate){
loader_item_menu.sourceComponent = model.menuDelegate
connection_item_menu.target = loader_item_menu.item
loader_item_menu.modelData = model
loader_item_menu.item.popup();
}
}else{
@ -1198,8 +1202,17 @@ Item {
}
}
Loader{
property var modelData
id:loader_item_menu
}
Connections{
id:connection_item_menu
function onVisibleChanged(visible){
if(target.visible === false){
loader_item_menu.sourceComponent = undefined
}
}
}
Component{
id:com_placeholder
Item{