mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-01 14:53:59 +08:00
Compare commits
68 Commits
Author | SHA1 | Date | |
---|---|---|---|
e3e4592ea4 | |||
71c238e62b | |||
77ae88f518 | |||
2f9090858b | |||
dfb80e70ee | |||
7618fe0f37 | |||
cbebb51d62 | |||
f0227c5686 | |||
24c8644d79 | |||
40ce63e1df | |||
cc4abbf79f | |||
35921ed900 | |||
661529f1f4 | |||
139c5c455d | |||
3460b59839 | |||
bdbd5d295e | |||
51637fceca | |||
7f542edba7 | |||
0b124ec9ee | |||
fa77ed6163 | |||
eef46a2dac | |||
f856fd44c1 | |||
35bfb8021f | |||
29012f0b68 | |||
54b98c8e05 | |||
20852ac6bf | |||
636dddaa84 | |||
50a6103584 | |||
a693db76c8 | |||
25e385c06e | |||
777459e35d | |||
9bdc6c45cd | |||
fc618e96c5 | |||
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 |
@ -31,4 +31,4 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "${CMAKE_SOURCE_DIR}/example/favicon.ico"
|
||||
IDI_ICON1 ICON DISCARDABLE "${FLUENTUI_DIRECTORY}/example/favicon.ico"
|
||||
|
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
|
||||
sudo 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%
|
||||
|
@ -18,9 +18,9 @@ endif()
|
||||
|
||||
#设置可执行文件输出目录
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${FLUENTUI_DIRECTORY}/bin/debug)
|
||||
else()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${FLUENTUI_DIRECTORY}/bin/release)
|
||||
endif()
|
||||
|
||||
#获取文件路径分隔符(解决执行命令的时候有些平台会报错)
|
||||
@ -81,7 +81,7 @@ if(WIN32)
|
||||
)
|
||||
configure_file(
|
||||
${FLUENTUI_DIRECTORY}/.cmake/InstallerScript.iss.in
|
||||
${CMAKE_SOURCE_DIR}/action-cli/InstallerScript.iss
|
||||
${FLUENTUI_DIRECTORY}/action-cli/InstallerScript.iss
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -139,7 +139,7 @@ target_include_directories(example PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/component
|
||||
)
|
||||
|
||||
#如何是静态库则需要手动注册插件,导入FluentUI.h头文件
|
||||
#如果是静态库则需要手动注册插件,导入FluentUI.h头文件
|
||||
if(FLUENTUI_BUILD_STATIC_LIB)
|
||||
target_include_directories(example PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
|
@ -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) }
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ FluScrollablePage{
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
radius: 5
|
||||
color:FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
color:FluTheme.itemHoverColor
|
||||
visible: item_mouse.containsMouse
|
||||
}
|
||||
Rectangle{
|
||||
@ -172,17 +172,10 @@ FluScrollablePage{
|
||||
anchors.fill: parent
|
||||
radius: 8
|
||||
color:{
|
||||
if(FluTheme.dark){
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(item_mouse.containsMouse){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
}
|
||||
Image{
|
||||
@ -227,7 +220,7 @@ FluScrollablePage{
|
||||
height: 12
|
||||
width: 12
|
||||
radius: 6
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
anchors{
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
|
@ -35,7 +35,7 @@ FluScrollablePage{
|
||||
color: FluTheme.dark ? FluColors.Black : FluColors.White
|
||||
FluShadow{
|
||||
radius: 4
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
Image{
|
||||
id:image
|
||||
|
@ -66,7 +66,7 @@ FluScrollablePage{
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color:FluTheme.primaryColor.dark
|
||||
color:FluTheme.primaryColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -78,7 +78,7 @@ FluScrollablePage{
|
||||
statusMode: FluStatusViewType.Loading
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
color:FluTheme.primaryColor.dark
|
||||
color:FluTheme.primaryColor
|
||||
}
|
||||
}'
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ FluContentPage{
|
||||
iconSource: FluentIcons.ChevronUp
|
||||
iconColor: {
|
||||
if(1 === root.sortType){
|
||||
return FluTheme.primaryColor.dark
|
||||
return FluTheme.primaryColor
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
||||
}
|
||||
@ -202,7 +202,7 @@ FluContentPage{
|
||||
iconSource: FluentIcons.ChevronDown
|
||||
iconColor: {
|
||||
if(2 === root.sortType){
|
||||
return FluTheme.primaryColor.dark
|
||||
return FluTheme.primaryColor
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ FluScrollablePage{
|
||||
anchors.centerIn: parent
|
||||
iconSource: FluentIcons.AcceptMedium
|
||||
iconSize: 15
|
||||
visible: modelData === FluTheme.primaryColor
|
||||
visible: modelData === FluTheme.themeColor
|
||||
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||
}
|
||||
MouseArea{
|
||||
@ -40,7 +40,7 @@ FluScrollablePage{
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
FluTheme.primaryColor = modelData
|
||||
FluTheme.themeColor = modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,7 +88,7 @@ FluScrollablePage{
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -1
|
||||
code:'FluTheme.primaryColor = FluColors.Orange
|
||||
code:'FluTheme.themeColor = FluColors.Orange
|
||||
|
||||
FluTheme.dark = true
|
||||
|
||||
|
@ -4,6 +4,7 @@ import FluentUI
|
||||
FluViewModel{
|
||||
|
||||
objectName: "SettingsViewModel"
|
||||
scope: FluViewModelType.Application
|
||||
property int displayMode
|
||||
|
||||
onInitData: {
|
||||
|
@ -60,11 +60,11 @@ FluWindow {
|
||||
event.accepted = false
|
||||
return
|
||||
}
|
||||
if (event.urls.length !== 1) {
|
||||
var url = getUrlByEvent(event)
|
||||
if(url === ""){
|
||||
event.accepted = false
|
||||
return
|
||||
}
|
||||
var url = event.urls[0].toString()
|
||||
var fileExtension = url.substring(url.lastIndexOf(".") + 1)
|
||||
if (fileExtension !== "qml") {
|
||||
event.accepted = false
|
||||
@ -74,12 +74,24 @@ FluWindow {
|
||||
}
|
||||
onDropped:
|
||||
(event)=>{
|
||||
var path = event.urls[0].toString()
|
||||
loader.source = path
|
||||
watcher.path = path
|
||||
loader.reload()
|
||||
var url = getUrlByEvent(event)
|
||||
if(url !== ""){
|
||||
loader.source = url
|
||||
watcher.path = url
|
||||
loader.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getUrlByEvent(event){
|
||||
var url = ""
|
||||
if (event.urls.length === 0) {
|
||||
url = "file:///"+event.getDataAsString("text/plain")
|
||||
}else{
|
||||
url = event.urls[0].toString()
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
@ -232,7 +244,7 @@ FluWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_reveal
|
||||
anchors.fill: parent
|
||||
}
|
||||
@ -242,7 +254,7 @@ FluWindow {
|
||||
}
|
||||
|
||||
function handleDarkChanged(button){
|
||||
if(FluTools.isMacos() || !FluTheme.enableAnimation){
|
||||
if(!FluTheme.enableAnimation){
|
||||
changeDark()
|
||||
}else{
|
||||
loader_reveal.sourceComponent = com_reveal
|
||||
|
@ -18,7 +18,7 @@ FluWindow {
|
||||
window.title = arg.title
|
||||
loader.setSource( arg.url,{animDisabled:true})
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
@ -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) }
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.0
|
||||
import "qrc:///example/qml/global"
|
||||
import FluentUI 1.0
|
||||
|
||||
@ -78,7 +77,7 @@ FluScrollablePage{
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
radius: 5
|
||||
color:FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
color:FluTheme.itemHoverColor
|
||||
visible: item_mouse.containsMouse
|
||||
}
|
||||
Rectangle{
|
||||
@ -173,17 +172,10 @@ FluScrollablePage{
|
||||
anchors.fill: parent
|
||||
radius: 8
|
||||
color:{
|
||||
if(FluTheme.dark){
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(item_mouse.containsMouse){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(item_mouse.containsMouse){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
}
|
||||
Image{
|
||||
@ -228,7 +220,7 @@ FluScrollablePage{
|
||||
height: 12
|
||||
width: 12
|
||||
radius: 6
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
anchors{
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
|
@ -36,7 +36,7 @@ FluScrollablePage{
|
||||
color: FluTheme.dark ? FluColors.Black : FluColors.White
|
||||
FluShadow{
|
||||
radius: 4
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
Image{
|
||||
id:image
|
||||
|
@ -67,7 +67,7 @@ FluScrollablePage{
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color:FluTheme.primaryColor.dark
|
||||
color:FluTheme.primaryColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -79,7 +79,7 @@ FluScrollablePage{
|
||||
statusMode: FluStatusViewType.Loading
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
color:FluTheme.primaryColor.dark
|
||||
color:FluTheme.primaryColor
|
||||
}
|
||||
}'
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ FluContentPage{
|
||||
iconSource: FluentIcons.ChevronUp
|
||||
iconColor: {
|
||||
if(1 === root.sortType){
|
||||
return FluTheme.primaryColor.dark
|
||||
return FluTheme.primaryColor
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
||||
}
|
||||
@ -203,7 +203,7 @@ FluContentPage{
|
||||
iconSource: FluentIcons.ChevronDown
|
||||
iconColor: {
|
||||
if(2 === root.sortType){
|
||||
return FluTheme.primaryColor.dark
|
||||
return FluTheme.primaryColor
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ FluScrollablePage{
|
||||
anchors.centerIn: parent
|
||||
iconSource: FluentIcons.AcceptMedium
|
||||
iconSize: 15
|
||||
visible: modelData === FluTheme.primaryColor
|
||||
visible: modelData === FluTheme.themeColor
|
||||
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||
}
|
||||
MouseArea{
|
||||
@ -41,7 +41,7 @@ FluScrollablePage{
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
FluTheme.primaryColor = modelData
|
||||
FluTheme.themeColor = modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ FluScrollablePage{
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -1
|
||||
code:'FluTheme.primaryColor = FluColors.Orange
|
||||
code:'FluTheme.themeColor = FluColors.Orange
|
||||
|
||||
FluTheme.dark = true
|
||||
|
||||
|
@ -4,6 +4,7 @@ import FluentUI 1.0
|
||||
FluViewModel{
|
||||
|
||||
objectName: "SettingsViewModel"
|
||||
scope: FluViewModelType.Application
|
||||
property int displayMode
|
||||
|
||||
onInitData: {
|
||||
|
@ -61,11 +61,11 @@ FluWindow {
|
||||
event.accepted = false
|
||||
return
|
||||
}
|
||||
if (event.urls.length !== 1) {
|
||||
var url = getUrlByEvent(event)
|
||||
if(url === ""){
|
||||
event.accepted = false
|
||||
return
|
||||
}
|
||||
var url = event.urls[0].toString()
|
||||
var fileExtension = url.substring(url.lastIndexOf(".") + 1)
|
||||
if (fileExtension !== "qml") {
|
||||
event.accepted = false
|
||||
@ -75,12 +75,24 @@ FluWindow {
|
||||
}
|
||||
onDropped:
|
||||
(event)=>{
|
||||
var path = event.urls[0].toString()
|
||||
loader.source = path
|
||||
watcher.path = path
|
||||
loader.reload()
|
||||
var url = getUrlByEvent(event)
|
||||
if(url !== ""){
|
||||
loader.source = url
|
||||
watcher.path = url
|
||||
loader.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getUrlByEvent(event){
|
||||
var url = ""
|
||||
if (event.urls.length === 0) {
|
||||
url = "file:///"+event.getDataAsString("text/plain")
|
||||
}else{
|
||||
url = event.urls[0].toString()
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
@ -235,7 +247,7 @@ FluWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_reveal
|
||||
anchors.fill: parent
|
||||
}
|
||||
@ -245,7 +257,7 @@ FluWindow {
|
||||
}
|
||||
|
||||
function handleDarkChanged(button){
|
||||
if(FluTools.isMacos() || !FluTheme.enableAnimation){
|
||||
if(!FluTheme.enableAnimation){
|
||||
changeDark()
|
||||
}else{
|
||||
loader_reveal.sourceComponent = com_reveal
|
||||
|
@ -19,7 +19,7 @@ FluWindow {
|
||||
window.title = arg.title
|
||||
loader.setSource( arg.url,{animDisabled:true})
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
@ -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...e01c6518db
@ -14,26 +14,18 @@
|
||||
FRAMELESSHELPER_USE_NAMESPACE
|
||||
|
||||
FluApp::FluApp(QObject *parent):QObject{parent}{
|
||||
vsync(false);
|
||||
vsync(true);
|
||||
httpInterceptor(nullptr);
|
||||
}
|
||||
|
||||
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);
|
||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
#ifdef Q_OS_WIN
|
||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow,false);
|
||||
#endif
|
||||
#ifdef Q_OS_MACOS
|
||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur,false);
|
||||
#endif
|
||||
QQmlEngine *engine = qmlEngine(_application);
|
||||
FramelessHelper::Quick::registerTypes(engine);
|
||||
}
|
||||
@ -88,6 +80,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);
|
||||
}
|
||||
}
|
||||
|
@ -4,14 +4,20 @@
|
||||
#include <QObject>
|
||||
#include <QtQml/qqml.h>
|
||||
#include <QFile>
|
||||
#include <QJsonValue>
|
||||
#include <QNetworkAccessManager>
|
||||
#include "stdafx.h"
|
||||
|
||||
class HttpRequest : public QObject{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY_AUTO(QString,url);
|
||||
# if (QT_VERSION == QT_VERSION_CHECK(6, 4, 3))
|
||||
Q_PROPERTY_AUTO(QJsonValue,params);
|
||||
Q_PROPERTY_AUTO(QJsonValue,headers);
|
||||
# else
|
||||
Q_PROPERTY_AUTO(QVariant,params);
|
||||
Q_PROPERTY_AUTO(QVariant,headers);
|
||||
# endif
|
||||
Q_PROPERTY_AUTO(QString,method);
|
||||
Q_PROPERTY_AUTO(QString,downloadSavePath);
|
||||
QML_NAMED_ELEMENT(HttpRequest)
|
||||
|
@ -16,14 +16,31 @@ FluTheme::FluTheme(QObject *parent):QObject{parent}{
|
||||
connect(this,&FluTheme::darkModeChanged,this,[=]{
|
||||
Q_EMIT darkChanged();
|
||||
});
|
||||
primaryColor(FluColors::getInstance()->Blue());
|
||||
connect(this,&FluTheme::darkChanged,this,[=]{refreshColors();});
|
||||
connect(this,&FluTheme::themeColorChanged,this,[=]{refreshColors();});
|
||||
themeColor(FluColors::getInstance()->Blue());
|
||||
darkMode(FluThemeType::DarkMode::Light);
|
||||
nativeText(false);
|
||||
enableAnimation(true);
|
||||
darkMode(FluThemeType::DarkMode::Light);
|
||||
_systemDark = systemDark();
|
||||
qApp->installEventFilter(this);
|
||||
}
|
||||
|
||||
void FluTheme::refreshColors(){
|
||||
auto isDark = dark();
|
||||
primaryColor(isDark ? _themeColor->lighter() : _themeColor->dark());
|
||||
backgroundColor(isDark ? QColor(0,0,0,255) : QColor(1,1,1,255));
|
||||
windowBackgroundColor(isDark ? QColor(32,32,32,255) : QColor(237,237,237,255));
|
||||
windowActiveBackgroundColor(isDark ? QColor(26,26,26,255) : QColor(243,243,243,255));
|
||||
fontPrimaryColor(isDark ? QColor(248,248,248,255) : QColor(7,7,7,255));
|
||||
fontSecondaryColor(isDark ? QColor(222,222,222,255) : QColor(102,102,102,255));
|
||||
fontTertiaryColor(isDark ? QColor(200,200,200,255) : QColor(153,153,153,255));
|
||||
itemNormalColor(isDark ? QColor(255,255,255,0) : QColor(0,0,0,0));
|
||||
itemHoverColor(isDark ? QColor(255,255,255,255*0.03) : QColor(0,0,0,255*0.03));
|
||||
itemPressColor(isDark ? QColor(255,255,255,255*0.06) : QColor(0,0,0,255*0.06));
|
||||
itemCheckColor(isDark ? QColor(255,255,255,255*0.09) : QColor(0,0,0,255*0.09));
|
||||
}
|
||||
|
||||
bool FluTheme::eventFilter(QObject *obj, QEvent *event){
|
||||
Q_UNUSED(obj);
|
||||
if (event->type() == QEvent::ApplicationPaletteChange || event->type() == QEvent::ThemeChange)
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QtQml/qqml.h>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QColor>
|
||||
#include "FluColorSet.h"
|
||||
#include "stdafx.h"
|
||||
#include "singleton.h"
|
||||
@ -16,7 +17,18 @@ class FluTheme : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool dark READ dark NOTIFY darkChanged)
|
||||
Q_PROPERTY_AUTO(FluColorSet*,primaryColor)
|
||||
Q_PROPERTY_AUTO(FluColorSet*,themeColor);
|
||||
Q_PROPERTY_AUTO(QColor,primaryColor);
|
||||
Q_PROPERTY_AUTO(QColor,backgroundColor);
|
||||
Q_PROPERTY_AUTO(QColor,windowBackgroundColor);
|
||||
Q_PROPERTY_AUTO(QColor,windowActiveBackgroundColor);
|
||||
Q_PROPERTY_AUTO(QColor,fontPrimaryColor);
|
||||
Q_PROPERTY_AUTO(QColor,fontSecondaryColor);
|
||||
Q_PROPERTY_AUTO(QColor,fontTertiaryColor);
|
||||
Q_PROPERTY_AUTO(QColor,itemNormalColor);
|
||||
Q_PROPERTY_AUTO(QColor,itemHoverColor);
|
||||
Q_PROPERTY_AUTO(QColor,itemPressColor);
|
||||
Q_PROPERTY_AUTO(QColor,itemCheckColor);
|
||||
Q_PROPERTY_AUTO(int,darkMode);
|
||||
Q_PROPERTY_AUTO(bool,nativeText);
|
||||
Q_PROPERTY_AUTO(bool,enableAnimation);
|
||||
@ -26,6 +38,7 @@ private:
|
||||
explicit FluTheme(QObject *parent = nullptr);
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
bool systemDark();
|
||||
void refreshColors();
|
||||
public:
|
||||
SINGLETONG(FluTheme)
|
||||
Q_INVOKABLE QJsonArray awesomeList(const QString& keyword = "");
|
||||
@ -33,7 +46,6 @@ public:
|
||||
static FluTheme *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();}
|
||||
bool dark();
|
||||
private:
|
||||
bool _dark;
|
||||
bool _systemDark;
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,9 @@ bool ViewModelManager::exist(const QString& key){
|
||||
void ViewModelManager::refreshViewModel(FluViewModel* viewModel,QString key,QVariant value){
|
||||
foreach (auto item, _viewmodel) {
|
||||
if(item->getKey() == viewModel->getKey()){
|
||||
item->setProperty(key.toStdString().c_str(),value);
|
||||
item->enablePropertyChange = false;
|
||||
item->setProperty(key.toLatin1().constData(),value);
|
||||
item->enablePropertyChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -51,14 +53,16 @@ PropertyObserver::~PropertyObserver(){
|
||||
}
|
||||
|
||||
void PropertyObserver::_propertyChange(){
|
||||
auto value = _property.read();
|
||||
_model->setProperty(_name.toStdString().c_str(),value);
|
||||
ViewModelManager::getInstance()->refreshViewModel((FluViewModel*)parent(),_name,value);
|
||||
auto viewModel = (FluViewModel*)parent();
|
||||
if(viewModel->enablePropertyChange){
|
||||
auto value = _property.read();
|
||||
_model->setProperty(_name.toLatin1().constData(),value);
|
||||
ViewModelManager::getInstance()->refreshViewModel(viewModel,_name,value);
|
||||
}
|
||||
}
|
||||
|
||||
FluViewModel::FluViewModel(QObject *parent):QObject{parent}{
|
||||
scope(FluViewModelType::Scope::Window);
|
||||
target(nullptr);
|
||||
ViewModelManager::getInstance()->insertViewModel(this);
|
||||
}
|
||||
|
||||
@ -77,7 +81,7 @@ void FluViewModel::componentComplete(){
|
||||
}
|
||||
const QMetaObject* obj = metaObject();
|
||||
if(_scope == FluViewModelType::Scope::Window){
|
||||
_key = property("objectName_").toString()+QString::number(reinterpret_cast<qulonglong>(_window), 16);
|
||||
_key = property("objectName").toString()+"-"+QString::number(reinterpret_cast<qulonglong>(_window), 16);
|
||||
}else{
|
||||
_key = property("objectName").toString();
|
||||
}
|
||||
@ -93,7 +97,7 @@ void FluViewModel::componentComplete(){
|
||||
const QMetaProperty property = obj->property(i);
|
||||
QString propertyName = property.name();
|
||||
auto value = property.read(this);
|
||||
model->setProperty(propertyName.toStdString().c_str(),value);
|
||||
model->setProperty(propertyName.toLatin1().constData(),value);
|
||||
new PropertyObserver(propertyName,model,this);
|
||||
}
|
||||
ViewModelManager::getInstance()->insert(_key,model);
|
||||
|
@ -20,7 +20,6 @@ class FluViewModel : public QObject, public QQmlParserStatus
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QQmlParserStatus)
|
||||
Q_PROPERTY_AUTO(int,scope);
|
||||
Q_PROPERTY_AUTO(QObject*,target);
|
||||
QML_NAMED_ELEMENT(FluViewModel)
|
||||
public:
|
||||
explicit FluViewModel(QObject *parent = nullptr);
|
||||
@ -29,6 +28,7 @@ public:
|
||||
void componentComplete() override;
|
||||
Q_SIGNAL void initData();
|
||||
QString getKey();
|
||||
bool enablePropertyChange = true;
|
||||
private:
|
||||
QObject* _window = nullptr;
|
||||
QString _key = "";
|
||||
|
@ -151,6 +151,8 @@ void FluentUI::registerTypes(const char *uri){
|
||||
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluProgressButton.qml"),uri,major,minor,"FluProgressButton");
|
||||
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoadingButton.qml"),uri,major,minor,"FluLoadingButton");
|
||||
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluClip.qml"),uri,major,minor,"FluClip");
|
||||
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoader.qml"),uri,major,minor,"FluLoader");
|
||||
|
||||
|
||||
qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri,major,minor,"FluentIcons", "Access to enums & flags only");
|
||||
qmlRegisterUncreatableMetaObject(FluHttpType::staticMetaObject, uri,major,minor,"FluHttpType", "Access to enums & flags only");
|
||||
|
@ -11,13 +11,15 @@ 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)
|
||||
property color minimizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
property color maximizeNormalColor: Qt.rgba(0,0,0,0)
|
||||
property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
property color maximizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
property color minimizeNormalColor: FluTheme.itemNormalColor
|
||||
property color minimizeHoverColor: FluTheme.itemHoverColor
|
||||
property color minimizePressColor: FluTheme.itemPressColor
|
||||
property color maximizeNormalColor: FluTheme.itemNormalColor
|
||||
property color maximizeHoverColor: FluTheme.itemHoverColor
|
||||
property color maximizePressColor: FluTheme.itemPressColor
|
||||
property color closeNormalColor: Qt.rgba(0,0,0,0)
|
||||
property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1)
|
||||
property color closePressColor: Qt.rgba(251/255,115/255,115/255,0.8)
|
||||
@ -25,11 +27,12 @@ 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
|
||||
property bool isMac: FluTools.isMacos()
|
||||
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color borerlessColor : FluTheme.primaryColor
|
||||
property var maxClickListener : function(){
|
||||
if (d.win.visibility === Window.Maximized)
|
||||
d.win.visibility = Window.Windowed
|
||||
@ -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.primaryColor : 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{
|
||||
|
@ -65,7 +65,7 @@ Item {
|
||||
height: 50
|
||||
radius: 25
|
||||
visible: isYear
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
FluText{
|
||||
text:date.getFullYear()
|
||||
@ -124,7 +124,7 @@ Item {
|
||||
height: 50
|
||||
radius: 25
|
||||
visible: isMonth
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
FluText{
|
||||
text:(date.getMonth()+1)+"月"
|
||||
@ -184,7 +184,7 @@ Item {
|
||||
radius: 18
|
||||
color:"#00000000"
|
||||
visible: isDay
|
||||
border.color: FluTheme.primaryColor.dark
|
||||
border.color: FluTheme.primaryColor
|
||||
border.width: 1
|
||||
}
|
||||
Rectangle{
|
||||
@ -194,7 +194,7 @@ Item {
|
||||
height: 30
|
||||
radius: 15
|
||||
visible: isToDay
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
FluText{
|
||||
text:date.getDate()
|
||||
@ -331,7 +331,7 @@ Item {
|
||||
cellWidth: displayMode === FluCalendarViewType.Month ? 40 : 70
|
||||
clip: true
|
||||
boundsBehavior:Flickable.StopAtBounds
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var modelData : model
|
||||
property var name : model.name
|
||||
property var date : model.date
|
||||
|
@ -75,7 +75,7 @@ Item {
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
property int displayIndex : item_control.displayIndex
|
||||
property var model: list_view.model.get(index)
|
||||
anchors.fill: parent
|
||||
@ -124,9 +124,9 @@ Item {
|
||||
radius: 4
|
||||
}
|
||||
scale: checked ? 1.2 : 1
|
||||
color: checked ? FluTheme.primaryColor.dark : Qt.rgba(1,1,1,0.7)
|
||||
color: checked ? FluTheme.primaryColor : Qt.rgba(1,1,1,0.7)
|
||||
border.width: mouse_item.containsMouse ? 1 : 0
|
||||
border.color: FluTheme.primaryColor.dark
|
||||
border.color: FluTheme.primaryColor
|
||||
MouseArea{
|
||||
id:mouse_item
|
||||
hoverEnabled: true
|
||||
@ -156,7 +156,7 @@ Item {
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
Loader{
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
|
@ -7,12 +7,12 @@ Button {
|
||||
property bool disabled: false
|
||||
property string contentDescription: ""
|
||||
property color borderNormalColor: FluTheme.dark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1)
|
||||
property color bordercheckedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color bordercheckedColor: FluTheme.primaryColor
|
||||
property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
|
||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
property color borderPressedColor: FluTheme.dark ? Qt.rgba(90/255,90/255,90/255,1) : Qt.rgba(191/255,191/255,191/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
property color checkedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color checkedColor: FluTheme.primaryColor
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(72/255,72/255,72/255,1) : Qt.rgba(236/255,236/255,236/255,1)
|
||||
property color checkedHoverColor: FluTheme.dark ? Qt.darker(checkedColor,1.15) : Qt.lighter(checkedColor,1.15)
|
||||
property color checkedPreesedColor: FluTheme.dark ? Qt.darker(checkedColor,1.3) : Qt.lighter(checkedColor,1.3)
|
||||
|
@ -19,7 +19,7 @@ Button{
|
||||
color:"#00000000"
|
||||
border.color: {
|
||||
if(hovered)
|
||||
return FluTheme.primaryColor.light
|
||||
return FluTheme.primaryColor
|
||||
return FluTheme.dark ? Qt.rgba(100/255,100/255,100/255,1) : Qt.rgba(200/255,200/255,200/255,1)
|
||||
}
|
||||
border.width: 1
|
||||
|
@ -45,7 +45,7 @@ T.ComboBox {
|
||||
topPadding: 6 - control.padding
|
||||
bottomPadding: 6 - control.padding
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
selectedTextColor: color
|
||||
text: control.editable ? control.editText : control.displayText
|
||||
enabled: control.editable
|
||||
@ -108,6 +108,7 @@ T.ComboBox {
|
||||
model: control.delegateModel
|
||||
currentIndex: control.highlightedIndex
|
||||
highlightMoveDuration: 0
|
||||
boundsMovement: Flickable.StopAtBounds
|
||||
T.ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
enter: Transition {
|
||||
|
@ -25,9 +25,6 @@ FluPopup {
|
||||
anchors.fill: parent
|
||||
color: 'transparent'
|
||||
radius:5
|
||||
FluShadow{
|
||||
radius: 5
|
||||
}
|
||||
FluText{
|
||||
id:text_title
|
||||
font: FluTextStyle.TitleLarge
|
||||
|
@ -17,7 +17,7 @@ TextEdit {
|
||||
selectByMouse: true
|
||||
selectedTextColor: color
|
||||
bottomPadding: 0
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
font:FluTextStyle.Body
|
||||
onSelectedTextChanged: {
|
||||
control.forceActiveFocus()
|
||||
|
@ -169,11 +169,7 @@ Rectangle {
|
||||
anchors.rightMargin: 5
|
||||
color: {
|
||||
if(getListView().currentIndex === position){
|
||||
if(FluTheme.dark){
|
||||
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor.lighter,1.1) : FluTheme.primaryColor.lighter
|
||||
}else{
|
||||
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor.dark,1.1): FluTheme.primaryColor.dark
|
||||
}
|
||||
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor
|
||||
}
|
||||
if(item_mouse.containsMouse){
|
||||
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
|
||||
@ -236,7 +232,7 @@ Rectangle {
|
||||
preferredHighlightEnd: 0
|
||||
highlightMoveDuration: 0
|
||||
visible: showYear
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property int type:0
|
||||
property int position:index
|
||||
@ -258,7 +254,7 @@ Rectangle {
|
||||
preferredHighlightEnd: 0
|
||||
highlightMoveDuration: 0
|
||||
boundsBehavior:Flickable.StopAtBounds
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property int type:1
|
||||
property int position:index
|
||||
@ -281,7 +277,7 @@ Rectangle {
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
boundsBehavior:Flickable.StopAtBounds
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property int type:2
|
||||
property int position:index
|
||||
|
@ -2,16 +2,26 @@ import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Rectangle {
|
||||
property real spacing
|
||||
property alias separatorHeight:separator.height
|
||||
|
||||
Item {
|
||||
id:control
|
||||
color:Qt.rgba(0,0,0,0)
|
||||
height: spacing*2+separator.height
|
||||
property int orientation: Qt.Horizontal
|
||||
property int spacing:0
|
||||
property int size: 1
|
||||
|
||||
QtObject{
|
||||
id:d
|
||||
property bool isVertical : orientation === Qt.Vertical
|
||||
}
|
||||
|
||||
width: d.isVertical ? spacing*2+size : parent.width
|
||||
height: d.isVertical ? parent.height : spacing*2+size
|
||||
|
||||
FluRectangle{
|
||||
id:separator
|
||||
color: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(210/255,210/255,210/255,1)
|
||||
width:parent.width
|
||||
width: d.isVertical ? size : parent.width
|
||||
height: d.isVertical ? parent.height : size
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
||||
Button {
|
||||
property bool disabled: false
|
||||
property string contentDescription: ""
|
||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color normalColor: FluTheme.primaryColor
|
||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2)
|
||||
|
@ -10,10 +10,10 @@ Button {
|
||||
property bool disabled: false
|
||||
property int radius:4
|
||||
property string contentDescription: ""
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
property color pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||
property color hoverColor: FluTheme.itemHoverColor
|
||||
property color pressedColor: FluTheme.itemPressColor
|
||||
property color normalColor: FluTheme.itemNormalColor
|
||||
property color disableColor: FluTheme.itemNormalColor
|
||||
property Component iconDelegate: com_icon
|
||||
property color color: {
|
||||
if(!enabled){
|
||||
@ -37,6 +37,7 @@ Button {
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
property color textColor: FluTheme.fontPrimaryColor
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: control.text
|
||||
Accessible.description: contentDescription
|
||||
@ -47,6 +48,7 @@ Button {
|
||||
verticalPadding: 8
|
||||
horizontalPadding: 8
|
||||
enabled: !disabled
|
||||
font:FluTextStyle.Caption
|
||||
background: Rectangle{
|
||||
implicitWidth: 30
|
||||
implicitHeight: 30
|
||||
@ -71,7 +73,7 @@ Button {
|
||||
Component{
|
||||
id:com_row
|
||||
RowLayout{
|
||||
Loader{
|
||||
FluLoader{
|
||||
sourceComponent: iconDelegate
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
visible: display !== Button.TextOnly
|
||||
@ -80,13 +82,15 @@ Button {
|
||||
text:control.text
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
visible: display !== Button.IconOnly
|
||||
color: control.textColor
|
||||
font: control.font
|
||||
}
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_column
|
||||
ColumnLayout{
|
||||
Loader{
|
||||
FluLoader{
|
||||
sourceComponent: iconDelegate
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
visible: display !== Button.TextOnly
|
||||
@ -95,10 +99,12 @@ Button {
|
||||
text:control.text
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
visible: display !== Button.IconOnly
|
||||
color: control.textColor
|
||||
font: control.font
|
||||
}
|
||||
}
|
||||
}
|
||||
contentItem:Loader{
|
||||
contentItem:FluLoader{
|
||||
sourceComponent: {
|
||||
if(display === Button.TextUnderIcon){
|
||||
return com_column
|
||||
|
@ -11,7 +11,7 @@ Image {
|
||||
property Component errorItem : com_error
|
||||
property Component loadingItem: com_loading
|
||||
id: control
|
||||
Loader{
|
||||
FluLoader{
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(control.status === Image.Loading){
|
||||
@ -26,7 +26,7 @@ Image {
|
||||
Component{
|
||||
id:com_loading
|
||||
Rectangle{
|
||||
color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
color: FluTheme.itemHoverColor
|
||||
FluProgressRing{
|
||||
anchors.centerIn: parent
|
||||
visible: control.status === Image.Loading
|
||||
@ -36,7 +36,7 @@ Image {
|
||||
Component{
|
||||
id:com_error
|
||||
Rectangle{
|
||||
color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
color: FluTheme.itemHoverColor
|
||||
FluFilledButton{
|
||||
text: control.errorButtonText
|
||||
anchors.centerIn: parent
|
||||
|
@ -86,7 +86,7 @@ FluObject {
|
||||
interval: duration; running: duration > 0; repeat: duration > 0
|
||||
onTriggered: content.close();
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader;
|
||||
x:(parent.width - width) / 2;
|
||||
property var _super: content;
|
||||
@ -170,7 +170,7 @@ FluObject {
|
||||
switch(_super.type){
|
||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
||||
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
|
||||
case mcontrol.const_info: return FluTheme.primaryColor.lighter;
|
||||
case mcontrol.const_info: return FluTheme.primaryColor;
|
||||
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
|
||||
}
|
||||
return "#FFFFFF"
|
||||
@ -213,7 +213,7 @@ FluObject {
|
||||
switch(_super.type){
|
||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
||||
case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1);
|
||||
case mcontrol.const_info: return FluTheme.primaryColor.lighter;
|
||||
case mcontrol.const_info: return FluTheme.primaryColor;
|
||||
case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1);
|
||||
}
|
||||
return "#FFFFFF"
|
||||
|
5
src/Qt5/imports/FluentUI/Controls/FluLoader.qml
Normal file
5
src/Qt5/imports/FluentUI/Controls/FluLoader.qml
Normal file
@ -0,0 +1,5 @@
|
||||
import QtQuick 2.15
|
||||
|
||||
Loader {
|
||||
Component.onDestruction: sourceComponent = undefined
|
||||
}
|
@ -47,23 +47,13 @@ T.MenuBarItem {
|
||||
implicitHeight: 30
|
||||
radius: 3
|
||||
color: {
|
||||
if(FluTheme.dark){
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
if(control.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
if(control.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(control.highlighted){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
if(control.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ T.MenuItem {
|
||||
right: parent.right
|
||||
rightMargin: (control.mirrored ? indicatorPadding : arrowPadding)+5
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_icon
|
||||
sourceComponent: iconDelegate
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@ -98,17 +98,10 @@ T.MenuItem {
|
||||
anchors.margins: 3
|
||||
radius: 4
|
||||
color:{
|
||||
if(FluTheme.dark){
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(control.highlighted){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ TextArea{
|
||||
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
||||
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||
property bool isCtrlEnterForNewline: false
|
||||
id:control
|
||||
enabled: !disabled
|
||||
color: {
|
||||
@ -20,11 +21,11 @@ TextArea{
|
||||
}
|
||||
font:FluTextStyle.Body
|
||||
wrapMode: Text.WrapAnywhere
|
||||
padding: 7
|
||||
padding: 8
|
||||
leftPadding: padding+4
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
selectedTextColor: color
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
placeholderTextColor: {
|
||||
if(!enabled){
|
||||
return placeholderDisableColor
|
||||
@ -35,21 +36,28 @@ TextArea{
|
||||
return placeholderNormalColor
|
||||
}
|
||||
selectByMouse: true
|
||||
width: background.implicitWidth
|
||||
width: 240
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: control
|
||||
implicitWidth: 240
|
||||
}
|
||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||
QtObject{
|
||||
id:d
|
||||
function handleCommit(event){
|
||||
if(event.modifiers & Qt.ControlModifier){
|
||||
if(isCtrlEnterForNewline){
|
||||
if(event.modifiers & Qt.ControlModifier){
|
||||
insert(control.cursorPosition, "\n")
|
||||
return
|
||||
}
|
||||
control.commit(control.text)
|
||||
}else{
|
||||
if(event.modifiers & Qt.ControlModifier){
|
||||
control.commit(control.text)
|
||||
return
|
||||
}
|
||||
insert(control.cursorPosition, "\n")
|
||||
return
|
||||
}
|
||||
control.commit(control.text)
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
|
@ -16,8 +16,11 @@ Item {
|
||||
property int pageMode: FluNavigationViewType.Stack
|
||||
property FluMenu navItemRightMenu
|
||||
property FluMenu navItemExpanderRightMenu
|
||||
property int navCompactWidth: 50
|
||||
property int navTopMargin: 0
|
||||
property int cellHeight: 38
|
||||
property int cellWidth: 300
|
||||
property bool hideNavAppBar: false
|
||||
signal logoClicked
|
||||
id:control
|
||||
Item{
|
||||
@ -120,7 +123,7 @@ Item {
|
||||
}
|
||||
return 1
|
||||
}
|
||||
separatorHeight: {
|
||||
size: {
|
||||
if(!model){
|
||||
return 1
|
||||
}
|
||||
@ -176,6 +179,11 @@ Item {
|
||||
leftMargin: 6
|
||||
rightMargin: 6
|
||||
}
|
||||
FluTooltip {
|
||||
text: model.title
|
||||
visible: item_control.hovered && model.title && d.isCompact
|
||||
delay: 800
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
@ -184,7 +192,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -197,7 +207,7 @@ Item {
|
||||
if(h+y>control.height){
|
||||
y = control.height - h
|
||||
}
|
||||
control_popup.showPopup(Qt.point(50,y),h,model.children)
|
||||
control_popup.showPopup(Qt.point(control.navCompactWidth,y),h,model.children)
|
||||
return
|
||||
}
|
||||
model.isExpand = !model.isExpand
|
||||
@ -237,7 +247,7 @@ Item {
|
||||
width: 3
|
||||
height: 18
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
visible: {
|
||||
if(!model){
|
||||
return false
|
||||
@ -289,25 +299,15 @@ Item {
|
||||
}
|
||||
color: {
|
||||
if(!item_control.enabled){
|
||||
return Qt.rgba(0,0,0,0)
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
if(FluTheme.dark){
|
||||
if((nav_list.currentIndex === _idx)&&type===0){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
if(item_control.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(nav_list.currentIndex === _idx&&type===0){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
if(item_control.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(nav_list.currentIndex === _idx&&type===0){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
if(item_control.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
Component{
|
||||
id:com_icon
|
||||
@ -338,11 +338,11 @@ Item {
|
||||
return true
|
||||
}
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left:parent.left
|
||||
leftMargin: 3
|
||||
verticalCenter: parent.verticalCenter
|
||||
leftMargin: d.isCompactAndNotPanel ? (parent.width - 30)/2 : 3
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
anchors.centerIn: parent
|
||||
sourceComponent: {
|
||||
if(model&&model.iconDelegate){
|
||||
@ -388,7 +388,7 @@ Item {
|
||||
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_edit_loader
|
||||
anchors{
|
||||
top: parent.top
|
||||
@ -404,7 +404,7 @@ Item {
|
||||
return model&&model.showEdit ? model.editDelegate : undefined
|
||||
}
|
||||
onStatusChanged: {
|
||||
if(status === Loader.Ready){
|
||||
if(status === FluLoader.Ready){
|
||||
item.forceActiveFocus()
|
||||
item_connection_edit_focus.target = item
|
||||
}
|
||||
@ -463,10 +463,11 @@ 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
|
||||
FluTooltip {
|
||||
text: model.title
|
||||
visible: item_control.hovered && model.title && d.isCompact
|
||||
delay: 800
|
||||
}
|
||||
onClicked:{
|
||||
if(type === 0){
|
||||
if(model.onTapListener){
|
||||
@ -496,23 +497,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{
|
||||
@ -525,37 +516,21 @@ Item {
|
||||
anchors.fill: parent
|
||||
color: {
|
||||
if(!item_control.enabled){
|
||||
return Qt.rgba(0,0,0,0)
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
if(FluTheme.dark){
|
||||
if(type===0){
|
||||
if(nav_list.currentIndex === _idx){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
}else{
|
||||
if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
if(type===0){
|
||||
if(nav_list.currentIndex === _idx){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
if(item_control.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(type===0){
|
||||
if(nav_list.currentIndex === _idx){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
}else{
|
||||
if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
if(item_control.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}
|
||||
if(item_control.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
Component{
|
||||
id:com_icon
|
||||
@ -586,11 +561,11 @@ Item {
|
||||
return true
|
||||
}
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left:parent.left
|
||||
leftMargin: 3
|
||||
verticalCenter: parent.verticalCenter
|
||||
leftMargin: d.isCompactAndNotPanel ? (parent.width - 30)/2 : 3
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
anchors.centerIn: parent
|
||||
sourceComponent: {
|
||||
if(model&&model.iconDelegate){
|
||||
@ -636,7 +611,7 @@ Item {
|
||||
right: item_dot_loader.left
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_edit_loader
|
||||
anchors{
|
||||
top: parent.top
|
||||
@ -655,7 +630,7 @@ Item {
|
||||
return model.showEdit ? model.editDelegate : undefined
|
||||
}
|
||||
onStatusChanged: {
|
||||
if(status === Loader.Ready){
|
||||
if(status === FluLoader.Ready){
|
||||
item.forceActiveFocus()
|
||||
item_connection_edit_focus.target = item
|
||||
}
|
||||
@ -674,7 +649,7 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_dot_loader
|
||||
property bool isDot: (item_dot_loader.item&&item_dot_loader.item.isDot)
|
||||
anchors{
|
||||
@ -705,11 +680,12 @@ Item {
|
||||
Item {
|
||||
id:nav_app_bar
|
||||
width: parent.width
|
||||
height: 40
|
||||
height: visible ? 40 : 0
|
||||
anchors{
|
||||
top: parent.top
|
||||
topMargin: control.topPadding
|
||||
}
|
||||
visible: !control.hideNavAppBar
|
||||
z:999
|
||||
RowLayout{
|
||||
height:parent.height
|
||||
@ -818,7 +794,7 @@ Item {
|
||||
}
|
||||
return 0
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_action
|
||||
anchors.centerIn: parent
|
||||
sourceComponent: actionItem
|
||||
@ -860,16 +836,7 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
DropArea{
|
||||
anchors.fill: loader_content
|
||||
onDropped:
|
||||
(drag)=>{
|
||||
if(drag.source.modelData){
|
||||
drag.source.modelData.dropped(drag)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_content
|
||||
anchors{
|
||||
left: parent.left
|
||||
@ -881,7 +848,7 @@ Item {
|
||||
return 0
|
||||
}
|
||||
if(d.isCompact){
|
||||
return 50
|
||||
return control.navCompactWidth
|
||||
}
|
||||
return control.cellWidth
|
||||
}
|
||||
@ -909,12 +876,13 @@ Item {
|
||||
id:layout_list
|
||||
width: {
|
||||
if(d.isCompactAndNotPanel){
|
||||
return 50
|
||||
return control.navCompactWidth
|
||||
}
|
||||
return control.cellWidth
|
||||
}
|
||||
anchors{
|
||||
top: parent.top
|
||||
topMargin: control.navTopMargin
|
||||
bottom: parent.bottom
|
||||
}
|
||||
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
||||
@ -955,7 +923,7 @@ Item {
|
||||
clip: true
|
||||
y:nav_app_bar.height+control.topPadding
|
||||
height: autoSuggestBox ? 38 : 0
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_auto_suggest_box
|
||||
sourceComponent: autoSuggestBox
|
||||
anchors{
|
||||
@ -974,13 +942,13 @@ Item {
|
||||
}
|
||||
FluIconButton{
|
||||
visible:d.isCompactAndNotPanel
|
||||
hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||
width:38
|
||||
height:34
|
||||
x:6
|
||||
y:2
|
||||
anchors{
|
||||
fill: parent
|
||||
leftMargin: 6
|
||||
rightMargin: 6
|
||||
topMargin: 2
|
||||
bottomMargin: 2
|
||||
}
|
||||
iconSize: 15
|
||||
iconSource: {
|
||||
if(loader_auto_suggest_box.item){
|
||||
@ -1025,7 +993,7 @@ Item {
|
||||
Rectangle{
|
||||
height: 18
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
width: 3
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -1035,7 +1003,7 @@ Item {
|
||||
}
|
||||
}
|
||||
currentIndex: -1
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property var _idx: index
|
||||
property int type: 0
|
||||
@ -1083,7 +1051,7 @@ Item {
|
||||
Rectangle{
|
||||
height: 18
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
width: 3
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -1092,7 +1060,7 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property var _idx: index
|
||||
property int type: 1
|
||||
@ -1138,6 +1106,7 @@ Item {
|
||||
clip: true
|
||||
currentIndex: -1
|
||||
model: control_popup.childModel
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
delegate:Button{
|
||||
id:item_button
|
||||
@ -1146,24 +1115,17 @@ Item {
|
||||
focusPolicy:Qt.TabFocus
|
||||
background: Rectangle{
|
||||
color: {
|
||||
if(FluTheme.dark){
|
||||
if(item_button.hovered){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(item_button.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(item_button.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
FluFocusRectangle{
|
||||
visible: item_button.activeFocus
|
||||
radius:4
|
||||
}
|
||||
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_dot_loader
|
||||
anchors{
|
||||
right: parent.right
|
||||
@ -1220,9 +1182,18 @@ Item {
|
||||
control_popup.open()
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
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)
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ TextField{
|
||||
leftPadding: padding+4
|
||||
echoMode:btn_reveal.pressed ? TextField.Normal : TextField.Password
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
selectedTextColor: color
|
||||
placeholderTextColor: {
|
||||
if(!enabled){
|
||||
@ -37,9 +37,9 @@ TextField{
|
||||
return placeholderNormalColor
|
||||
}
|
||||
selectByMouse: true
|
||||
width: 240
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: control
|
||||
implicitWidth: 240
|
||||
}
|
||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||
|
@ -36,7 +36,7 @@ Page {
|
||||
Rectangle{
|
||||
height: 3
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
width: nav_list.currentItem ? nav_list.currentItem.width : 0
|
||||
y:d.tabY
|
||||
Behavior on width {
|
||||
@ -84,7 +84,7 @@ Page {
|
||||
anchors.fill: parent
|
||||
Repeater{
|
||||
model:d.children
|
||||
Loader{
|
||||
FluLoader{
|
||||
property var argument: modelData.argument
|
||||
anchors.fill: parent
|
||||
sourceComponent: modelData.contentItem
|
||||
|
@ -11,13 +11,6 @@ Popup {
|
||||
anchors.centerIn: Overlay.overlay
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
enter: Transition {
|
||||
NumberAnimation {
|
||||
properties: "scale"
|
||||
from:1.2
|
||||
to:1
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
NumberAnimation {
|
||||
property: "opacity"
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
@ -26,13 +19,6 @@ Popup {
|
||||
}
|
||||
}
|
||||
exit:Transition {
|
||||
NumberAnimation {
|
||||
properties: "scale"
|
||||
from:1
|
||||
to:1.2
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
NumberAnimation {
|
||||
property: "opacity"
|
||||
duration: FluTheme.enableAnimation ? 83 : 0
|
||||
@ -43,5 +29,8 @@ Popup {
|
||||
background: FluRectangle{
|
||||
radius: [5,5,5,5]
|
||||
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
|
||||
FluShadow{
|
||||
radius: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import FluentUI 1.0
|
||||
ProgressBar{
|
||||
property real strokeWidth: 6
|
||||
property bool progressVisible: false
|
||||
property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color color: FluTheme.primaryColor
|
||||
property color backgroundColor : FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
|
||||
id:control
|
||||
indeterminate : true
|
||||
|
@ -12,7 +12,7 @@ Button {
|
||||
}
|
||||
property color normalColor: {
|
||||
if(d.checked){
|
||||
return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
return FluTheme.primaryColor
|
||||
}else{
|
||||
return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
}
|
||||
@ -66,7 +66,7 @@ Button {
|
||||
width: parent.width * control.progress
|
||||
height: control.progress === 1 ? background.height : 3
|
||||
visible: !d.checked
|
||||
color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
anchors.bottom: parent.bottom
|
||||
Behavior on height{
|
||||
enabled: control.progress !== 1
|
||||
|
@ -6,7 +6,7 @@ import FluentUI 1.0
|
||||
ProgressBar{
|
||||
property real strokeWidth: 6
|
||||
property bool progressVisible: false
|
||||
property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color color: FluTheme.primaryColor
|
||||
property color backgroundColor : FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
|
||||
id:control
|
||||
indeterminate : true
|
||||
|
@ -6,7 +6,7 @@ import FluentUI 1.0
|
||||
Button {
|
||||
property string contentDescription: ""
|
||||
property bool disabled: false
|
||||
property color borderNormalColor: checked ? FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||
property color borderNormalColor: checked ? FluTheme.primaryColor : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(198/255,198/255,198/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1)
|
||||
property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1)
|
||||
|
@ -41,7 +41,7 @@ T.RangeSlider {
|
||||
}
|
||||
return control.first.hovered ? 1.2 : 1
|
||||
}
|
||||
iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
iconColor: FluTheme.primaryColor
|
||||
anchors.centerIn: parent
|
||||
Behavior on scale{
|
||||
NumberAnimation{
|
||||
@ -72,7 +72,7 @@ T.RangeSlider {
|
||||
}
|
||||
return control.second.hovered ? 1.2 : 1
|
||||
}
|
||||
iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
iconColor: FluTheme.primaryColor
|
||||
anchors.centerIn: parent
|
||||
Behavior on scale{
|
||||
NumberAnimation{
|
||||
@ -101,7 +101,7 @@ T.RangeSlider {
|
||||
y: control.horizontal ? 0 : control.second.visualPosition * parent.height + 3
|
||||
width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6
|
||||
height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6
|
||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
}
|
||||
FluTooltip{
|
||||
|
@ -32,7 +32,7 @@ Item {
|
||||
}
|
||||
iconSize: control.size
|
||||
iconSource: isSelected ? FluentIcons.FavoriteStarFill : FluentIcons.FavoriteStar
|
||||
iconColor: isSelected ? FluTheme.primaryColor.dark : (FluTheme.dark ? "#FFFFFF" : "#000000")
|
||||
iconColor: isSelected ? FluTheme.primaryColor : (FluTheme.dark ? "#FFFFFF" : "#000000")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ FluStatusView {
|
||||
loader.source = control.source
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader
|
||||
anchors.fill: parent
|
||||
asynchronous: true
|
||||
|
@ -11,7 +11,7 @@ Item{
|
||||
property int dotSize: 5
|
||||
property int borderSize: 1
|
||||
property var saveFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
|
||||
property color borderColor: FluTheme.primaryColor.dark
|
||||
property color borderColor: FluTheme.primaryColor
|
||||
signal captrueCompleted(var captrue)
|
||||
QtObject{
|
||||
id:d
|
||||
@ -508,7 +508,7 @@ Item{
|
||||
}
|
||||
FluIconButton{
|
||||
iconSource: FluentIcons.AcceptMedium
|
||||
iconColor: FluTheme.primaryColor.dark
|
||||
iconColor: FluTheme.primaryColor
|
||||
onClicked: {
|
||||
screenshot_background.capture(screenshot.start,screenshot.end)
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ T.Slider {
|
||||
}
|
||||
return control.hovered ? 1.2 : 1
|
||||
}
|
||||
iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
iconColor: FluTheme.primaryColor
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
@ -62,7 +62,7 @@ T.Slider {
|
||||
width: control.horizontal ? control.position * parent.width : 6
|
||||
height: control.horizontal ? 6 : control.position * parent.height
|
||||
radius: 3
|
||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
}
|
||||
FluTooltip{
|
||||
|
@ -39,7 +39,7 @@ T.SpinBox {
|
||||
}
|
||||
return normalColor
|
||||
}
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
selectedTextColor: color
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
@ -52,10 +52,13 @@ T.SpinBox {
|
||||
anchors.bottom: parent.bottom
|
||||
visible: contentItem.enabled
|
||||
color: {
|
||||
if(contentItem.activeFocus){
|
||||
return FluTheme.primaryColor
|
||||
}
|
||||
if(FluTheme.dark){
|
||||
contentItem.activeFocus ? FluTheme.primaryColor.lighter : Qt.rgba(166/255,166/255,166/255,1)
|
||||
return Qt.rgba(166/255,166/255,166/255,1)
|
||||
}else{
|
||||
return contentItem.activeFocus ? FluTheme.primaryColor.dark : Qt.rgba(183/255,183/255,183/255,1)
|
||||
return Qt.rgba(183/255,183/255,183/255,1)
|
||||
}
|
||||
}
|
||||
Behavior on height{
|
||||
|
@ -23,7 +23,7 @@ Item{
|
||||
anchors.fill: parent
|
||||
visible: statusMode===FluStatusViewType.Success
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader
|
||||
anchors.fill: parent
|
||||
visible: statusMode!==FluStatusViewType.Success
|
||||
|
@ -189,23 +189,13 @@ Item {
|
||||
anchors.fill: parent
|
||||
radius: [6,6,0,0]
|
||||
color: {
|
||||
if(FluTheme.dark){
|
||||
if(item_mouse_hove.containsMouse || item_btn_close.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
if(tab_nav.currentIndex === index){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(item_mouse_hove.containsMouse || item_btn_close.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
if(tab_nav.currentIndex === index){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(item_mouse_hove.containsMouse || item_btn_close.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
if(tab_nav.currentIndex === index){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
}
|
||||
RowLayout{
|
||||
@ -264,6 +254,7 @@ Item {
|
||||
FluDivider{
|
||||
width: 1
|
||||
height: 16
|
||||
orientation: Qt.Vertical
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
@ -283,7 +274,7 @@ Item {
|
||||
}
|
||||
Repeater{
|
||||
model:tab_model
|
||||
Loader{
|
||||
FluLoader{
|
||||
property var argument: model.argument
|
||||
anchors.fill: parent
|
||||
sourceComponent: model.page
|
||||
|
@ -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
|
||||
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
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
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
|
||||
}
|
||||
FluLoader{
|
||||
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 {
|
||||
@ -347,16 +393,40 @@ Rectangle {
|
||||
property bool canceled: false
|
||||
property int columnIndex: column
|
||||
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)
|
||||
implicitWidth: {
|
||||
return (item_column_loader.item && item_column_loader.item.implicitWidth) + (cellPadding * 2)
|
||||
}
|
||||
implicitHeight: Math.max(36, (item_column_loader.item&&item_column_loader.item.implicitHeight) + (cellPadding * 2))
|
||||
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,10 +443,9 @@ Rectangle {
|
||||
onClicked:
|
||||
(event)=>{
|
||||
closeEditor()
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_column_loader
|
||||
property var itemModel: model
|
||||
property var modelData: model.display
|
||||
@ -463,8 +532,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 +548,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 +601,6 @@ Rectangle {
|
||||
onClicked:
|
||||
(event)=>{
|
||||
closeEditor()
|
||||
d.selectionFlag = !d.selectionFlag
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
|
@ -3,7 +3,7 @@ import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Text {
|
||||
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||
property color textColor: FluTheme.fontPrimaryColor
|
||||
id:text
|
||||
color: textColor
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
|
@ -25,7 +25,7 @@ TextField{
|
||||
}
|
||||
font:FluTextStyle.Body
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
selectedTextColor: color
|
||||
placeholderTextColor: {
|
||||
if(!enabled){
|
||||
@ -37,10 +37,18 @@ 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
|
||||
}
|
||||
width: 240
|
||||
background: FluTextBoxBackground{
|
||||
inputItem: control
|
||||
implicitWidth: 240
|
||||
}
|
||||
Keys.onEnterPressed: (event)=> d.handleCommit(event)
|
||||
Keys.onReturnPressed:(event)=> d.handleCommit(event)
|
||||
|
@ -36,10 +36,13 @@ FluClip{
|
||||
anchors.bottom: parent.bottom
|
||||
visible: !inputItem.disabled
|
||||
color: {
|
||||
if(inputItem.activeFocus){
|
||||
return FluTheme.primaryColor
|
||||
}
|
||||
if(FluTheme.dark){
|
||||
return inputItem.activeFocus ? FluTheme.primaryColor.lighter : Qt.rgba(166/255,166/255,166/255,1)
|
||||
return Qt.rgba(166/255,166/255,166/255,1)
|
||||
}else{
|
||||
return inputItem.activeFocus ? FluTheme.primaryColor.dark : Qt.rgba(134/255,134/255,134/255,1)
|
||||
return Qt.rgba(134/255,134/255,134/255,1)
|
||||
}
|
||||
}
|
||||
Behavior on height{
|
||||
|
@ -5,14 +5,14 @@ import FluentUI 1.0
|
||||
Button {
|
||||
property bool disabled: false
|
||||
property string contentDescription: ""
|
||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color normalColor: FluTheme.primaryColor
|
||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.15) : Qt.lighter(normalColor,1.15)
|
||||
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.3) : Qt.lighter(normalColor,1.3)
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
property color backgroundHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
property color backgroundPressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
property color backgroundNormalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||
property color backgroundDisableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||
property color backgroundHoverColor: FluTheme.itemHoverColor
|
||||
property color backgroundPressedColor: FluTheme.itemPressColor
|
||||
property color backgroundNormalColor: FluTheme.itemNormalColor
|
||||
property color backgroundDisableColor: FluTheme.itemNormalColor
|
||||
property bool textBold: true
|
||||
property color textColor: {
|
||||
if(!enabled){
|
||||
|
@ -184,11 +184,7 @@ Rectangle {
|
||||
anchors.rightMargin: 5
|
||||
color: {
|
||||
if(getListView().currentIndex === position){
|
||||
if(FluTheme.dark){
|
||||
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor.lighter,1.1) : FluTheme.primaryColor.lighter
|
||||
}else{
|
||||
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor.dark,1.1): FluTheme.primaryColor.dark
|
||||
}
|
||||
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor
|
||||
}
|
||||
if(item_mouse.containsMouse){
|
||||
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
|
||||
@ -242,7 +238,7 @@ Rectangle {
|
||||
highlightMoveDuration: 0
|
||||
model: isH ? generateArray(1,12) : generateArray(0,23)
|
||||
clip: true
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property int type:0
|
||||
property int position:index
|
||||
@ -265,7 +261,7 @@ Rectangle {
|
||||
highlightMoveDuration: 0
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
boundsBehavior:Flickable.StopAtBounds
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property int type:1
|
||||
property int position:index
|
||||
@ -291,7 +287,7 @@ Rectangle {
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
boundsBehavior:Flickable.StopAtBounds
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var model: modelData
|
||||
property int type:2
|
||||
property int position:index
|
||||
|
@ -82,7 +82,7 @@ Item{
|
||||
radius: 8
|
||||
border.width: 4
|
||||
color:FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||
border.color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
border.color: FluTheme.primaryColor
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ Item{
|
||||
wrapMode: Text.WrapAnywhere
|
||||
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
|
||||
text: modelData.lable
|
||||
color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ Item{
|
||||
id:item_layout
|
||||
width: layout_column.width
|
||||
height: loader_text.height
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_loader
|
||||
state: d.stateName
|
||||
states: [
|
||||
@ -149,7 +149,7 @@ Item{
|
||||
}
|
||||
}
|
||||
|
||||
Loader{
|
||||
FluLoader{
|
||||
property var modelData: control.model.get(index)
|
||||
property bool isRight: state === "Right"
|
||||
id:loader_lable
|
||||
@ -219,7 +219,7 @@ Item{
|
||||
]
|
||||
}
|
||||
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_text
|
||||
property var modelData: control.model.get(index)
|
||||
property bool isRight: state === "Right"
|
||||
|
@ -7,7 +7,7 @@ Button {
|
||||
property string contentDescription: ""
|
||||
property color normalColor: {
|
||||
if(checked){
|
||||
return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
return FluTheme.primaryColor
|
||||
}else{
|
||||
return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
}
|
||||
|
@ -7,11 +7,11 @@ Button {
|
||||
property bool disabled: false
|
||||
property string contentDescription: ""
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(233/255,233/255,233/255,1)
|
||||
property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color checkColor: FluTheme.primaryColor
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||
property color borderNormalColor: FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||
property color borderCheckColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color borderCheckColor: FluTheme.primaryColor
|
||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(200/255,200/255,200/255,1)
|
||||
property color dotNormalColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1)
|
||||
property color dotCheckColor: FluTheme.dark ? Qt.rgba(0/255,0/255,0/255,1) : Qt.rgba(255/255,255/255,255/255,1)
|
||||
@ -46,8 +46,8 @@ Button {
|
||||
layoutDirection:control.textRight ? Qt.LeftToRight : Qt.RightToLeft
|
||||
Rectangle {
|
||||
id:control_backgound
|
||||
width: background.width
|
||||
height: background.height
|
||||
implicitWidth: background.implicitWidth
|
||||
implicitHeight: background.implicitHeight
|
||||
radius: height / 2
|
||||
FluFocusRectangle{
|
||||
visible: control.activeFocus
|
||||
|
@ -155,7 +155,7 @@ Popup{
|
||||
leftMargin: 15
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_next
|
||||
property bool isEnd: control.index === steps.length-1
|
||||
sourceComponent: com_next_button
|
||||
@ -166,7 +166,7 @@ Popup{
|
||||
rightMargin: 15
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_prev
|
||||
visible: control.index !== 0
|
||||
sourceComponent: com_prev_button
|
||||
|
@ -22,7 +22,7 @@ Item {
|
||||
property int dropIndex: -1
|
||||
property bool isDropTopArea: false
|
||||
property int dragIndex: -1
|
||||
property color hitColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color hitColor: FluTheme.primaryColor
|
||||
}
|
||||
onDataSourceChanged: {
|
||||
tree_model.setDataSource(dataSource)
|
||||
@ -86,7 +86,7 @@ Item {
|
||||
ListView.onPooled: {
|
||||
item_loader_container.item.pooled()
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
property var itemControl: item_control
|
||||
property var itemModel: dataModel
|
||||
property int rowIndex: index
|
||||
@ -95,7 +95,7 @@ Item {
|
||||
sourceComponent: com_item_container
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:loader_container
|
||||
property var itemControl
|
||||
property var itemModel
|
||||
@ -138,7 +138,7 @@ Item {
|
||||
width: 3
|
||||
height: 18
|
||||
radius: 1.5
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
visible: isCurrent
|
||||
anchors{
|
||||
left: parent.left
|
||||
@ -322,29 +322,16 @@ Item {
|
||||
border.color: d.hitColor
|
||||
border.width: d.dragIndex === rowIndex ? 1 : 0
|
||||
color: {
|
||||
if(FluTheme.dark){
|
||||
if(isCurrent){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
if(item_mouse.containsMouse || item_check_box.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
if(item_loader_expand.item && item_loader_expand.item.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(isCurrent){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
if(item_mouse.containsMouse || item_check_box.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
if(item_loader_expand.item && item_loader_expand.item.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
if(isCurrent){
|
||||
return FluTheme.itemCheckColor
|
||||
}
|
||||
if(item_mouse.containsMouse || item_check_box.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
if(item_loader_expand.item && item_loader_expand.item.hovered){
|
||||
return FluTheme.itemHoverColor
|
||||
}
|
||||
return FluTheme.itemNormalColor
|
||||
}
|
||||
}
|
||||
RowLayout{
|
||||
@ -370,7 +357,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Loader{
|
||||
FluLoader{
|
||||
id:item_loader_expand
|
||||
Layout.preferredWidth: 20
|
||||
Layout.preferredHeight: 20
|
||||
@ -394,7 +381,7 @@ Item {
|
||||
}
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
property var dataModel: itemModel
|
||||
property var itemMouse: item_mouse
|
||||
id:item_loader_cell
|
||||
|
@ -16,12 +16,18 @@ Window {
|
||||
property var appBar: com_app_bar
|
||||
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.windowActiveBackgroundColor
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(237/255,237/255,237/255,1)
|
||||
return FluTheme.windowBackgroundColor
|
||||
}
|
||||
property bool stayTop: false
|
||||
property var _pageRegister
|
||||
property string _route
|
||||
property bool showDark: false
|
||||
property bool showClose: true
|
||||
property bool showMinimize: true
|
||||
property bool showMaximize: true
|
||||
property bool showStayTop: true
|
||||
property var closeListener: function(event){
|
||||
if(closeDestory){
|
||||
destoryOnClose()
|
||||
@ -33,9 +39,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 +53,25 @@ Window {
|
||||
onVisibleChanged: {
|
||||
lifecycle.onVisible(visible)
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
function changedStayTop(){
|
||||
function toggleStayTop(){
|
||||
if(window.stayTop){
|
||||
window.flags = window.flags | Qt.WindowStaysOnTopHint
|
||||
}else{
|
||||
window.flags = window.flags &~ Qt.WindowStaysOnTopHint
|
||||
}
|
||||
}
|
||||
if(window.visibility === Window.Maximized){
|
||||
window.visibility = Window.Windowed
|
||||
toggleStayTop()
|
||||
window.visibility = Window.Maximized
|
||||
}else{
|
||||
toggleStayTop()
|
||||
}
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
target: window
|
||||
function onClosing(event){closeListener(event)}
|
||||
@ -57,13 +86,18 @@ Window {
|
||||
id:com_app_bar
|
||||
FluAppBar {
|
||||
title: window.title
|
||||
showDark: window.showDark
|
||||
showClose: window.showClose
|
||||
showMinimize: window.showMinimize
|
||||
showMaximize: window.showMaximize
|
||||
showStayTop: window.showStayTop
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
anchors.fill: parent
|
||||
sourceComponent: background
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
id: loader_title_bar
|
||||
anchors {
|
||||
top: parent.top
|
||||
@ -82,7 +116,7 @@ Window {
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
property string loadingText: "加载中..."
|
||||
property bool cancel: false
|
||||
id:loader_loading
|
||||
@ -92,7 +126,6 @@ Window {
|
||||
id:com_loading
|
||||
Popup{
|
||||
id:popup_loading
|
||||
modal:true
|
||||
focus: true
|
||||
width: window.width
|
||||
height: window.height
|
||||
@ -167,6 +200,7 @@ Window {
|
||||
FramelessHelper{
|
||||
id:framless_helper
|
||||
onReady: {
|
||||
flags = flags | Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||
if(appBar){
|
||||
var title_bar = loader_title_bar.item
|
||||
setTitleBarItem(title_bar)
|
||||
@ -174,6 +208,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 +220,22 @@ Window {
|
||||
WindowLifecycle{
|
||||
id:lifecycle
|
||||
}
|
||||
WindowBorder{
|
||||
z:999
|
||||
visible: !FluTools.isLinux()
|
||||
}
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
color: "#00000000"
|
||||
border.width: 1
|
||||
visible: FluTools.isLinux()
|
||||
border.color: {
|
||||
if(window.active){
|
||||
return "#333333"
|
||||
}
|
||||
return "#999999"
|
||||
}
|
||||
}
|
||||
function destoryOnClose(){
|
||||
lifecycle.onDestoryOnClose()
|
||||
}
|
||||
|
@ -95,4 +95,5 @@ FluStaggeredView 1.0 Controls/FluStaggeredView.qml
|
||||
FluProgressButton 1.0 Controls/FluProgressButton.qml
|
||||
FluLoadingButton 1.0 Controls/FluLoadingButton.qml
|
||||
FluClip 1.0 Controls/FluClip.qml
|
||||
FluLoader 1.0 Controls/FluLoader.qml
|
||||
plugin fluentuiplugin
|
||||
|
@ -95,5 +95,6 @@
|
||||
<file>FluentUI/Controls/ColorPicker/Content/SBPicker.qml</file>
|
||||
<file>FluentUI/Controls/FluLoadingButton.qml</file>
|
||||
<file>FluentUI/Controls/FluClip.qml</file>
|
||||
<file>FluentUI/Controls/FluLoader.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -11,13 +11,15 @@ 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)
|
||||
property color minimizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
property color maximizeNormalColor: Qt.rgba(0,0,0,0)
|
||||
property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03)
|
||||
property color maximizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)
|
||||
property color minimizeNormalColor: FluTheme.itemNormalColor
|
||||
property color minimizeHoverColor: FluTheme.itemHoverColor
|
||||
property color minimizePressColor: FluTheme.itemPressColor
|
||||
property color maximizeNormalColor: FluTheme.itemNormalColor
|
||||
property color maximizeHoverColor: FluTheme.itemHoverColor
|
||||
property color maximizePressColor: FluTheme.itemPressColor
|
||||
property color closeNormalColor: Qt.rgba(0,0,0,0)
|
||||
property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1)
|
||||
property color closePressColor: Qt.rgba(251/255,115/255,115/255,0.8)
|
||||
@ -25,11 +27,12 @@ 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
|
||||
property bool isMac: FluTools.isMacos()
|
||||
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color borerlessColor : FluTheme.primaryColor
|
||||
property var maxClickListener : function(){
|
||||
if (d.win.visibility === Window.Maximized)
|
||||
d.win.visibility = Window.Windowed
|
||||
@ -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.primaryColor : 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{
|
||||
|
@ -65,7 +65,7 @@ Item {
|
||||
height: 50
|
||||
radius: 25
|
||||
visible: isYear
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
FluText{
|
||||
text:date.getFullYear()
|
||||
@ -124,7 +124,7 @@ Item {
|
||||
height: 50
|
||||
radius: 25
|
||||
visible: isMonth
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
FluText{
|
||||
text:(date.getMonth()+1)+"月"
|
||||
@ -184,7 +184,7 @@ Item {
|
||||
radius: 18
|
||||
color:"#00000000"
|
||||
visible: isDay
|
||||
border.color: FluTheme.primaryColor.dark
|
||||
border.color: FluTheme.primaryColor
|
||||
border.width: 1
|
||||
}
|
||||
Rectangle{
|
||||
@ -194,7 +194,7 @@ Item {
|
||||
height: 30
|
||||
radius: 15
|
||||
visible: isToDay
|
||||
color: FluTheme.primaryColor.dark
|
||||
color: FluTheme.primaryColor
|
||||
}
|
||||
FluText{
|
||||
text:date.getDate()
|
||||
@ -331,7 +331,7 @@ Item {
|
||||
cellWidth: displayMode === FluCalendarViewType.Month ? 40 : 70
|
||||
clip: true
|
||||
boundsBehavior:Flickable.StopAtBounds
|
||||
delegate: Loader{
|
||||
delegate: FluLoader{
|
||||
property var modelData : model
|
||||
property var name : model.name
|
||||
property var date : model.date
|
||||
|
@ -75,7 +75,7 @@ Item {
|
||||
return 0
|
||||
return index-1
|
||||
}
|
||||
Loader{
|
||||
FluLoader{
|
||||
property int displayIndex : item_control.displayIndex
|
||||
property var model: list_view.model.get(index)
|
||||
anchors.fill: parent
|
||||
@ -124,9 +124,9 @@ Item {
|
||||
radius: 4
|
||||
}
|
||||
scale: checked ? 1.2 : 1
|
||||
color: checked ? FluTheme.primaryColor.dark : Qt.rgba(1,1,1,0.7)
|
||||
color: checked ? FluTheme.primaryColor : Qt.rgba(1,1,1,0.7)
|
||||
border.width: mouse_item.containsMouse ? 1 : 0
|
||||
border.color: FluTheme.primaryColor.dark
|
||||
border.color: FluTheme.primaryColor
|
||||
MouseArea{
|
||||
id:mouse_item
|
||||
hoverEnabled: true
|
||||
@ -156,7 +156,7 @@ Item {
|
||||
Repeater{
|
||||
id:repeater_indicator
|
||||
model: list_view.count
|
||||
Loader{
|
||||
FluLoader{
|
||||
property int displayIndex: {
|
||||
if(index === 0)
|
||||
return list_view.count-3
|
||||
|
@ -1,6 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
||||
@ -8,12 +7,12 @@ Button {
|
||||
property bool disabled: false
|
||||
property string contentDescription: ""
|
||||
property color borderNormalColor: FluTheme.dark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1)
|
||||
property color bordercheckedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color bordercheckedColor: FluTheme.primaryColor
|
||||
property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
|
||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
property color borderPressedColor: FluTheme.dark ? Qt.rgba(90/255,90/255,90/255,1) : Qt.rgba(191/255,191/255,191/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
property color checkedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color checkedColor: FluTheme.primaryColor
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(72/255,72/255,72/255,1) : Qt.rgba(236/255,236/255,236/255,1)
|
||||
property color checkedHoverColor: FluTheme.dark ? Qt.darker(checkedColor,1.15) : Qt.lighter(checkedColor,1.15)
|
||||
property color checkedPreesedColor: FluTheme.dark ? Qt.darker(checkedColor,1.3) : Qt.lighter(checkedColor,1.3)
|
||||
@ -31,6 +30,11 @@ Button {
|
||||
id:control
|
||||
enabled: !disabled
|
||||
onClicked: clickListener()
|
||||
onCheckableChanged: {
|
||||
if(checkable){
|
||||
checkable = false
|
||||
}
|
||||
}
|
||||
background: Item{
|
||||
FluFocusRectangle{
|
||||
radius: 4
|
||||
|
@ -1,6 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
@ -20,7 +19,7 @@ Button{
|
||||
color:"#00000000"
|
||||
border.color: {
|
||||
if(hovered)
|
||||
return FluTheme.primaryColor.light
|
||||
return FluTheme.primaryColor
|
||||
return FluTheme.dark ? Qt.rgba(100/255,100/255,100/255,1) : Qt.rgba(200/255,200/255,200/255,1)
|
||||
}
|
||||
border.width: 1
|
||||
@ -31,6 +30,7 @@ Button{
|
||||
radius: 5
|
||||
color: control.colorValue
|
||||
}
|
||||
|
||||
}
|
||||
Item{
|
||||
id: d
|
||||
|
@ -45,7 +45,7 @@ T.ComboBox {
|
||||
topPadding: 6 - control.padding
|
||||
bottomPadding: 6 - control.padding
|
||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||
selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
|
||||
selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.5)
|
||||
selectedTextColor: color
|
||||
text: control.editable ? control.editText : control.displayText
|
||||
enabled: control.editable
|
||||
@ -108,6 +108,7 @@ T.ComboBox {
|
||||
model: control.delegateModel
|
||||
currentIndex: control.highlightedIndex
|
||||
highlightMoveDuration: 0
|
||||
boundsMovement: Flickable.StopAtBounds
|
||||
T.ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
enter: Transition {
|
||||
|
@ -25,9 +25,6 @@ FluPopup {
|
||||
anchors.fill: parent
|
||||
color: 'transparent'
|
||||
radius:5
|
||||
FluShadow{
|
||||
radius: 5
|
||||
}
|
||||
FluText{
|
||||
id:text_title
|
||||
font: FluTextStyle.TitleLarge
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user