mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-04 00:55:30 +08:00
Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
cac1864d65 | |||
9846415838 | |||
840ae7ec2f | |||
05f51c788e | |||
19a5883e76 | |||
da0184f70e | |||
ea79becd08 | |||
1e5c70c7b4 | |||
c6a43c41db | |||
5f6d66b6ce | |||
83f94630f1 | |||
ac63514451 | |||
4d197d2697 | |||
b78aaaad48 | |||
3784a86936 | |||
0ee0c8c68f | |||
ec2ddc24eb | |||
baf5438262 | |||
b452218e79 | |||
cb5b9d8541 | |||
4ec772fff2 | |||
8f9c529153 | |||
483c5f8e09 | |||
0402b07dba | |||
ee071ee451 | |||
487cbefd82 | |||
b836b25028 | |||
0eacc177d0 | |||
9b5167d92e | |||
3a775a8bb2 | |||
0030c44a6c | |||
83cd2873c6 | |||
f385e34d23 | |||
fc1b62d4a3 | |||
9985053f82 |
10
.github/workflows/macos.yml
vendored
10
.github/workflows/macos.yml
vendored
@ -21,8 +21,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-12]
|
||||
qt_ver: [6.5.0]
|
||||
os: [macos-13]
|
||||
qt_ver: [6.6.0]
|
||||
qt_arch: [clang_64]
|
||||
env:
|
||||
targetName: example
|
||||
@ -50,17 +50,17 @@ jobs:
|
||||
cmake --version
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.5.0/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.6.0/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake --build . --target all --config Release --parallel
|
||||
|
||||
- name: package
|
||||
run: |
|
||||
# 拷贝依赖
|
||||
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||||
macdeployqt bin/release/${targetName}.app -qmldir=. -dmg
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
|
||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
|
||||
path: bin/release/${{ env.targetName }}.app
|
||||
|
||||
- name: uploadRelease
|
||||
|
4
.github/workflows/ubuntu.yml
vendored
4
.github/workflows/ubuntu.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
qt_ver: [6.5.0]
|
||||
qt_ver: [6.6.0]
|
||||
qt_arch: [gcc_64]
|
||||
env:
|
||||
targetName: example
|
||||
@ -55,7 +55,7 @@ jobs:
|
||||
cmake --version
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.5.0/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.6.0/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake --build . --target all --config Release --parallel
|
||||
|
||||
- name: install QT linux deploy
|
||||
|
4
.github/workflows/windows-mingw.yml
vendored
4
.github/workflows/windows-mingw.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
||||
os: [windows-2022]
|
||||
include:
|
||||
- qt_arch: win64_mingw
|
||||
qt_ver: 6.5.0
|
||||
qt_ver: 6.6.0
|
||||
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||||
qt_tools_mingw_install: mingw900_64
|
||||
env:
|
||||
@ -69,7 +69,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
ninja --version
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.6.0\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake --build . --target all --config Release --parallel
|
||||
|
||||
- name: package
|
||||
|
4
.github/workflows/windows.yml
vendored
4
.github/workflows/windows.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
matrix:
|
||||
os: [windows-2019]
|
||||
include:
|
||||
- qt_ver: 6.5.0
|
||||
- qt_ver: 6.6.0
|
||||
qt_arch: win64_msvc2019_64
|
||||
msvc_arch: x64
|
||||
qt_arch_install: msvc2019_64
|
||||
@ -52,7 +52,7 @@ jobs:
|
||||
ninja --version
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.6.0\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||
cmake --build . --target all --config Release --parallel
|
||||
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
||||
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
||||
|
@ -4,9 +4,8 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
||||
Window {
|
||||
Item {
|
||||
id: app
|
||||
flags: Qt.SplashScreen
|
||||
|
||||
Connections{
|
||||
target: FluTheme
|
||||
|
@ -6,6 +6,7 @@ import FluentUI
|
||||
FluObject{
|
||||
|
||||
property var navigationView
|
||||
property var paneItemMenu
|
||||
|
||||
id:footer_items
|
||||
|
||||
@ -14,7 +15,6 @@ FluObject{
|
||||
FluPaneItem{
|
||||
title:Lang.about
|
||||
icon:FluentIcons.Contact
|
||||
onDropped: { FluApp.navigate("/about") }
|
||||
onTapListener:function(){
|
||||
FluApp.navigate("/about")
|
||||
}
|
||||
@ -22,9 +22,9 @@ FluObject{
|
||||
|
||||
FluPaneItem{
|
||||
title:Lang.settings
|
||||
menuDelegate: paneItemMenu
|
||||
icon:FluentIcons.Settings
|
||||
url:"qrc:/example/qml/page/T_Settings.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
navigationView.push(url)
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import FluentUI
|
||||
FluObject{
|
||||
|
||||
property var navigationView
|
||||
property var paneItemMenu
|
||||
|
||||
function rename(item, newName){
|
||||
if(newName && newName.trim().length>0){
|
||||
@ -17,32 +18,18 @@ FluObject{
|
||||
id:item_home
|
||||
count: 9
|
||||
title:Lang.home
|
||||
menuDelegate: paneItemMenu
|
||||
infoBadge:FluBadge{
|
||||
count: item_home.count
|
||||
}
|
||||
icon:FluentIcons.Home
|
||||
url:"qrc:/example/qml/page/T_Home.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
if(navigationView.getCurrentUrl()){
|
||||
item_home.count = 0
|
||||
}
|
||||
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{
|
||||
@ -55,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
|
||||
@ -74,11 +49,11 @@ 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."
|
||||
url:"qrc:/example/qml/page/T_Buttons.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_buttons.count = 0
|
||||
navigationView.push(url)
|
||||
@ -87,13 +62,13 @@ FluObject{
|
||||
FluPaneItem{
|
||||
id:item_text
|
||||
title:"Text"
|
||||
menuDelegate: paneItemMenu
|
||||
count: 5
|
||||
infoBadge:FluBadge{
|
||||
count: item_text.count
|
||||
color: Qt.rgba(82/255,196/255,26/255,1)
|
||||
}
|
||||
url:"qrc:/example/qml/page/T_Text.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_text.count = 0
|
||||
navigationView.push(url)
|
||||
@ -101,38 +76,38 @@ FluObject{
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Image"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Image.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
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."
|
||||
url:"qrc:/example/qml/page/T_Slider.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
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."
|
||||
url:"qrc:/example/qml/page/T_CheckBox.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"RadioButton"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_RadioButton.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"ToggleSwitch"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
@ -147,32 +122,32 @@ FluObject{
|
||||
icon:FluentIcons.GridView
|
||||
FluPaneItem{
|
||||
title:"TextBox"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_TextBox.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TimePicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_TimePicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"DatePicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_DatePicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"CalendarPicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"ColorPicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_ColorPicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -182,71 +157,71 @@ 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."
|
||||
url:"qrc:/example/qml/page/T_InfoBar.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Progress"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Progress.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"RatingControl"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_RatingControl.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Badge"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Badge.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Rectangle"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Rectangle.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Clip"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Clip.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"StatusView"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_StatusView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Carousel"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Carousel.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Expander"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Expander.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"StaggeredView"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_StaggeredView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Watermark"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Watermark.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -256,20 +231,20 @@ FluObject{
|
||||
icon:FluentIcons.ButtonMenu
|
||||
FluPaneItem{
|
||||
title:"Dialog"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Dialog.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
id:item_combobox
|
||||
title:"ComboBox"
|
||||
menuDelegate: paneItemMenu
|
||||
count: 9
|
||||
infoBadge:FluBadge{
|
||||
count: item_combobox.count
|
||||
color: Qt.rgba(250/255,173/255,20/255,1)
|
||||
}
|
||||
url:"qrc:/example/qml/page/T_ComboBox.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_combobox.count = 0
|
||||
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
|
||||
@ -277,14 +252,14 @@ FluObject{
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Tooltip"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Tooltip.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Menu"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Menu.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -294,66 +269,66 @@ FluObject{
|
||||
icon:FluentIcons.AllApps
|
||||
FluPaneItem{
|
||||
title:"Pivot"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/Pivot.png"
|
||||
recentlyAdded:true
|
||||
order:3
|
||||
desc:"Presents information from different sources in atabbed view."
|
||||
url:"qrc:/example/qml/page/T_Pivot.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"BreadcrumbBar"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TabView"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/TabView.png"
|
||||
recentlyAdded:true
|
||||
order:1
|
||||
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
||||
url:"qrc:/example/qml/page/T_TabView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TreeView"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_TreeView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TableView"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/DataGrid.png"
|
||||
recentlyAdded:true
|
||||
order:4
|
||||
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
|
||||
url:"qrc:/example/qml/page/T_TableView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Pagination"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Pagination.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"MultiWindow"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_MultiWindow.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"FlipView"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/FlipView.png"
|
||||
recentlyAdded:true
|
||||
order:2
|
||||
desc:"Presents a collection of items that the user canflip through, one item at a time."
|
||||
url:"qrc:/example/qml/page/T_FlipView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -363,26 +338,26 @@ FluObject{
|
||||
icon:FluentIcons.Brightness
|
||||
FluPaneItem{
|
||||
title:"Acrylic"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Acrylic.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Theme"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Theme.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Typography"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Typography.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Awesome"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Awesome.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -397,56 +372,56 @@ FluObject{
|
||||
icon:FluentIcons.Shop
|
||||
FluPaneItem{
|
||||
title:"QRCode"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_QRCode.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Tour"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Tour.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Timeline"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Timeline.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Screenshot(Todo)"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Screenshot.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Captcha"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Captcha.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Chart"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Chart.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Http"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Http.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
id:item_other
|
||||
title:"RemoteLoader"
|
||||
menuDelegate: paneItemMenu
|
||||
count: 99
|
||||
infoBadge:FluBadge{
|
||||
count: item_other.count
|
||||
color: Qt.rgba(82/255,196/255,26/255,1)
|
||||
}
|
||||
url:"qrc:/example/qml/page/T_RemoteLoader.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_other.count = 0
|
||||
navigationView.push("qrc:/example/qml/page/T_RemoteLoader.qml")
|
||||
@ -457,12 +432,11 @@ FluObject{
|
||||
onTapListener:function(){
|
||||
FluApp.navigate("/hotload")
|
||||
}
|
||||
onDropped:{ FluApp.navigate("/hotload") }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"3D"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_3D.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import FluentUI
|
||||
FluViewModel{
|
||||
|
||||
objectName: "SettingsViewModel"
|
||||
scope: FluViewModelType.Application
|
||||
property int displayMode
|
||||
|
||||
onInitData: {
|
||||
|
@ -15,22 +15,15 @@ FluWindow {
|
||||
title: "FluentUI"
|
||||
width: 1000
|
||||
height: 640
|
||||
closeDestory:false
|
||||
minimumWidth: 520
|
||||
minimumHeight: 200
|
||||
launchMode: FluWindowType.SingleTask
|
||||
|
||||
appBar: undefined
|
||||
|
||||
SettingsViewModel{
|
||||
id:viewmodel_settings
|
||||
}
|
||||
|
||||
closeListener:function(event){
|
||||
dialog_close.open()
|
||||
event.accepted = false
|
||||
}
|
||||
|
||||
FluEvent{
|
||||
id:event_checkupdate
|
||||
name: "checkUpdate"
|
||||
@ -38,8 +31,8 @@ FluWindow {
|
||||
checkUpdate(false)
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
FluTools.setQuitOnLastWindowClosed(false)
|
||||
tour.open()
|
||||
checkUpdate(true)
|
||||
FluEventBus.registerEvent(event_checkupdate)
|
||||
@ -85,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})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,6 +130,7 @@ FluWindow {
|
||||
showDark: true
|
||||
z:7
|
||||
darkClickListener:(button)=>handleDarkChanged(button)
|
||||
closeClickListener: ()=>{dialog_close.open()}
|
||||
}
|
||||
Row{
|
||||
z:8
|
||||
@ -154,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{
|
||||
@ -171,6 +180,7 @@ FluWindow {
|
||||
darkText: Lang.dark_mode
|
||||
showDark: true
|
||||
darkClickListener:(button)=>handleDarkChanged(button)
|
||||
closeClickListener: ()=>{dialog_close.open()}
|
||||
z:7
|
||||
}
|
||||
FluNavigationView{
|
||||
@ -209,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)
|
||||
}
|
||||
}
|
||||
@ -242,7 +254,7 @@ FluWindow {
|
||||
}
|
||||
|
||||
function handleDarkChanged(button){
|
||||
if(FluTools.isMacos() || !FluTheme.enableAnimation){
|
||||
if(!FluTheme.enableAnimation){
|
||||
changeDark()
|
||||
}else{
|
||||
loader_reveal.sourceComponent = com_reveal
|
||||
|
@ -4,9 +4,8 @@ import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Window {
|
||||
Item {
|
||||
id: app
|
||||
flags: Qt.SplashScreen
|
||||
|
||||
Connections{
|
||||
target: FluTheme
|
||||
|
@ -6,6 +6,7 @@ import FluentUI 1.0
|
||||
FluObject{
|
||||
|
||||
property var navigationView
|
||||
property var paneItemMenu
|
||||
|
||||
id:footer_items
|
||||
|
||||
@ -14,7 +15,6 @@ FluObject{
|
||||
FluPaneItem{
|
||||
title:Lang.about
|
||||
icon:FluentIcons.Contact
|
||||
onDropped: { FluApp.navigate("/about") }
|
||||
onTapListener:function(){
|
||||
FluApp.navigate("/about")
|
||||
}
|
||||
@ -22,9 +22,9 @@ FluObject{
|
||||
|
||||
FluPaneItem{
|
||||
title:Lang.settings
|
||||
menuDelegate: paneItemMenu
|
||||
icon:FluentIcons.Settings
|
||||
url:"qrc:/example/qml/page/T_Settings.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
navigationView.push(url)
|
||||
}
|
||||
|
@ -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,32 +18,18 @@ FluObject{
|
||||
id:item_home
|
||||
count: 9
|
||||
title:Lang.home
|
||||
menuDelegate: paneItemMenu
|
||||
infoBadge:FluBadge{
|
||||
count: item_home.count
|
||||
}
|
||||
icon:FluentIcons.Home
|
||||
url:"qrc:/example/qml/page/T_Home.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
if(navigationView.getCurrentUrl()){
|
||||
item_home.count = 0
|
||||
}
|
||||
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{
|
||||
@ -55,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
|
||||
@ -74,11 +49,11 @@ 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."
|
||||
url:"qrc:/example/qml/page/T_Buttons.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_buttons.count = 0
|
||||
navigationView.push(url)
|
||||
@ -87,13 +62,13 @@ FluObject{
|
||||
FluPaneItem{
|
||||
id:item_text
|
||||
title:"Text"
|
||||
menuDelegate: paneItemMenu
|
||||
count: 5
|
||||
infoBadge:FluBadge{
|
||||
count: item_text.count
|
||||
color: Qt.rgba(82/255,196/255,26/255,1)
|
||||
}
|
||||
url:"qrc:/example/qml/page/T_Text.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_text.count = 0
|
||||
navigationView.push(url)
|
||||
@ -101,38 +76,38 @@ FluObject{
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Image"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Image.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
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."
|
||||
url:"qrc:/example/qml/page/T_Slider.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
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."
|
||||
url:"qrc:/example/qml/page/T_CheckBox.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"RadioButton"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_RadioButton.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"ToggleSwitch"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
@ -147,32 +122,32 @@ FluObject{
|
||||
icon:FluentIcons.GridView
|
||||
FluPaneItem{
|
||||
title:"TextBox"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_TextBox.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TimePicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_TimePicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"DatePicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_DatePicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"CalendarPicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"ColorPicker"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_ColorPicker.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -182,71 +157,71 @@ 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."
|
||||
url:"qrc:/example/qml/page/T_InfoBar.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Progress"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Progress.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"RatingControl"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_RatingControl.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Badge"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Badge.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Rectangle"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Rectangle.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Clip"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Clip.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"StatusView"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_StatusView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Carousel"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Carousel.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Expander"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Expander.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"StaggeredView"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_StaggeredView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Watermark"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Watermark.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -256,20 +231,20 @@ FluObject{
|
||||
icon:FluentIcons.ButtonMenu
|
||||
FluPaneItem{
|
||||
title:"Dialog"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Dialog.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
id:item_combobox
|
||||
title:"ComboBox"
|
||||
menuDelegate: paneItemMenu
|
||||
count: 9
|
||||
infoBadge:FluBadge{
|
||||
count: item_combobox.count
|
||||
color: Qt.rgba(250/255,173/255,20/255,1)
|
||||
}
|
||||
url:"qrc:/example/qml/page/T_ComboBox.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_combobox.count = 0
|
||||
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
|
||||
@ -277,14 +252,14 @@ FluObject{
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Tooltip"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Tooltip.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Menu"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Menu.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -294,66 +269,66 @@ FluObject{
|
||||
icon:FluentIcons.AllApps
|
||||
FluPaneItem{
|
||||
title:"Pivot"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/Pivot.png"
|
||||
recentlyAdded:true
|
||||
order:3
|
||||
desc:"Presents information from different sources in atabbed view."
|
||||
url:"qrc:/example/qml/page/T_Pivot.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"BreadcrumbBar"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TabView"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/TabView.png"
|
||||
recentlyAdded:true
|
||||
order:1
|
||||
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
||||
url:"qrc:/example/qml/page/T_TabView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TreeView"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_TreeView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"TableView"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/DataGrid.png"
|
||||
recentlyAdded:true
|
||||
order:4
|
||||
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
|
||||
url:"qrc:/example/qml/page/T_TableView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Pagination"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Pagination.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"MultiWindow"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_MultiWindow.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"FlipView"
|
||||
menuDelegate: paneItemMenu
|
||||
image:"qrc:/example/res/image/control/FlipView.png"
|
||||
recentlyAdded:true
|
||||
order:2
|
||||
desc:"Presents a collection of items that the user canflip through, one item at a time."
|
||||
url:"qrc:/example/qml/page/T_FlipView.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -363,26 +338,26 @@ FluObject{
|
||||
icon:FluentIcons.Brightness
|
||||
FluPaneItem{
|
||||
title:"Acrylic"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Acrylic.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Theme"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Theme.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Typography"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Typography.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Awesome"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Awesome.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
@ -397,56 +372,56 @@ FluObject{
|
||||
icon:FluentIcons.Shop
|
||||
FluPaneItem{
|
||||
title:"QRCode"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_QRCode.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Tour"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Tour.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Timeline"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Timeline.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Screenshot(Todo)"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Screenshot.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Captcha"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Captcha.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Chart"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Chart.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Http"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_Http.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
id:item_other
|
||||
title:"RemoteLoader"
|
||||
menuDelegate: paneItemMenu
|
||||
count: 99
|
||||
infoBadge:FluBadge{
|
||||
count: item_other.count
|
||||
color: Qt.rgba(82/255,196/255,26/255,1)
|
||||
}
|
||||
url:"qrc:/example/qml/page/T_RemoteLoader.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{
|
||||
item_other.count = 0
|
||||
navigationView.push("qrc:/example/qml/page/T_RemoteLoader.qml")
|
||||
@ -457,12 +432,11 @@ FluObject{
|
||||
onTapListener:function(){
|
||||
FluApp.navigate("/hotload")
|
||||
}
|
||||
onDropped:{ FluApp.navigate("/hotload") }
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"3D"
|
||||
menuDelegate: paneItemMenu
|
||||
url:"qrc:/example/qml/page/T_3D.qml"
|
||||
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
|
||||
onTap:{ navigationView.push(url) }
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import FluentUI 1.0
|
||||
FluViewModel{
|
||||
|
||||
objectName: "SettingsViewModel"
|
||||
scope: FluViewModelType.Application
|
||||
property int displayMode
|
||||
|
||||
onInitData: {
|
||||
|
@ -18,7 +18,6 @@ FluWindow {
|
||||
title: "FluentUI"
|
||||
width: 1000
|
||||
height: 640
|
||||
closeDestory:false
|
||||
minimumWidth: 520
|
||||
minimumHeight: 200
|
||||
launchMode: FluWindowType.SingleTask
|
||||
@ -28,11 +27,6 @@ FluWindow {
|
||||
id:viewmodel_settings
|
||||
}
|
||||
|
||||
closeListener:function(event){
|
||||
dialog_close.open()
|
||||
event.accepted = false
|
||||
}
|
||||
|
||||
FluEvent{
|
||||
id:event_checkupdate
|
||||
name: "checkUpdate"
|
||||
@ -42,7 +36,6 @@ FluWindow {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
FluTools.setQuitOnLastWindowClosed(false)
|
||||
tour.open()
|
||||
checkUpdate(true)
|
||||
FluEventBus.registerEvent(event_checkupdate)
|
||||
@ -88,7 +81,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})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,6 +133,7 @@ FluWindow {
|
||||
showDark: true
|
||||
z:7
|
||||
darkClickListener:(button)=>handleDarkChanged(button)
|
||||
closeClickListener: ()=>{dialog_close.open()}
|
||||
}
|
||||
Row{
|
||||
z:8
|
||||
@ -174,6 +183,7 @@ FluWindow {
|
||||
darkText: Lang.dark_mode
|
||||
showDark: true
|
||||
darkClickListener:(button)=>handleDarkChanged(button)
|
||||
closeClickListener: ()=>{dialog_close.open()}
|
||||
z:7
|
||||
}
|
||||
FluNavigationView{
|
||||
@ -212,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)
|
||||
}
|
||||
}
|
||||
@ -245,7 +257,7 @@ FluWindow {
|
||||
}
|
||||
|
||||
function handleDarkChanged(button){
|
||||
if(FluTools.isMacos() || !FluTheme.enableAnimation){
|
||||
if(!FluTheme.enableAnimation){
|
||||
changeDark()
|
||||
}else{
|
||||
loader_reveal.sourceComponent = com_reveal
|
||||
|
@ -19,10 +19,10 @@ void SettingsHelper::save(const QString& key,QVariant val)
|
||||
m_settings->setValue(key, data);
|
||||
}
|
||||
|
||||
QVariant SettingsHelper::get(const QString& key){
|
||||
QVariant SettingsHelper::get(const QString& key,QVariant def){
|
||||
const QByteArray data = m_settings->value(key).toByteArray();
|
||||
if (data.isEmpty()) {
|
||||
return {};
|
||||
return def;
|
||||
}
|
||||
QDataStream stream(data);
|
||||
stream.setVersion(QDataStream::Qt_5_6);
|
||||
|
@ -19,15 +19,15 @@ public:
|
||||
SINGLETONG(SettingsHelper)
|
||||
~SettingsHelper() override;
|
||||
void init(char *argv[]);
|
||||
Q_INVOKABLE void saveRender(const QString& render){save("render",render);}
|
||||
Q_INVOKABLE QString getRender(){return get("render").toString();}
|
||||
Q_INVOKABLE void saveRender(const QVariant& render){save("render",render);}
|
||||
Q_INVOKABLE QVariant getRender(){return get("render");}
|
||||
Q_INVOKABLE void saveDarkMode(int darkModel){save("darkMode",darkModel);}
|
||||
Q_INVOKABLE int getDarkMode(){return get("darkMode").toInt(0);}
|
||||
Q_INVOKABLE QVariant getDarkMode(){return get("darkMode",QVariant(0));}
|
||||
Q_INVOKABLE void saveVsync(bool vsync){save("vsync",vsync);}
|
||||
Q_INVOKABLE bool getVsync(){return get("vsync").toBool();}
|
||||
Q_INVOKABLE QVariant getVsync(){return get("vsync",QVariant(true));}
|
||||
private:
|
||||
void save(const QString& key,QVariant val);
|
||||
QVariant get(const QString& key);
|
||||
QVariant get(const QString& key,QVariant def={});
|
||||
private:
|
||||
QScopedPointer<QSettings> m_settings;
|
||||
};
|
||||
|
Submodule framelesshelper updated: 295fb74e69...80f869adca
@ -21,8 +21,8 @@ FluApp::FluApp(QObject *parent):QObject{parent}{
|
||||
FluApp::~FluApp(){
|
||||
}
|
||||
|
||||
void FluApp::init(QQuickWindow *window){
|
||||
this->_application = window;
|
||||
void FluApp::init(QObject *application){
|
||||
this->_application = application;
|
||||
FramelessHelper::Quick::initialize();
|
||||
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
||||
@ -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);
|
||||
|
@ -33,13 +33,13 @@ public:
|
||||
static FluApp *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();}
|
||||
Q_INVOKABLE void run();
|
||||
Q_INVOKABLE void navigate(const QString& route,const QJsonObject& argument = {},FluRegister* fluRegister = nullptr);
|
||||
Q_INVOKABLE void init(QQuickWindow *window);
|
||||
Q_INVOKABLE void init(QObject *window);
|
||||
Q_INVOKABLE void exit(int retCode = 0);
|
||||
void addWindow(QQuickWindow* window);
|
||||
void removeWindow(QQuickWindow* window);
|
||||
private:
|
||||
QMap<quint64, QQuickWindow*> _windows;
|
||||
QWindow* _application;
|
||||
QObject* _application;
|
||||
};
|
||||
|
||||
#endif // FLUAPP_H
|
||||
|
@ -636,13 +636,13 @@ HttpRequest* FluHttp::newRequest(QString url){
|
||||
}
|
||||
|
||||
void FluHttp::onStart(QPointer<HttpCallable> callable){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->start();
|
||||
}
|
||||
}
|
||||
|
||||
void FluHttp::onFinish(QPointer<HttpCallable> callable,QPointer<HttpRequest> request){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->finish();
|
||||
}
|
||||
if(request&&request->parent()->inherits("FluHttp")){
|
||||
@ -651,31 +651,31 @@ void FluHttp::onFinish(QPointer<HttpCallable> callable,QPointer<HttpRequest> req
|
||||
}
|
||||
|
||||
void FluHttp::onError(QPointer<HttpCallable> callable,int status,QString errorString,QString result){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->error(status,errorString,result);
|
||||
}
|
||||
}
|
||||
|
||||
void FluHttp::onSuccess(QPointer<HttpCallable> callable,QString result){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->success(result);
|
||||
}
|
||||
}
|
||||
|
||||
void FluHttp::onCache(QPointer<HttpCallable> callable,QString result){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->cache(result);
|
||||
}
|
||||
}
|
||||
|
||||
void FluHttp::onDownloadProgress(QPointer<HttpCallable> callable,qint64 recv,qint64 total){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->downloadProgress(recv,total);
|
||||
}
|
||||
}
|
||||
|
||||
void FluHttp::onUploadProgress(QPointer<HttpCallable> callable,qint64 sent,qint64 total){
|
||||
if(callable){
|
||||
if (!callable.isNull()) {
|
||||
Q_EMIT callable->uploadProgress(sent,total);
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ Rectangle{
|
||||
property string restoreText : "向下还原"
|
||||
property string maximizeText : "最大化"
|
||||
property string closeText : "关闭"
|
||||
property string stayTopText : "置顶"
|
||||
property string stayTopCancelText : "取消置顶"
|
||||
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||
property color minimizeNormalColor: Qt.rgba(0,0,0,0)
|
||||
property color minimizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
@ -25,6 +27,7 @@ Rectangle{
|
||||
property bool showClose: true
|
||||
property bool showMinimize: true
|
||||
property bool showMaximize: true
|
||||
property bool showStayTop: true
|
||||
property bool titleVisible: true
|
||||
property url icon
|
||||
property int iconSize: 20
|
||||
@ -42,6 +45,11 @@ Rectangle{
|
||||
property var closeClickListener : function(){
|
||||
d.win.close()
|
||||
}
|
||||
property var stayTopClickListener: function(){
|
||||
if(d.win instanceof FluWindow){
|
||||
d.win.stayTop = !d.win.stayTop
|
||||
}
|
||||
}
|
||||
property var darkClickListener: function(){
|
||||
if(FluTheme.dark){
|
||||
FluTheme.darkMode = FluThemeType.Light
|
||||
@ -57,6 +65,12 @@ Rectangle{
|
||||
Item{
|
||||
id:d
|
||||
property var win: Window.window
|
||||
property bool stayTop: {
|
||||
if(d.win instanceof FluWindow){
|
||||
return d.win.stayTop
|
||||
}
|
||||
return false
|
||||
}
|
||||
property bool isRestore: win && Window.Maximized === win.visibility
|
||||
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
|
||||
}
|
||||
@ -106,6 +120,24 @@ Rectangle{
|
||||
textRight: false
|
||||
clickListener:()=> darkClickListener(btn_dark)
|
||||
}
|
||||
FluIconButton{
|
||||
id:btn_stay_top
|
||||
Layout.preferredWidth: 40
|
||||
Layout.preferredHeight: 30
|
||||
iconSource : FluentIcons.Pinned
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
iconSize: 13
|
||||
visible: {
|
||||
if(!(d.win instanceof FluWindow)){
|
||||
return false
|
||||
}
|
||||
return showStayTop
|
||||
}
|
||||
text:d.stayTop ? control.stayTopCancelText : control.stayTopText
|
||||
radius: 0
|
||||
iconColor: d.stayTop ? (FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark) : control.textColor
|
||||
onClicked: stayTopClickListener()
|
||||
}
|
||||
FluIconButton{
|
||||
id:btn_minimize
|
||||
Layout.preferredWidth: 40
|
||||
@ -164,6 +196,9 @@ Rectangle{
|
||||
onClicked: closeClickListener()
|
||||
}
|
||||
}
|
||||
function stayTopButton(){
|
||||
return btn_stay_top
|
||||
}
|
||||
function minimizeButton(){
|
||||
return btn_minimize
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ Item {
|
||||
properties: "opacity"
|
||||
from: 1
|
||||
to: 0
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
duration: FluTheme.enableAnimation ? 83 : 1
|
||||
}
|
||||
}
|
||||
add: Transition {
|
||||
@ -41,7 +41,7 @@ Item {
|
||||
properties: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
duration: FluTheme.enableAnimation ? 83 : 1
|
||||
}
|
||||
}
|
||||
delegate: Item{
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -463,10 +465,6 @@ Item {
|
||||
leftMargin: 6
|
||||
rightMargin: 6
|
||||
}
|
||||
Drag.active: item_mouse.drag.active
|
||||
Drag.hotSpot.x: item_control.width / 2
|
||||
Drag.hotSpot.y: item_control.height / 2
|
||||
Drag.dragType: Drag.Automatic
|
||||
onClicked:{
|
||||
if(type === 0){
|
||||
if(model.onTapListener){
|
||||
@ -496,23 +494,13 @@ Item {
|
||||
id:item_mouse
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
||||
drag.target: item_control
|
||||
onPositionChanged: {
|
||||
parent.grabToImage(function(result) {
|
||||
parent.Drag.imageSource = result.url;
|
||||
})
|
||||
}
|
||||
drag.onActiveChanged:
|
||||
if (active) {
|
||||
parent.grabToImage(function(result) {
|
||||
parent.Drag.imageSource = result.url;
|
||||
})
|
||||
}
|
||||
onClicked:
|
||||
(mouse)=>{
|
||||
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{
|
||||
@ -860,15 +848,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
DropArea{
|
||||
anchors.fill: loader_content
|
||||
onDropped:
|
||||
(drag)=>{
|
||||
if(drag.source.modelData){
|
||||
drag.source.modelData.dropped(drag)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
id:loader_content
|
||||
anchors{
|
||||
@ -1138,6 +1117,7 @@ Item {
|
||||
clip: true
|
||||
currentIndex: -1
|
||||
model: control_popup.childModel
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
delegate:Button{
|
||||
id:item_button
|
||||
@ -1221,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{
|
||||
|
@ -25,6 +25,4 @@ QtObject {
|
||||
property Component editDelegate
|
||||
property bool showEdit
|
||||
signal tap
|
||||
signal dropped(var drag)
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,7 @@ import FluentUI 1.0
|
||||
Rectangle {
|
||||
property var columnSource
|
||||
property var dataSource
|
||||
property color selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
property color hoverButtonColor: FluTools.colorAlpha(selectionColor,0.2)
|
||||
property color pressedButtonColor: FluTools.colorAlpha(selectionColor,0.4)
|
||||
property color borderColor: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||
property alias tableModel: table_model
|
||||
id:control
|
||||
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||
@ -32,19 +30,21 @@ Rectangle {
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
property var currentRow
|
||||
property int rowHoverIndex: -1
|
||||
property int defaultItemWidth: 100
|
||||
property int defaultItemHeight: 42
|
||||
property var header_rows:[]
|
||||
property bool selectionFlag: true
|
||||
function obtEditDelegate(column,row,cellItem){
|
||||
var display = table_model.data(table_model.index(row,column),"display")
|
||||
var cellPosition = cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader.column = column
|
||||
item_loader.row = row
|
||||
item_loader.x = table_view.contentX + cellPosition.x
|
||||
item_loader.y = table_view.contentY + cellPosition.y
|
||||
item_loader.width = table_view.columnWidthProvider(column)
|
||||
item_loader.height = table_view.rowHeightProvider(row)
|
||||
item_loader_layout.cellItem = cellItem
|
||||
item_loader_layout.x = table_view.contentX + cellPosition.x
|
||||
item_loader_layout.y = table_view.contentY + cellPosition.y
|
||||
item_loader_layout.width = table_view.columnWidthProvider(column)
|
||||
item_loader_layout.height = table_view.rowHeightProvider(row)
|
||||
item_loader.display = display
|
||||
var obj =columnSource[column].editDelegate
|
||||
if(obj){
|
||||
@ -154,87 +154,50 @@ Rectangle {
|
||||
bottomMargin: 6
|
||||
}
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
HoverHandler{
|
||||
MouseArea{
|
||||
acceptedButtons: Qt.NoButton
|
||||
id: hover_handler
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
}
|
||||
FluTooltip{
|
||||
text: item_text.text
|
||||
delay: 500
|
||||
visible: item_text.contentWidth < item_text.implicitWidth && item_text.contentHeight < item_text.implicitHeight && hover_handler.hovered
|
||||
visible: item_text.contentWidth < item_text.implicitWidth && item_text.contentHeight < item_text.implicitHeight && hover_handler.containsMouse
|
||||
}
|
||||
}
|
||||
}
|
||||
ScrollView{
|
||||
|
||||
MouseArea{
|
||||
id:scroll_table
|
||||
hoverEnabled: true
|
||||
anchors.left: header_vertical.right
|
||||
anchors.top: header_horizontal.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
|
||||
TableView {
|
||||
id:table_view
|
||||
ListModel{
|
||||
id:model_columns
|
||||
}
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.horizontal: FluScrollBar{
|
||||
id:scroll_bar_h
|
||||
}
|
||||
ScrollBar.vertical: FluScrollBar{
|
||||
id:scroll_bar_v
|
||||
}
|
||||
columnWidthProvider: function(column) {
|
||||
var w = columnSource[column].width
|
||||
if(!w){
|
||||
w = columnSource[column].minimumWidth
|
||||
onExited: {
|
||||
d.rowHoverIndex = -1
|
||||
}
|
||||
onCanceled: {
|
||||
d.rowHoverIndex = -1
|
||||
}
|
||||
ScrollView{
|
||||
anchors.fill: parent
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
|
||||
TableView {
|
||||
id:table_view
|
||||
ListModel{
|
||||
id:model_columns
|
||||
}
|
||||
if(!w){
|
||||
w = d.defaultItemWidth
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.horizontal: FluScrollBar{
|
||||
id:scroll_bar_h
|
||||
}
|
||||
if(column === item_loader.column){
|
||||
item_loader.width = w
|
||||
ScrollBar.vertical: FluScrollBar{
|
||||
id:scroll_bar_v
|
||||
}
|
||||
if(column === item_loader.column-1){
|
||||
let cellItem = table_view.itemAtCell(item_loader.column, item_loader.row)
|
||||
if(cellItem){
|
||||
let cellPosition = cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader.x = table_view.contentX + cellPosition.x
|
||||
}
|
||||
}
|
||||
return w
|
||||
}
|
||||
rowHeightProvider: function(row) {
|
||||
if(row>=table_model.rowCount){
|
||||
return 0
|
||||
}
|
||||
var h = table_model.getRow(row).height
|
||||
if(!h){
|
||||
h = table_model.getRow(row).minimumHeight
|
||||
}
|
||||
if(!h){
|
||||
return d.defaultItemHeight
|
||||
}
|
||||
if(row === item_loader.row){
|
||||
item_loader.height = h
|
||||
}
|
||||
if(row === item_loader.row-1){
|
||||
let cellItem = table_view.itemAtCell(item_loader.column, item_loader.row)
|
||||
if(cellItem){
|
||||
let cellPosition = cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader.y = table_view.contentY + cellPosition.y
|
||||
}
|
||||
}
|
||||
return h
|
||||
}
|
||||
model: table_model
|
||||
clip: true
|
||||
delegate: Rectangle {
|
||||
id:item_table
|
||||
property point position: Qt.point(column,row)
|
||||
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: {
|
||||
columnWidthProvider: function(column) {
|
||||
var w = columnSource[column].width
|
||||
if(!w){
|
||||
w = columnSource[column].minimumWidth
|
||||
@ -242,72 +205,156 @@ Rectangle {
|
||||
if(!w){
|
||||
w = d.defaultItemWidth
|
||||
}
|
||||
if(item_loader_layout.cellItem){
|
||||
if(column === item_loader.column){
|
||||
item_loader_layout.width = w
|
||||
}
|
||||
if(column === item_loader.column-1){
|
||||
let cellPosition = item_loader_layout.cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader_layout.x = table_view.contentX + cellPosition.x
|
||||
}
|
||||
}
|
||||
return w
|
||||
}
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
visible: !item_loader.sourceComponent
|
||||
color: "#00000000"
|
||||
rowHeightProvider: function(row) {
|
||||
if(row>=table_model.rowCount){
|
||||
return 0
|
||||
}
|
||||
var h = table_model.getRow(row).height
|
||||
if(!h){
|
||||
h = table_model.getRow(row).minimumHeight
|
||||
}
|
||||
if(!h){
|
||||
h = d.defaultItemHeight
|
||||
}
|
||||
if(item_loader_layout.cellItem){
|
||||
if(row === item_loader.row){
|
||||
item_loader_layout.height = h
|
||||
}
|
||||
if(row === item_loader.row-1){
|
||||
let cellPosition = item_loader_layout.cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader_layout.y = table_view.contentY + cellPosition.y
|
||||
}
|
||||
}
|
||||
return h
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed:{
|
||||
closeEditor()
|
||||
}
|
||||
onCanceled: {
|
||||
}
|
||||
onReleased: {
|
||||
}
|
||||
onDoubleClicked:{
|
||||
if(typeof(display) == "object"){
|
||||
return
|
||||
model: table_model
|
||||
clip: true
|
||||
delegate: MouseArea{
|
||||
hoverEnabled: true
|
||||
implicitHeight: 40
|
||||
implicitWidth: {
|
||||
var w = columnSource[column].width
|
||||
if(!w){
|
||||
w = columnSource[column].minimumWidth
|
||||
}
|
||||
item_loader.sourceComponent = d.obtEditDelegate(column,row,item_table)
|
||||
if(!w){
|
||||
w = d.defaultItemWidth
|
||||
}
|
||||
return w
|
||||
}
|
||||
onClicked:
|
||||
(event)=>{
|
||||
item_loader.sourceComponent = undefined
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
property var itemModel: model
|
||||
property var modelData: display
|
||||
property var tableView: table_view
|
||||
property var tableModel: table_model
|
||||
property var position: item_table.position
|
||||
property int row: position.y
|
||||
property int column: position.x
|
||||
property var options: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.options
|
||||
}
|
||||
return {}
|
||||
onEntered: {
|
||||
d.rowHoverIndex = row
|
||||
}
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.comId
|
||||
Rectangle{
|
||||
id:item_table
|
||||
anchors.fill: parent
|
||||
property point position: Qt.point(column,row)
|
||||
color:{
|
||||
if(d.rowHoverIndex === row || d.currentRow === table_model.getRow(row).__index){
|
||||
return FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
return (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.015) : Qt.rgba(0,0,0,0.015))
|
||||
}
|
||||
Rectangle{
|
||||
height: 18
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
width: 3
|
||||
visible: d.currentRow === table_model.getRow(row).__index && column === 0
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 3
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed:{
|
||||
closeEditor()
|
||||
}
|
||||
onCanceled: {
|
||||
}
|
||||
onReleased: {
|
||||
}
|
||||
onDoubleClicked:{
|
||||
if(typeof(display) == "object"){
|
||||
return
|
||||
}
|
||||
item_loader.sourceComponent = d.obtEditDelegate(column,row,item_table)
|
||||
}
|
||||
onClicked:
|
||||
(event)=>{
|
||||
d.currentRow = table_model.getRow(row).__index
|
||||
item_loader.sourceComponent = undefined
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
property var itemModel: model
|
||||
property var modelData: display
|
||||
property var tableView: table_view
|
||||
property var tableModel: table_model
|
||||
property var position: item_table.position
|
||||
property int row: position.y
|
||||
property int column: position.x
|
||||
property var options: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.options
|
||||
}
|
||||
return {}
|
||||
}
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.comId
|
||||
}
|
||||
return com_text
|
||||
}
|
||||
}
|
||||
return com_text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
id:item_loader
|
||||
z:2
|
||||
property var display
|
||||
property int column
|
||||
property int row
|
||||
property var tableView: control
|
||||
sourceComponent: undefined
|
||||
onDisplayChanged: {
|
||||
var obj = table_model.getRow(row)
|
||||
obj[columnSource[column].dataIndex] = display
|
||||
table_model.setRow(row,obj)
|
||||
MouseArea{
|
||||
property var cellItem
|
||||
id:item_loader_layout
|
||||
acceptedButtons: Qt.NoButton
|
||||
visible: item_loader.sourceComponent
|
||||
onVisibleChanged: {
|
||||
if(!visible){
|
||||
item_loader_layout.cellItem = undefined
|
||||
}
|
||||
}
|
||||
hoverEnabled: true
|
||||
z:2
|
||||
onEntered: {
|
||||
d.rowHoverIndex = -1
|
||||
}
|
||||
Loader{
|
||||
id:item_loader
|
||||
property var display
|
||||
property int column
|
||||
property int row
|
||||
property var tableView: control
|
||||
sourceComponent: undefined
|
||||
anchors.fill: parent
|
||||
onDisplayChanged: {
|
||||
var obj = table_model.getRow(row)
|
||||
obj[columnSource[column].dataIndex] = display
|
||||
table_model.setRow(row,obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -315,7 +362,6 @@ Rectangle {
|
||||
id:com_handle
|
||||
Item {}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:com_column_text
|
||||
FluText {
|
||||
@ -349,14 +395,36 @@ Rectangle {
|
||||
readonly property var obj : columnSource[column]
|
||||
implicitWidth: item_column_loader.item.implicitWidth + (cellPadding * 2)
|
||||
implicitHeight: Math.max(36, item_column_loader.item.implicitHeight + (cellPadding * 2))
|
||||
color:{
|
||||
d.selectionFlag
|
||||
if(column_item_control_mouse.pressed){
|
||||
return control.pressedButtonColor
|
||||
}
|
||||
return column_item_control_mouse.containsMouse&&!canceled ? control.hoverButtonColor : FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.top: parent.top
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.bottom: parent.bottom
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.right: parent.right
|
||||
color:"#00000000"
|
||||
visible: column === tableModel.columnCount - 1
|
||||
}
|
||||
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||
MouseArea{
|
||||
id:column_item_control_mouse
|
||||
anchors.fill: parent
|
||||
@ -373,7 +441,6 @@ Rectangle {
|
||||
onClicked:
|
||||
(event)=>{
|
||||
closeEditor()
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
@ -463,8 +530,15 @@ Rectangle {
|
||||
return []
|
||||
}
|
||||
}
|
||||
onContentYChanged: {
|
||||
forceLayout()
|
||||
onContentYChanged:{
|
||||
timer_force_layout.restart()
|
||||
}
|
||||
Timer{
|
||||
interval: 50
|
||||
id:timer_force_layout
|
||||
onTriggered: {
|
||||
header_vertical.forceLayout()
|
||||
}
|
||||
}
|
||||
delegate: Rectangle{
|
||||
id:item_control
|
||||
@ -472,14 +546,38 @@ Rectangle {
|
||||
property bool canceled: false
|
||||
implicitWidth: Math.max(30, row_text.implicitWidth + (cellPadding * 2))
|
||||
implicitHeight: row_text.implicitHeight + (cellPadding * 2)
|
||||
color: {
|
||||
d.selectionFlag
|
||||
if(item_control_mouse.pressed){
|
||||
return control.pressedButtonColor
|
||||
}
|
||||
return item_control_mouse.containsMouse&&!canceled ? control.hoverButtonColor : FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
width: implicitWidth
|
||||
height: implicitHeight
|
||||
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.top: parent.top
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.bottom: parent.bottom
|
||||
visible: row === tableModel.rowCount - 1
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.right: parent.right
|
||||
color:"#00000000"
|
||||
}
|
||||
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||
FluText{
|
||||
id:row_text
|
||||
anchors.centerIn: parent
|
||||
@ -501,7 +599,6 @@ Rectangle {
|
||||
onClicked:
|
||||
(event)=>{
|
||||
closeEditor()
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
|
@ -37,7 +37,15 @@ TextField{
|
||||
return placeholderNormalColor
|
||||
}
|
||||
selectByMouse: true
|
||||
rightPadding: icon_end.visible ? 66 : 40
|
||||
rightPadding: {
|
||||
var w = 30
|
||||
if(control.cleanEnabled === false){
|
||||
w = 0
|
||||
}
|
||||
if(control.readOnly)
|
||||
w = 0
|
||||
return icon_end.visible ? w+36 : w+10
|
||||
}
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: control
|
||||
implicitWidth: 240
|
||||
|
@ -14,12 +14,14 @@ Window {
|
||||
property bool fixSize: false
|
||||
property Component loadingItem: com_loading
|
||||
property var appBar: com_app_bar
|
||||
flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||
property color backgroundColor: {
|
||||
if(active){
|
||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(237/255,237/255,237/255,1)
|
||||
}
|
||||
property bool stayTop: false
|
||||
property var _pageRegister
|
||||
property string _route
|
||||
property var closeListener: function(event){
|
||||
@ -33,9 +35,13 @@ Window {
|
||||
signal initArgument(var argument)
|
||||
id:window
|
||||
color:"transparent"
|
||||
onStayTopChanged: {
|
||||
d.changedStayTop()
|
||||
}
|
||||
Component.onCompleted: {
|
||||
lifecycle.onCompleted(window)
|
||||
initArgument(argument)
|
||||
d.changedStayTop()
|
||||
}
|
||||
Component.onDestruction: {
|
||||
lifecycle.onDestruction()
|
||||
@ -43,6 +49,21 @@ Window {
|
||||
onVisibleChanged: {
|
||||
lifecycle.onVisible(visible)
|
||||
}
|
||||
onVisibilityChanged: {
|
||||
console.debug(visibility)
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
function changedStayTop(){
|
||||
var visibility = window.visibility
|
||||
if(window.stayTop){
|
||||
window.flags = window.flags | Qt.WindowStaysOnTopHint
|
||||
}else{
|
||||
window.flags = window.flags &~ Qt.WindowStaysOnTopHint
|
||||
}
|
||||
window.visibility = visibility
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
target: window
|
||||
function onClosing(event){closeListener(event)}
|
||||
@ -92,7 +113,6 @@ Window {
|
||||
id:com_loading
|
||||
Popup{
|
||||
id:popup_loading
|
||||
modal:true
|
||||
focus: true
|
||||
width: window.width
|
||||
height: window.height
|
||||
@ -174,6 +194,7 @@ Window {
|
||||
setHitTestVisible(title_bar.minimizeButton())
|
||||
setHitTestVisible(title_bar.maximizeButton())
|
||||
setHitTestVisible(title_bar.closeButton())
|
||||
setHitTestVisible(title_bar.stayTopButton())
|
||||
setWindowFixedSize(fixSize)
|
||||
title_bar.maximizeButton.visible = !fixSize
|
||||
if (blurBehindWindowEnabled)
|
||||
@ -185,6 +206,9 @@ Window {
|
||||
WindowLifecycle{
|
||||
id:lifecycle
|
||||
}
|
||||
WindowBorder{
|
||||
z:999
|
||||
}
|
||||
function destoryOnClose(){
|
||||
lifecycle.onDestoryOnClose()
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ Rectangle{
|
||||
property string restoreText : "向下还原"
|
||||
property string maximizeText : "最大化"
|
||||
property string closeText : "关闭"
|
||||
property string stayTopText : "置顶"
|
||||
property string stayTopCancelText : "取消置顶"
|
||||
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||
property color minimizeNormalColor: Qt.rgba(0,0,0,0)
|
||||
property color minimizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
@ -25,6 +27,7 @@ Rectangle{
|
||||
property bool showClose: true
|
||||
property bool showMinimize: true
|
||||
property bool showMaximize: true
|
||||
property bool showStayTop: true
|
||||
property bool titleVisible: true
|
||||
property url icon
|
||||
property int iconSize: 20
|
||||
@ -42,6 +45,11 @@ Rectangle{
|
||||
property var closeClickListener : function(){
|
||||
d.win.close()
|
||||
}
|
||||
property var stayTopClickListener: function(){
|
||||
if(d.win instanceof FluWindow){
|
||||
d.win.stayTop = !d.win.stayTop
|
||||
}
|
||||
}
|
||||
property var darkClickListener: function(){
|
||||
if(FluTheme.dark){
|
||||
FluTheme.darkMode = FluThemeType.Light
|
||||
@ -57,6 +65,12 @@ Rectangle{
|
||||
Item{
|
||||
id:d
|
||||
property var win: Window.window
|
||||
property bool stayTop: {
|
||||
if(d.win instanceof FluWindow){
|
||||
return d.win.stayTop
|
||||
}
|
||||
return false
|
||||
}
|
||||
property bool isRestore: win && Window.Maximized === win.visibility
|
||||
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
|
||||
}
|
||||
@ -106,6 +120,24 @@ Rectangle{
|
||||
textRight: false
|
||||
clickListener:()=> darkClickListener(btn_dark)
|
||||
}
|
||||
FluIconButton{
|
||||
id:btn_stay_top
|
||||
Layout.preferredWidth: 40
|
||||
Layout.preferredHeight: 30
|
||||
iconSource : FluentIcons.Pinned
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
iconSize: 13
|
||||
visible: {
|
||||
if(!(d.win instanceof FluWindow)){
|
||||
return false
|
||||
}
|
||||
return showStayTop
|
||||
}
|
||||
text:d.stayTop ? control.stayTopCancelText : control.stayTopText
|
||||
radius: 0
|
||||
iconColor: d.stayTop ? (FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark) : control.textColor
|
||||
onClicked: stayTopClickListener()
|
||||
}
|
||||
FluIconButton{
|
||||
id:btn_minimize
|
||||
Layout.preferredWidth: 40
|
||||
@ -164,6 +196,9 @@ Rectangle{
|
||||
onClicked: closeClickListener()
|
||||
}
|
||||
}
|
||||
function stayTopButton(){
|
||||
return btn_stay_top
|
||||
}
|
||||
function minimizeButton(){
|
||||
return btn_minimize
|
||||
}
|
||||
@ -177,4 +212,3 @@ Rectangle{
|
||||
return btn_dark
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ Item {
|
||||
properties: "opacity"
|
||||
from: 1
|
||||
to: 0
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
duration: FluTheme.enableAnimation ? 83 : 1
|
||||
}
|
||||
}
|
||||
add: Transition {
|
||||
@ -41,7 +41,7 @@ Item {
|
||||
properties: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
duration: FluTheme.enableAnimation ? 83 : 1
|
||||
}
|
||||
}
|
||||
delegate: Item{
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -464,10 +466,6 @@ Item {
|
||||
leftMargin: 6
|
||||
rightMargin: 6
|
||||
}
|
||||
Drag.active: item_mouse.drag.active
|
||||
Drag.hotSpot.x: item_control.width / 2
|
||||
Drag.hotSpot.y: item_control.height / 2
|
||||
Drag.dragType: Drag.Automatic
|
||||
onClicked:{
|
||||
if(type === 0){
|
||||
if(model.onTapListener){
|
||||
@ -497,23 +495,13 @@ Item {
|
||||
id:item_mouse
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton | Qt.LeftButton
|
||||
drag.target: item_control
|
||||
onPositionChanged: {
|
||||
parent.grabToImage(function(result) {
|
||||
parent.Drag.imageSource = result.url;
|
||||
})
|
||||
}
|
||||
drag.onActiveChanged:
|
||||
if (active) {
|
||||
parent.grabToImage(function(result) {
|
||||
parent.Drag.imageSource = result.url;
|
||||
})
|
||||
}
|
||||
onClicked:
|
||||
(mouse)=>{
|
||||
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{
|
||||
@ -861,15 +849,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
DropArea{
|
||||
anchors.fill: loader_content
|
||||
onDropped:
|
||||
(drag)=>{
|
||||
if(drag.source.modelData){
|
||||
drag.source.modelData.dropped(drag)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
id:loader_content
|
||||
anchors{
|
||||
@ -1139,6 +1118,7 @@ Item {
|
||||
clip: true
|
||||
currentIndex: -1
|
||||
model: control_popup.childModel
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
delegate:Button{
|
||||
id:item_button
|
||||
@ -1222,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{
|
||||
|
@ -25,5 +25,4 @@ QtObject {
|
||||
property Component editDelegate
|
||||
property bool showEdit
|
||||
signal tap
|
||||
signal dropped(var drag)
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ Page {
|
||||
font.pixelSize: control.textSize
|
||||
font.bold: control.textBold
|
||||
color: {
|
||||
if(item_button.hovered)
|
||||
if(item_button.hovered || nav_list.currentIndex === index)
|
||||
return textHoverColor
|
||||
return textNormalColor
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import FluentUI
|
||||
|
||||
ProgressBar{
|
||||
|
@ -1,6 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls.Basic
|
||||
import FluentUI
|
||||
|
||||
ProgressBar{
|
||||
|
@ -8,9 +8,7 @@ import FluentUI
|
||||
Rectangle {
|
||||
property var columnSource
|
||||
property var dataSource
|
||||
property color selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
|
||||
property color hoverButtonColor: Qt.alpha(selectionColor,0.2)
|
||||
property color pressedButtonColor: Qt.alpha(selectionColor,0.4)
|
||||
property color borderColor: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||
property alias tableModel: table_model
|
||||
id:control
|
||||
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||
@ -33,20 +31,21 @@ Rectangle {
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
property var currentRow
|
||||
property int rowHoverIndex: -1
|
||||
property int defaultItemWidth: 100
|
||||
property int defaultItemHeight: 42
|
||||
property var header_rows:[]
|
||||
property bool selectionFlag: true
|
||||
function obtEditDelegate(column,row){
|
||||
function obtEditDelegate(column,row,cellItem){
|
||||
var display = table_model.data(table_model.index(row,column),"display")
|
||||
var cellItem = table_view.itemAtCell(column, row)
|
||||
var cellPosition = cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader.column = column
|
||||
item_loader.row = row
|
||||
item_loader.x = table_view.contentX + cellPosition.x
|
||||
item_loader.y = table_view.contentY + cellPosition.y
|
||||
item_loader.width = table_view.columnWidthProvider(column)
|
||||
item_loader.height = table_view.rowHeightProvider(row)
|
||||
item_loader_layout.cellItem = cellItem
|
||||
item_loader_layout.x = table_view.contentX + cellPosition.x
|
||||
item_loader_layout.y = table_view.contentY + cellPosition.y
|
||||
item_loader_layout.width = table_view.columnWidthProvider(column)
|
||||
item_loader_layout.height = table_view.rowHeightProvider(row)
|
||||
item_loader.display = display
|
||||
var obj =columnSource[column].editDelegate
|
||||
if(obj){
|
||||
@ -156,93 +155,50 @@ Rectangle {
|
||||
bottomMargin: 6
|
||||
}
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
HoverHandler{
|
||||
MouseArea{
|
||||
acceptedButtons: Qt.NoButton
|
||||
id: hover_handler
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
}
|
||||
FluTooltip{
|
||||
text: item_text.text
|
||||
delay: 500
|
||||
visible: item_text.contentWidth < item_text.implicitWidth && item_text.contentHeight < item_text.implicitHeight && hover_handler.hovered
|
||||
visible: item_text.contentWidth < item_text.implicitWidth && item_text.contentHeight < item_text.implicitHeight && hover_handler.containsMouse
|
||||
}
|
||||
}
|
||||
}
|
||||
ScrollView{
|
||||
|
||||
MouseArea{
|
||||
id:scroll_table
|
||||
hoverEnabled: true
|
||||
anchors.left: header_vertical.right
|
||||
anchors.top: header_horizontal.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
|
||||
TableView {
|
||||
id:table_view
|
||||
ListModel{
|
||||
id:model_columns
|
||||
}
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.horizontal: FluScrollBar{}
|
||||
ScrollBar.vertical: FluScrollBar{}
|
||||
selectionModel: ItemSelectionModel {
|
||||
id:selection_model
|
||||
model: table_model
|
||||
onSelectionChanged: {
|
||||
if(selection_rect.dragging){
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
onExited: {
|
||||
d.rowHoverIndex = -1
|
||||
}
|
||||
onCanceled: {
|
||||
d.rowHoverIndex = -1
|
||||
}
|
||||
ScrollView{
|
||||
anchors.fill: parent
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
|
||||
TableView {
|
||||
id:table_view
|
||||
ListModel{
|
||||
id:model_columns
|
||||
}
|
||||
}
|
||||
columnWidthProvider: function(column) {
|
||||
var w = columnSource[column].width
|
||||
if(!w){
|
||||
w = columnSource[column].minimumWidth
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.horizontal: FluScrollBar{
|
||||
id:scroll_bar_h
|
||||
}
|
||||
if(!w){
|
||||
w = d.defaultItemWidth
|
||||
ScrollBar.vertical: FluScrollBar{
|
||||
id:scroll_bar_v
|
||||
}
|
||||
if(column === item_loader.column){
|
||||
item_loader.width = w
|
||||
}
|
||||
if(column === item_loader.column-1){
|
||||
let cellItem = table_view.itemAtCell(item_loader.column, item_loader.row)
|
||||
if(cellItem){
|
||||
let cellPosition = cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader.x = table_view.contentX + cellPosition.x
|
||||
}
|
||||
}
|
||||
return w
|
||||
}
|
||||
rowHeightProvider: function(row) {
|
||||
if(row>=table_model.rowCount){
|
||||
return 0
|
||||
}
|
||||
var h = table_model.getRow(row).height
|
||||
if(!h){
|
||||
h = table_model.getRow(row).minimumHeight
|
||||
}
|
||||
if(!h){
|
||||
return d.defaultItemHeight
|
||||
}
|
||||
if(row === item_loader.row){
|
||||
item_loader.height = h
|
||||
}
|
||||
if(row === item_loader.row-1){
|
||||
let cellItem = table_view.itemAtCell(item_loader.column, item_loader.row)
|
||||
if(cellItem){
|
||||
let cellPosition = cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader.y = table_view.contentY + cellPosition.y
|
||||
}
|
||||
}
|
||||
return h
|
||||
}
|
||||
model: table_model
|
||||
clip: true
|
||||
delegate: Rectangle {
|
||||
id:item_table
|
||||
property point position: Qt.point(column,row)
|
||||
required property bool selected
|
||||
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: {
|
||||
columnWidthProvider: function(column) {
|
||||
var w = columnSource[column].width
|
||||
if(!w){
|
||||
w = columnSource[column].minimumWidth
|
||||
@ -250,79 +206,156 @@ Rectangle {
|
||||
if(!w){
|
||||
w = d.defaultItemWidth
|
||||
}
|
||||
if(item_loader_layout.cellItem){
|
||||
if(column === item_loader.column){
|
||||
item_loader_layout.width = w
|
||||
}
|
||||
if(column === item_loader.column-1){
|
||||
let cellPosition = item_loader_layout.cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader_layout.x = table_view.contentX + cellPosition.x
|
||||
}
|
||||
}
|
||||
return w
|
||||
}
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
visible: !item_loader.sourceComponent
|
||||
color: selected ? control.selectionColor : "#00000000"
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed:{
|
||||
closeEditor()
|
||||
table_view.interactive = false
|
||||
rowHeightProvider: function(row) {
|
||||
if(row>=table_model.rowCount){
|
||||
return 0
|
||||
}
|
||||
onCanceled: {
|
||||
table_view.interactive = true
|
||||
var h = table_model.getRow(row).height
|
||||
if(!h){
|
||||
h = table_model.getRow(row).minimumHeight
|
||||
}
|
||||
onReleased: {
|
||||
table_view.interactive = true
|
||||
if(!h){
|
||||
h = d.defaultItemHeight
|
||||
}
|
||||
onDoubleClicked:{
|
||||
if(typeof(display) == "object"){
|
||||
return
|
||||
if(item_loader_layout.cellItem){
|
||||
if(row === item_loader.row){
|
||||
item_loader_layout.height = h
|
||||
}
|
||||
if(row === item_loader.row-1){
|
||||
let cellPosition = item_loader_layout.cellItem.mapToItem(scroll_table, 0, 0)
|
||||
item_loader_layout.y = table_view.contentY + cellPosition.y
|
||||
}
|
||||
item_loader.sourceComponent = d.obtEditDelegate(column,row)
|
||||
}
|
||||
onClicked:
|
||||
(event)=>{
|
||||
item_loader.sourceComponent = undefined
|
||||
if(!(event.modifiers & Qt.ControlModifier)){
|
||||
selection_model.clear()
|
||||
return h
|
||||
}
|
||||
model: table_model
|
||||
clip: true
|
||||
delegate: MouseArea{
|
||||
hoverEnabled: true
|
||||
implicitHeight: 40
|
||||
implicitWidth: {
|
||||
var w = columnSource[column].width
|
||||
if(!w){
|
||||
w = columnSource[column].minimumWidth
|
||||
}
|
||||
if(!w){
|
||||
w = d.defaultItemWidth
|
||||
}
|
||||
return w
|
||||
}
|
||||
onEntered: {
|
||||
d.rowHoverIndex = row
|
||||
}
|
||||
Rectangle{
|
||||
id:item_table
|
||||
anchors.fill: parent
|
||||
property point position: Qt.point(column,row)
|
||||
color:{
|
||||
if(d.rowHoverIndex === row || d.currentRow === table_model.getRow(row).__index){
|
||||
return FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
selection_model.select(table_model.index(row,column),ItemSelectionModel.Select)
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
event.accepted = true
|
||||
return (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.015) : Qt.rgba(0,0,0,0.015))
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
property var itemModel: model
|
||||
property var modelData: display
|
||||
property var tableView: table_view
|
||||
property var tableModel: table_model
|
||||
property point position: item_table.position
|
||||
property int row: position.y
|
||||
property int column: position.x
|
||||
property var options: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.options
|
||||
Rectangle{
|
||||
height: 18
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
width: 3
|
||||
visible: d.currentRow === table_model.getRow(row).__index && column === 0
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
leftMargin: 3
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.comId
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed:{
|
||||
closeEditor()
|
||||
}
|
||||
onCanceled: {
|
||||
}
|
||||
onReleased: {
|
||||
}
|
||||
onDoubleClicked:{
|
||||
if(typeof(display) == "object"){
|
||||
return
|
||||
}
|
||||
item_loader.sourceComponent = d.obtEditDelegate(column,row,item_table)
|
||||
}
|
||||
onClicked:
|
||||
(event)=>{
|
||||
d.currentRow = table_model.getRow(row).__index
|
||||
item_loader.sourceComponent = undefined
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
property var itemModel: model
|
||||
property var modelData: display
|
||||
property var tableView: table_view
|
||||
property var tableModel: table_model
|
||||
property var position: item_table.position
|
||||
property int row: position.y
|
||||
property int column: position.x
|
||||
property var options: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.options
|
||||
}
|
||||
return {}
|
||||
}
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(typeof(modelData) == "object"){
|
||||
return modelData.comId
|
||||
}
|
||||
return com_text
|
||||
}
|
||||
}
|
||||
return com_text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
id:item_loader
|
||||
z:2
|
||||
property var display
|
||||
property int column
|
||||
property int row
|
||||
property var tableView: control
|
||||
sourceComponent: undefined
|
||||
onDisplayChanged: {
|
||||
var obj = table_model.getRow(row)
|
||||
obj[columnSource[column].dataIndex] = display
|
||||
table_model.setRow(row,obj)
|
||||
MouseArea{
|
||||
property var cellItem
|
||||
id:item_loader_layout
|
||||
acceptedButtons: Qt.NoButton
|
||||
visible: item_loader.sourceComponent
|
||||
onVisibleChanged: {
|
||||
if(!visible){
|
||||
item_loader_layout.cellItem = undefined
|
||||
}
|
||||
}
|
||||
hoverEnabled: true
|
||||
z:2
|
||||
onEntered: {
|
||||
d.rowHoverIndex = -1
|
||||
}
|
||||
Loader{
|
||||
id:item_loader
|
||||
property var display
|
||||
property int column
|
||||
property int row
|
||||
property var tableView: control
|
||||
sourceComponent: undefined
|
||||
anchors.fill: parent
|
||||
onDisplayChanged: {
|
||||
var obj = table_model.getRow(row)
|
||||
obj[columnSource[column].dataIndex] = display
|
||||
table_model.setRow(row,obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -330,28 +363,12 @@ Rectangle {
|
||||
id:com_handle
|
||||
Item {}
|
||||
}
|
||||
SelectionRectangle {
|
||||
id:selection_rect
|
||||
target: table_view
|
||||
bottomRightHandle:com_handle
|
||||
topLeftHandle: com_handle
|
||||
onDraggingChanged: {
|
||||
if(!dragging){
|
||||
table_view.interactive = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:com_column_text
|
||||
FluText {
|
||||
id: column_text
|
||||
text: modelData
|
||||
anchors.fill: parent
|
||||
font.bold:{
|
||||
d.selectionFlag
|
||||
return selection_model.columnIntersectsSelection(column)
|
||||
}
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
@ -379,17 +396,36 @@ Rectangle {
|
||||
readonly property var obj : columnSource[column]
|
||||
implicitWidth: item_column_loader.item.implicitWidth + (cellPadding * 2)
|
||||
implicitHeight: Math.max(36, item_column_loader.item.implicitHeight + (cellPadding * 2))
|
||||
color:{
|
||||
d.selectionFlag
|
||||
if(column_item_control_mouse.pressed){
|
||||
return control.pressedButtonColor
|
||||
}
|
||||
if(selection_model.isColumnSelected(column)){
|
||||
return control.hoverButtonColor
|
||||
}
|
||||
return column_item_control_mouse.containsMouse&&!canceled ? control.hoverButtonColor : FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.top: parent.top
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.bottom: parent.bottom
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.right: parent.right
|
||||
color:"#00000000"
|
||||
visible: column === tableModel.columnCount - 1
|
||||
}
|
||||
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||
MouseArea{
|
||||
id:column_item_control_mouse
|
||||
anchors.fill: parent
|
||||
@ -406,13 +442,6 @@ Rectangle {
|
||||
onClicked:
|
||||
(event)=>{
|
||||
closeEditor()
|
||||
if(!(event.modifiers & Qt.ControlModifier)){
|
||||
selection_model.clear()
|
||||
}
|
||||
for(var i=0;i<=table_view.rows;i++){
|
||||
selection_model.select(table_model.index(i,column),ItemSelectionModel.Select)
|
||||
}
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
@ -502,31 +531,58 @@ Rectangle {
|
||||
return []
|
||||
}
|
||||
}
|
||||
onContentYChanged:{
|
||||
timer_force_layout.restart()
|
||||
}
|
||||
Timer{
|
||||
interval: 50
|
||||
id:timer_force_layout
|
||||
onTriggered: {
|
||||
header_vertical.forceLayout()
|
||||
}
|
||||
}
|
||||
delegate: Rectangle{
|
||||
id:item_control
|
||||
readonly property real cellPadding: 8
|
||||
property bool canceled: false
|
||||
implicitWidth: Math.max(30, row_text.implicitWidth + (cellPadding * 2))
|
||||
implicitHeight: row_text.implicitHeight + (cellPadding * 2)
|
||||
color: {
|
||||
d.selectionFlag
|
||||
if(item_control_mouse.pressed){
|
||||
return control.pressedButtonColor
|
||||
}
|
||||
if(selection_model.isRowSelected(row)){
|
||||
return control.hoverButtonColor
|
||||
}
|
||||
return item_control_mouse.containsMouse&&!canceled ? control.hoverButtonColor : FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
width: implicitWidth
|
||||
height: implicitHeight
|
||||
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.top: parent.top
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.bottom: parent.bottom
|
||||
visible: row === tableModel.rowCount - 1
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
color:"#00000000"
|
||||
}
|
||||
Rectangle{
|
||||
border.color: control.borderColor
|
||||
width: 1
|
||||
height: parent.height
|
||||
anchors.right: parent.right
|
||||
color:"#00000000"
|
||||
}
|
||||
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||
FluText{
|
||||
id:row_text
|
||||
anchors.centerIn: parent
|
||||
text: row + 1
|
||||
font.bold:{
|
||||
d.selectionFlag
|
||||
return selection_model.rowIntersectsSelection(row)
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
id:item_control_mouse
|
||||
@ -544,13 +600,6 @@ Rectangle {
|
||||
onClicked:
|
||||
(event)=>{
|
||||
closeEditor()
|
||||
if(!(event.modifiers & Qt.ControlModifier)){
|
||||
selection_model.clear()
|
||||
}
|
||||
for(var i=0;i<=columnSource.length;i++){
|
||||
selection_model.select(table_model.index(row,i),ItemSelectionModel.Select)
|
||||
}
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
@ -608,7 +657,8 @@ Rectangle {
|
||||
item_loader.sourceComponent = null
|
||||
}
|
||||
function resetPosition(){
|
||||
table_view.positionViewAtCell(Qt.point(0, 0),Qt.AlignTop|Qt.AlignLeft)
|
||||
scroll_bar_h.position = 0
|
||||
scroll_bar_v.position = 0
|
||||
}
|
||||
function customItem(comId,options={}){
|
||||
var o = {}
|
||||
|
@ -38,7 +38,15 @@ TextField{
|
||||
return placeholderNormalColor
|
||||
}
|
||||
selectByMouse: true
|
||||
rightPadding: icon_end.visible ? 66 : 40
|
||||
rightPadding: {
|
||||
var w = 30
|
||||
if(control.cleanEnabled === false){
|
||||
w = 0
|
||||
}
|
||||
if(control.readOnly)
|
||||
w = 0
|
||||
return icon_end.visible ? w+36 : w+10
|
||||
}
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: control
|
||||
implicitWidth: 240
|
||||
|
@ -13,12 +13,14 @@ Window {
|
||||
property bool fixSize: false
|
||||
property Component loadingItem: com_loading
|
||||
property var appBar: com_app_bar
|
||||
flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||
property color backgroundColor: {
|
||||
if(active){
|
||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(237/255,237/255,237/255,1)
|
||||
}
|
||||
property bool stayTop: false
|
||||
property var _pageRegister
|
||||
property string _route
|
||||
property var closeListener: function(event){
|
||||
@ -32,9 +34,13 @@ Window {
|
||||
signal initArgument(var argument)
|
||||
id:window
|
||||
color:"transparent"
|
||||
onStayTopChanged: {
|
||||
d.changedStayTop()
|
||||
}
|
||||
Component.onCompleted: {
|
||||
lifecycle.onCompleted(window)
|
||||
initArgument(argument)
|
||||
d.changedStayTop()
|
||||
}
|
||||
Component.onDestruction: {
|
||||
lifecycle.onDestruction()
|
||||
@ -42,6 +48,21 @@ Window {
|
||||
onVisibleChanged: {
|
||||
lifecycle.onVisible(visible)
|
||||
}
|
||||
onVisibilityChanged: {
|
||||
console.debug(visibility)
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
function changedStayTop(){
|
||||
var visibility = window.visibility
|
||||
if(window.stayTop){
|
||||
window.flags = window.flags | Qt.WindowStaysOnTopHint
|
||||
}else{
|
||||
window.flags = window.flags &~ Qt.WindowStaysOnTopHint
|
||||
}
|
||||
window.visibility = visibility
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
target: window
|
||||
function onClosing(event){closeListener(event)}
|
||||
@ -91,7 +112,6 @@ Window {
|
||||
id:com_loading
|
||||
Popup{
|
||||
id:popup_loading
|
||||
modal:true
|
||||
focus: true
|
||||
width: window.width
|
||||
height: window.height
|
||||
@ -173,6 +193,7 @@ Window {
|
||||
setHitTestVisible(title_bar.minimizeButton())
|
||||
setHitTestVisible(title_bar.maximizeButton())
|
||||
setHitTestVisible(title_bar.closeButton())
|
||||
setHitTestVisible(title_bar.stayTopButton())
|
||||
setWindowFixedSize(fixSize)
|
||||
title_bar.maximizeButton.visible = !fixSize
|
||||
if (blurBehindWindowEnabled)
|
||||
|
Reference in New Issue
Block a user