Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
09e87e0fb8 | |||
0603a7603d | |||
d9a4f01e20 | |||
93709cd1dd | |||
0000e557a7 | |||
d2183e350e | |||
47caf4bb52 | |||
6fb9ee41fb | |||
b349c22434 | |||
12fa3487bb | |||
a76806645a | |||
738db25c2c | |||
9f8a5f5646 | |||
c59c07e756 | |||
2084b5afa3 | |||
f8d717f41b | |||
be58fc5e7d | |||
1c0bc7208a | |||
d89aaec062 | |||
13abd275b4 | |||
e8460c2409 | |||
6de1b9d78f | |||
64fa2b6370 | |||
8970a0c09a | |||
e7cea72825 | |||
93186edfbe | |||
e60883bc60 |
2
.github/workflows/ubuntu.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
- name: ubuntu install GL library
|
- name: ubuntu install GL library
|
||||||
run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2
|
run: sudo apt-get install -y libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
2
.github/workflows/windows-mingw.yml
vendored
@ -71,6 +71,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: ${{ steps.package.outputs.packageName }}.zip
|
file: ${{ steps.package.outputs.packageName }}.zip
|
||||||
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.zip
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
2
.github/workflows/windows.yml
vendored
@ -87,6 +87,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: ${{ steps.package.outputs.packageName }}.zip
|
file: ${{ steps.package.outputs.packageName }}.zip
|
||||||
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.zip
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
18
README.md
@ -62,6 +62,12 @@
|
|||||||
|FluDatePicker|日期选择器||
|
|FluDatePicker|日期选择器||
|
||||||
|FluMenu|菜单Popup||
|
|FluMenu|菜单Popup||
|
||||||
|FluNavigationView|响应式导航布局||
|
|FluNavigationView|响应式导航布局||
|
||||||
|
|FluScrollbar|滚动条||
|
||||||
|
|FluToggleButton|开关按钮||
|
||||||
|
|FluPagination|分页组件||
|
||||||
|
|FluTableView|表格组件||
|
||||||
|
|FluMediaPlayer|播放器||
|
||||||
|
|FluFlipView|FlipView||
|
||||||
|
|
||||||
# 部分效果预览
|
# 部分效果预览
|
||||||
|
|
||||||
@ -77,6 +83,10 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## TableView表格组件
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## FluTreeView树组件
|
## FluTreeView树组件
|
||||||
|
|
||||||

|

|
||||||
@ -85,13 +95,5 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## InfoBar提示框组件
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 多窗口路由跳转
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### ⚡ Visitor count
|
### ⚡ Visitor count
|
||||||

|

|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 383 KiB After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 382 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 218 KiB |
Before Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 103 KiB |
BIN
doc/preview/tableview.png
Normal file
After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 49 KiB |
@ -7,6 +7,8 @@ set(CMAKE_AUTOUIC ON)
|
|||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
|
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||||
|
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
set(platform 64)
|
set(platform 64)
|
||||||
else()
|
else()
|
||||||
@ -43,21 +45,18 @@ qt_add_resources(QT_RESOURCES ${RESOURCES})
|
|||||||
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${QT_RESOURCES} ${RC_ICONS})
|
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${QT_RESOURCES} ${RC_ICONS})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(platform EQUAL 32)
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||||
file(GLOB DLL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../third/Win_x86/*.dll)
|
set(DLLPATH ${CMAKE_CURRENT_SOURCE_DIR}/../third/msvc/*.dll)
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
|
||||||
${DLL_FILES}
|
|
||||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
file(GLOB DLL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../third/Win_x64/*.dll)
|
set(DLLPATH ${CMAKE_CURRENT_SOURCE_DIR}/../third/mingw/*.dll)
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
|
||||||
${DLL_FILES}
|
|
||||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
string(REPLACE "/" ${PATH_SEPARATOR} DLLPATH "${DLLPATH}")
|
||||||
|
file(GLOB DLL_FILES ${DLLPATH})
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
${DLL_FILES}
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -11,6 +12,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -99,5 +101,19 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'Rectangle{
|
||||||
|
width: 40
|
||||||
|
height: 40
|
||||||
|
radius: 8
|
||||||
|
color: Qt.rgba(191/255,191/255,191/255,1)
|
||||||
|
FluBadge{
|
||||||
|
count: 100
|
||||||
|
isDot: false
|
||||||
|
color: Qt.rgba(82/255,196/255,26/255,1)
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,15 +3,15 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
title:"Buttons"
|
title:"Buttons"
|
||||||
|
|
||||||
spacing: 20
|
|
||||||
|
|
||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
@ -22,6 +22,7 @@ FluScrollablePage{
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
FluTextButton{
|
FluTextButton{
|
||||||
disabled:text_button_switch.selected
|
disabled:text_button_switch.selected
|
||||||
@ -48,11 +49,21 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluTextButton{
|
||||||
|
text:"Text Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
disabled:button_switch.selected
|
disabled:button_switch.selected
|
||||||
@ -79,10 +90,20 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluButton{
|
||||||
|
text:"Standard Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
@ -110,13 +131,63 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluFilledButton{
|
||||||
|
text:"Filled Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
Layout.topMargin: 20
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
FluToggleButton{
|
||||||
|
disabled:toggle_button_switch.selected
|
||||||
|
text:"Toggle Button"
|
||||||
|
onClicked: {
|
||||||
|
selected = !selected
|
||||||
|
}
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:toggle_button_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluToggleButton{
|
||||||
|
text:"Toggle Button"
|
||||||
|
onClicked: {
|
||||||
|
selected = !selected
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
iconSource:FluentIcons.ChromeCloseContrast
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
disabled:icon_button_switch.selected
|
disabled:icon_button_switch.selected
|
||||||
@ -143,12 +214,21 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluIconButton{
|
||||||
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
FluDropDownButton{
|
FluDropDownButton{
|
||||||
disabled:drop_down_button_switch.selected
|
disabled:drop_down_button_switch.selected
|
||||||
text:"DropDownButton"
|
text:"DropDownButton"
|
||||||
@ -184,12 +264,32 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluDropDownButton{
|
||||||
|
text:"DropDownButton"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_1"
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_2"
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_3"
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_4"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 100
|
height: 100
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
spacing: 8
|
spacing: 8
|
||||||
anchors{
|
anchors{
|
||||||
@ -225,13 +325,23 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluRadioButton{
|
||||||
|
selected:true
|
||||||
|
text:"Text Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
FluCheckBox{
|
FluCheckBox{
|
||||||
disabled:check_box_switch.selected
|
disabled:check_box_switch.selected
|
||||||
text:"Check Box"
|
text:"Check Box"
|
||||||
@ -240,8 +350,6 @@ FluScrollablePage{
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
spacing: 5
|
spacing: 5
|
||||||
anchors{
|
anchors{
|
||||||
@ -255,4 +363,10 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluCheckBox{
|
||||||
|
text:"Check Box"
|
||||||
|
}'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -19,6 +21,12 @@ FluScrollablePage{
|
|||||||
FluCalendarView{
|
FluCalendarView{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluCalendarView{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -34,5 +42,11 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluCalendarPicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -35,4 +37,14 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluCarousel{
|
||||||
|
width: 400
|
||||||
|
height: 300
|
||||||
|
Component.onCompleted: {
|
||||||
|
setData([{url:"qrc:/res/image/banner_1.jpg"},{url:"qrc:/res/image/banner_2.jpg"},{url:"qrc:/res/image/banner_3.jpg"}])
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,14 +11,28 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluCheckBox{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
Row{
|
||||||
|
spacing: 30
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluCheckBox{
|
||||||
|
}
|
||||||
|
FluCheckBox{
|
||||||
|
text:"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
FluCheckBox{
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
code:'FluCheckBox{
|
||||||
text:"Text"
|
text:"Text"
|
||||||
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -37,6 +39,12 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluColorView{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -54,6 +62,12 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluColorPicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,44 +11,42 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"showYear=true"
|
text:"showYear=true"
|
||||||
}
|
}
|
||||||
|
|
||||||
FluDatePicker{
|
FluDatePicker{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluDatePicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"showYear=false"
|
text:"showYear=false"
|
||||||
}
|
}
|
||||||
@ -56,8 +55,13 @@ FluScrollablePage{
|
|||||||
showYear:false
|
showYear:false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluDatePicker{
|
||||||
|
showYear:false
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,40 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
FluButton{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
Layout.topMargin: 20
|
||||||
|
text:"Show Dialog"
|
||||||
|
onClicked: {
|
||||||
|
dialog.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluContentDialog{
|
||||||
|
id:dialog
|
||||||
|
title:"友情提示"
|
||||||
|
message:"确定要退出程序么?"
|
||||||
|
negativeText:"取消"
|
||||||
|
onNegativeClicked:{
|
||||||
|
showSuccess("点击取消按钮")
|
||||||
|
}
|
||||||
|
positiveText:"确定"
|
||||||
|
onPositiveClicked:{
|
||||||
|
showSuccess("点击确定按钮")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.open()
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
FluContentDialog{
|
FluContentDialog{
|
||||||
id:dialog
|
id:dialog
|
||||||
@ -25,11 +60,5 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluButton{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
text:"Show Dialog"
|
|
||||||
onClicked: {
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,56 +11,99 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluExpander{
|
FluArea{
|
||||||
headerText:"打开一个单选框"
|
Layout.fillWidth: true
|
||||||
|
height: layout_column.height+40
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Item{
|
Column{
|
||||||
anchors.fill: parent
|
id:layout_column
|
||||||
ColumnLayout{
|
spacing: 15
|
||||||
spacing: 8
|
anchors{
|
||||||
anchors{
|
verticalCenter: parent.verticalCenter
|
||||||
top: parent.top
|
left:parent.left
|
||||||
left: parent.left
|
}
|
||||||
topMargin: 15
|
|
||||||
leftMargin: 15
|
FluExpander{
|
||||||
}
|
headerText:"打开一个单选框"
|
||||||
Repeater{
|
Layout.topMargin: 20
|
||||||
id:repeater
|
Item{
|
||||||
property int selecIndex : 0
|
anchors.fill: parent
|
||||||
model: 3
|
ColumnLayout{
|
||||||
delegate: FluRadioButton{
|
spacing: 8
|
||||||
selected : repeater.selecIndex===index
|
anchors{
|
||||||
text:"Radio Button_"+index
|
top: parent.top
|
||||||
onClicked:{
|
left: parent.left
|
||||||
repeater.selecIndex = index
|
topMargin: 15
|
||||||
|
leftMargin: 15
|
||||||
|
}
|
||||||
|
Repeater{
|
||||||
|
id:repeater
|
||||||
|
property int selecIndex : 0
|
||||||
|
model: 3
|
||||||
|
delegate: FluRadioButton{
|
||||||
|
selected : repeater.selecIndex===index
|
||||||
|
text:"Radio Button_"+index
|
||||||
|
onClicked:{
|
||||||
|
repeater.selecIndex = index
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluExpander{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
headerText:"打开一个滑动文本框"
|
||||||
|
Item{
|
||||||
|
anchors.fill: parent
|
||||||
|
Flickable{
|
||||||
|
id:scrollview
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
contentWidth: width
|
||||||
|
contentHeight: text_info.height
|
||||||
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
|
FluText{
|
||||||
|
id:text_info
|
||||||
|
width: scrollview.width
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
padding: 14
|
||||||
|
text:"先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluExpander{
|
CodeExpander{
|
||||||
Layout.topMargin: 20
|
Layout.fillWidth: true
|
||||||
headerText:"打开一个滑动文本框"
|
code:'FluExpander{
|
||||||
Item{
|
headerText:"打开一个单选框"
|
||||||
anchors.fill: parent
|
Item{
|
||||||
Flickable{
|
anchors.fill: parent
|
||||||
id:scrollview
|
Flickable{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: text_info.height
|
contentHeight: text_info.height
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
FluText{
|
FluText{
|
||||||
id:text_info
|
id:text_info
|
||||||
width: scrollview.width
|
width: scrollview.width
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
padding: 14
|
padding: 14
|
||||||
text:"先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。"
|
text:"先帝创业未半而中道崩殂,今天下三分......""
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -26,7 +27,6 @@ FluScrollablePage{
|
|||||||
Image{
|
Image{
|
||||||
source: "qrc:/res/image/banner_1.jpg"
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
sourceSize: Qt.size(400,300)
|
|
||||||
fillMode:Image.PreserveAspectCrop
|
fillMode:Image.PreserveAspectCrop
|
||||||
}
|
}
|
||||||
Image{
|
Image{
|
||||||
@ -42,6 +42,27 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluFlipView{
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -74,5 +95,26 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluFlipView{
|
||||||
|
vertical:true
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,33 +11,53 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluButton{
|
FluArea{
|
||||||
text:"Info"
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
onClicked: {
|
height: 200
|
||||||
showInfo("这是一个Info样式的InfoBar")
|
paddings: 10
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 14
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Info"
|
||||||
|
onClicked: {
|
||||||
|
showInfo("这是一个Info样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Warning"
|
||||||
|
onClicked: {
|
||||||
|
showWarning("这是一个Warning样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Error"
|
||||||
|
onClicked: {
|
||||||
|
showError("这是一个Error样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Success"
|
||||||
|
onClicked: {
|
||||||
|
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluButton{
|
CodeExpander{
|
||||||
text:"Warning"
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
code:'showInfo("这是一个Info样式的InfoBar")
|
||||||
onClicked: {
|
|
||||||
showWarning("这是一个Warning样式的InfoBar")
|
showWarning("这是一个Warning样式的InfoBar")
|
||||||
}
|
|
||||||
}
|
showError("这是一个Error样式的InfoBar")
|
||||||
FluButton{
|
|
||||||
text:"Error"
|
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")'
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showError("这是一个Error样式的InfoBar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text:"Success"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if(visible){
|
if(visible){
|
||||||
@ -18,7 +20,6 @@ FluScrollablePage{
|
|||||||
player.pause()
|
player.pause()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 320
|
height: 320
|
||||||
@ -35,13 +36,19 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluMediaPlayer{
|
||||||
|
id:player
|
||||||
|
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
text:"跳转到视频播放器窗口"
|
text:"跳转到视频播放器窗口"
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@ -49,8 +56,10 @@ FluScrollablePage{
|
|||||||
FluApp.navigate("/media",{source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"})
|
FluApp.navigate("/media",{source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,30 +11,66 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluButton{
|
FluArea{
|
||||||
text:"左击菜单"
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
onClicked:{
|
Column{
|
||||||
menu.popup()
|
id:layout_column
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:parent.left
|
||||||
|
}
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"左击菜单"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
onClicked:{
|
||||||
|
menu.popup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"右击菜单"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
onClicked: {
|
||||||
|
showSuccess("请按鼠标右击")
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
onClicked: {
|
||||||
|
menu.popup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
FluButton{
|
Layout.fillWidth: true
|
||||||
text:"右击菜单"
|
code:'FluMenu{
|
||||||
Layout.topMargin: 20
|
id:menu
|
||||||
|
FluMenuItem:{
|
||||||
|
text:"删除"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showSuccess("请按鼠标右击")
|
showError("删除")
|
||||||
}
|
}
|
||||||
MouseArea{
|
}
|
||||||
anchors.fill: parent
|
FluMenuItem:{
|
||||||
acceptedButtons: Qt.RightButton
|
text:"修改"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
menu.popup()
|
showInfo"修改")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
menu.popup()
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
FluMenu{
|
FluMenu{
|
||||||
id:menu
|
id:menu
|
||||||
@ -46,7 +83,7 @@ FluScrollablePage{
|
|||||||
FluMenuItem{
|
FluMenuItem{
|
||||||
text:"修改"
|
text:"修改"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showError("修改")
|
showInfo("修改")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,18 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
property string password: ""
|
||||||
|
property var loginPageRegister: registerForPageResult("/login")
|
||||||
|
|
||||||
title:"MultiWindow"
|
title:"MultiWindow"
|
||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
property string password: ""
|
|
||||||
|
|
||||||
property var loginPageRegister: registerForPageResult("/login")
|
|
||||||
|
|
||||||
Connections{
|
Connections{
|
||||||
target: loginPageRegister
|
target: loginPageRegister
|
||||||
@ -28,7 +29,6 @@ FluScrollablePage{
|
|||||||
height: 100
|
height: 100
|
||||||
paddings: 10
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
|
||||||
Column{
|
Column{
|
||||||
spacing: 15
|
spacing: 15
|
||||||
anchors{
|
anchors{
|
||||||
@ -46,6 +46,16 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluButton{
|
||||||
|
text:"点击跳转"
|
||||||
|
onClicked: {
|
||||||
|
FluApp.navigate("/about")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -68,11 +78,30 @@ FluScrollablePage{
|
|||||||
loginPageRegister.launch({username:"zhuzichu"})
|
loginPageRegister.launch({username:"zhuzichu"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"登录窗口返回过来的密码->"+password
|
text:"登录窗口返回过来的密码->"+password
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'property var loginPageRegister: registerForPageResult("/login")
|
||||||
|
|
||||||
|
Connections{
|
||||||
|
target: loginPageRegister
|
||||||
|
function onResult(data)
|
||||||
|
{
|
||||||
|
password = data.password
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"点击跳转"
|
||||||
|
onClicked: {
|
||||||
|
loginPageRegister.launch({username:"zhuzichu"})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -46,6 +47,36 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluPivot{
|
||||||
|
anchors.fill: parent
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"All"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"All emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"Unread"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"Unread emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"Flagged"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"Flagged emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"Urgent"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"Urgent emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,30 +11,59 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluProgressBar{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
height: 260
|
||||||
FluProgressRing{
|
paddings: 10
|
||||||
Layout.topMargin: 10
|
ColumnLayout{
|
||||||
}
|
spacing: 20
|
||||||
FluProgressBar{
|
anchors{
|
||||||
id:progress_bar
|
verticalCenter: parent.verticalCenter
|
||||||
Layout.topMargin: 20
|
left: parent.left
|
||||||
indeterminate: false
|
}
|
||||||
}
|
FluProgressBar{
|
||||||
FluProgressRing{
|
}
|
||||||
id:progress_ring
|
FluProgressRing{
|
||||||
Layout.topMargin: 10
|
}
|
||||||
indeterminate: false
|
FluProgressBar{
|
||||||
}
|
id:progress_bar
|
||||||
FluSlider{
|
indeterminate: false
|
||||||
Layout.topMargin: 30
|
}
|
||||||
value:50
|
FluProgressRing{
|
||||||
onValueChanged:{
|
id:progress_ring
|
||||||
progress_bar.progress = value/100
|
indeterminate: false
|
||||||
progress_ring.progress = value/100
|
}
|
||||||
|
FluSlider{
|
||||||
|
value:50
|
||||||
|
onValueChanged:{
|
||||||
|
progress_bar.progress = value/100
|
||||||
|
progress_ring.progress = value/100
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Layout.bottomMargin: 30
|
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluProgressBar{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluProgressRing{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluProgressBar{
|
||||||
|
indeterminate: false
|
||||||
|
}
|
||||||
|
|
||||||
|
FluProgressRing{
|
||||||
|
indeterminate: false
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,108 +11,141 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
RowLayout{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
FluRectangle{
|
height: 480
|
||||||
width: 50
|
paddings: 10
|
||||||
height: 50
|
|
||||||
color:"#0078d4"
|
Column{
|
||||||
radius:[0,0,0,0]
|
spacing: 15
|
||||||
}
|
anchors{
|
||||||
FluRectangle{
|
verticalCenter: parent.verticalCenter
|
||||||
width: 50
|
left: parent.left
|
||||||
height: 50
|
}
|
||||||
color:"#744da9"
|
|
||||||
radius:[15,15,15,15]
|
RowLayout{
|
||||||
}
|
Layout.topMargin: 20
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
width: 50
|
width: 50
|
||||||
height: 50
|
height: 50
|
||||||
color:"#ffeb3b"
|
color:"#0078d4"
|
||||||
radius:[15,0,0,0]
|
radius:[0,0,0,0]
|
||||||
}
|
}
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
width: 50
|
width: 50
|
||||||
height: 50
|
height: 50
|
||||||
color:"#f7630c"
|
color:"#744da9"
|
||||||
radius:[0,15,0,0]
|
radius:[15,15,15,15]
|
||||||
}
|
}
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
width: 50
|
width: 50
|
||||||
height: 50
|
height: 50
|
||||||
color:"#e71123"
|
color:"#ffeb3b"
|
||||||
radius:[0,0,15,0]
|
radius:[15,0,0,0]
|
||||||
}
|
}
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
width: 50
|
width: 50
|
||||||
height: 50
|
height: 50
|
||||||
color:"#b4009e"
|
color:"#f7630c"
|
||||||
radius:[0,0,0,15]
|
radius:[0,15,0,0]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#e71123"
|
||||||
|
radius:[0,0,15,0]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#b4009e"
|
||||||
|
radius:[0,0,0,15]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"配合图片使用"
|
||||||
|
fontStyle: FluText.SubTitle
|
||||||
|
Layout.topMargin: 20
|
||||||
|
}
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[25,0,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
source: "qrc:/res/svg/avatar_1.svg"
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[10,10,10,10]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
source: "qrc:/res/svg/avatar_2.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[25,25,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
source: "qrc:/res/svg/avatar_3.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[0,25,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
source: "qrc:/res/svg/avatar_4.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 1080/5
|
||||||
|
height: 1439/5
|
||||||
|
radius:[25,25,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
source: "qrc:/res/image/image_huoyin.webp"
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
}
|
||||||
|
Layout.topMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluText{
|
CodeExpander{
|
||||||
text:"配合图片使用"
|
Layout.fillWidth: true
|
||||||
fontStyle: FluText.SubTitle
|
code:'FluRectangle{
|
||||||
Layout.topMargin: 20
|
radius: [25,25,25,25]
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
Image{
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
source: "qrc:/res/svg/avatar_4.svg"
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
}
|
}
|
||||||
RowLayout{
|
}'
|
||||||
spacing: 14
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[25,0,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
source: "qrc:/res/svg/avatar_1.svg"
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[10,10,10,10]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
source: "qrc:/res/svg/avatar_2.svg"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[25,25,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
source: "qrc:/res/svg/avatar_3.svg"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[0,25,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
source: "qrc:/res/svg/avatar_4.svg"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 1080/5
|
|
||||||
height: 1439/5
|
|
||||||
radius:[25,25,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
source: "qrc:/res/image/image_huoyin.webp"
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
}
|
|
||||||
Layout.topMargin: 10
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import "./component"
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
@ -10,17 +11,46 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluSlider{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
value: 50
|
FluSlider{
|
||||||
Layout.leftMargin: 10
|
value: 50
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FluSlider{
|
CodeExpander{
|
||||||
vertical:true
|
Layout.fillWidth: true
|
||||||
|
code:'FluSlider{
|
||||||
|
value:50
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 200
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 10
|
FluSlider{
|
||||||
Layout.bottomMargin: 20
|
value: 50
|
||||||
value: 50
|
vertical:true
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 20
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluSlider{
|
||||||
|
vertical:true
|
||||||
|
value:50
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
91
example/T_StatusView.qml
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"StatusView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
id:layout_actions
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 50
|
||||||
|
paddings: 10
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
FluDropDownButton{
|
||||||
|
id:btn_status_mode
|
||||||
|
Layout.preferredWidth: 140
|
||||||
|
text:"Loading"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Loading"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Loading
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Empty"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Empty
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Error"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Success"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Success
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 10
|
||||||
|
height: 380
|
||||||
|
paddings: 10
|
||||||
|
FluStatusView{
|
||||||
|
id:status_view
|
||||||
|
anchors.fill: parent
|
||||||
|
onErrorClicked:{
|
||||||
|
showError("点击重新加载")
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color:FluTheme.primaryColor.dark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluStatusView{
|
||||||
|
anchors.fill: parent
|
||||||
|
statusMode: FluStatusView.Loading
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color:FluTheme.primaryColor.dark
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
||||||
|
|
||||||
@ -99,7 +101,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 5
|
Layout.topMargin: 15
|
||||||
height: 400
|
height: 400
|
||||||
paddings: 10
|
paddings: 10
|
||||||
FluTabView{
|
FluTabView{
|
||||||
@ -109,5 +111,27 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluTabView{
|
||||||
|
anchors.fill: parent
|
||||||
|
Component.onCompleted: {
|
||||||
|
newTab()
|
||||||
|
newTab()
|
||||||
|
newTab()
|
||||||
|
}
|
||||||
|
Component{
|
||||||
|
id:com_page
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: argument
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function newTab(){
|
||||||
|
tab_view.appendTab("qrc:/res/image/favicon.ico","Document 1",com_page,argument)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
160
example/T_TableView.qml
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"TableView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '年龄',
|
||||||
|
dataIndex: 'age',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '住址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
width:200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '别名',
|
||||||
|
dataIndex: 'nickname',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
];
|
||||||
|
table_view.columns = columns
|
||||||
|
loadData(1,10)
|
||||||
|
}
|
||||||
|
|
||||||
|
FluTableView{
|
||||||
|
id:table_view
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
pageCurrent:1
|
||||||
|
pageCount:10
|
||||||
|
itemCount: 1000
|
||||||
|
onRequestPage:
|
||||||
|
(page,count)=> {
|
||||||
|
loadData(page,count)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id:com_action
|
||||||
|
Item{
|
||||||
|
Row{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 10
|
||||||
|
FluFilledButton{
|
||||||
|
text:"编辑"
|
||||||
|
topPadding:3
|
||||||
|
bottomPadding:3
|
||||||
|
leftPadding:3
|
||||||
|
rightPadding:3
|
||||||
|
onClicked:{
|
||||||
|
console.debug(dataModel.index)
|
||||||
|
showSuccess(JSON.stringify(dataObject))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluFilledButton{
|
||||||
|
text:"删除"
|
||||||
|
topPadding:3
|
||||||
|
bottomPadding:3
|
||||||
|
leftPadding:3
|
||||||
|
rightPadding:3
|
||||||
|
onClicked:{
|
||||||
|
showError(JSON.stringify(dataObject))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadData(page,count){
|
||||||
|
const dataSource = []
|
||||||
|
for(var i=0;i<count;i++){
|
||||||
|
dataSource.push({
|
||||||
|
name: "孙悟空%1".arg(((page-1)*count+i)),
|
||||||
|
age: 500,
|
||||||
|
address: "钟灵毓秀的花果山,如神仙仙境的水帘洞",
|
||||||
|
nickname: "齐天大圣",
|
||||||
|
action:com_action
|
||||||
|
})
|
||||||
|
}
|
||||||
|
table_view.dataSource = dataSource
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 10
|
||||||
|
code:'FluTableView{
|
||||||
|
id:table_view
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
width:parent.width
|
||||||
|
pageCurrent:1
|
||||||
|
pageCount:10
|
||||||
|
itemCount: 1000
|
||||||
|
onRequestPage:
|
||||||
|
(page,count)=> {
|
||||||
|
loadData(page,count)
|
||||||
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: "姓名",
|
||||||
|
dataIndex: "name",
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "年龄",
|
||||||
|
dataIndex: "age",
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "住址",
|
||||||
|
dataIndex: "address",
|
||||||
|
width:200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "别名",
|
||||||
|
dataIndex: "nickname",
|
||||||
|
width:100
|
||||||
|
}
|
||||||
|
];
|
||||||
|
table_view.columns = columns
|
||||||
|
const dataSource = [
|
||||||
|
{
|
||||||
|
name: "孙悟空”,
|
||||||
|
age: 500,
|
||||||
|
address:"钟灵毓秀的花果山,如神仙仙境的水帘洞",
|
||||||
|
nickname:"齐天大圣"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
table_view.dataSource = columns
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,32 +11,122 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluTextBox{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
placeholderText: "单行输入框"
|
|
||||||
Layout.preferredWidth: 300
|
FluTextBox{
|
||||||
disabled:toggle_switch.selected
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "单行输入框"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
disabled:text_box_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:text_box_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FluMultilineTextBox{
|
CodeExpander{
|
||||||
Layout.topMargin: 20
|
Layout.fillWidth: true
|
||||||
Layout.preferredWidth: 300
|
code:'FluTextBox{
|
||||||
placeholderText: "多行输入框"
|
placeholderText:"单行输入框"
|
||||||
disabled:toggle_switch.selected
|
}'
|
||||||
}
|
|
||||||
FluAutoSuggestBox{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
items:generateRandomNames(100)
|
|
||||||
placeholderText: "AutoSuggestBox"
|
|
||||||
Layout.preferredWidth: 300
|
|
||||||
disabled:toggle_switch.selected
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluToggleSwitch{
|
|
||||||
id:toggle_switch
|
FluArea{
|
||||||
text:"Disabled"
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluMultilineTextBox{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "多行输入框"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
disabled:text_box_multi_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:text_box_multi_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluMultilineTextBox{
|
||||||
|
placeholderText:"多行输入框"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluAutoSuggestBox{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "AutoSuggestBox"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
items:generateRandomNames(100)
|
||||||
|
disabled:text_box_suggest_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:text_box_suggest_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluAutoSuggestBox{
|
||||||
|
placeholderText:"AutoSuggestBox"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function generateRandomNames(numNames) {
|
function generateRandomNames(numNames) {
|
||||||
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,52 +11,78 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
RowLayout{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Repeater{
|
height: 210
|
||||||
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
paddings: 10
|
||||||
delegate: FluRectangle{
|
ColumnLayout{
|
||||||
width: 42
|
spacing:0
|
||||||
height: 42
|
anchors{
|
||||||
radius: [4,4,4,4]
|
left: parent.left
|
||||||
color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal
|
}
|
||||||
FluIcon {
|
RowLayout{
|
||||||
anchors.centerIn: parent
|
Layout.topMargin: 10
|
||||||
iconSource: FluentIcons.AcceptMedium
|
Repeater{
|
||||||
iconSize: 15
|
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
||||||
visible: modelData === FluTheme.primaryColor
|
delegate: FluRectangle{
|
||||||
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
width: 42
|
||||||
}
|
height: 42
|
||||||
MouseArea{
|
radius: [4,4,4,4]
|
||||||
id:mouse_item
|
color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal
|
||||||
anchors.fill: parent
|
FluIcon {
|
||||||
hoverEnabled: true
|
anchors.centerIn: parent
|
||||||
onClicked: {
|
iconSource: FluentIcons.AcceptMedium
|
||||||
FluTheme.primaryColor = modelData
|
iconSize: 15
|
||||||
|
visible: modelData === FluTheme.primaryColor
|
||||||
|
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
id:mouse_item
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: {
|
||||||
|
FluTheme.primaryColor = modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluText{
|
||||||
|
text:"夜间模式"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
Layout.topMargin: 5
|
||||||
|
selected: FluTheme.dark
|
||||||
|
clickFunc:function(){
|
||||||
|
FluTheme.dark = !FluTheme.dark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"native文本渲染"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
Layout.topMargin: 5
|
||||||
|
selected: FluTheme.nativeText
|
||||||
|
clickFunc:function(){
|
||||||
|
FluTheme.nativeText = !FluTheme.nativeText
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluText{
|
CodeExpander{
|
||||||
text:"夜间模式"
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
code:'FluTheme.primaryColor = FluColors.Orange
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
FluTheme.dark = true
|
||||||
selected: FluTheme.dark
|
|
||||||
clickFunc:function(){
|
FluTheme.nativeText = true
|
||||||
FluTheme.dark = !FluTheme.dark
|
'
|
||||||
}
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"native文本渲染"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
selected: FluTheme.nativeText
|
|
||||||
clickFunc:function(){
|
|
||||||
FluTheme.nativeText = !FluTheme.nativeText
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -33,7 +35,12 @@ FluScrollablePage{
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluTimePicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -49,15 +56,20 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"hourFormat=FluTimePicker.HH"
|
text:"hourFormat=FluTimePicker.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
FluTimePicker{
|
FluTimePicker{
|
||||||
hourFormat:FluTimePicker.HH
|
hourFormat:FluTimePicker.HH
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluTimePicker{
|
||||||
|
hourFormat:FluTimePicker.HH
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,12 +11,29 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluToggleSwitch{
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
Row{
|
||||||
|
spacing: 30
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluToggleSwitch{
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
text:"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
CodeExpander{
|
||||||
Layout.topMargin: 20
|
Layout.fillWidth: true
|
||||||
text:"Text"
|
code:'FluToggleSwitch{
|
||||||
|
text:"Text"
|
||||||
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,13 +11,13 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
text:"鼠标悬停不动,弹出Tooltip"
|
text:"鼠标悬停不动,弹出Tooltip"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
@ -42,6 +43,18 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluIconButton{
|
||||||
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
|
iconSize: 15
|
||||||
|
text:"删除"
|
||||||
|
onClicked:{
|
||||||
|
showSuccess("点击IconButton")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -72,6 +85,22 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
code:'FluButton{
|
||||||
|
id:button_1
|
||||||
|
text:"删除"
|
||||||
|
FluTooltip{
|
||||||
|
visible: button_1.hovered
|
||||||
|
text:button_1.text
|
||||||
|
delay: 1000
|
||||||
|
}
|
||||||
|
onClicked:{
|
||||||
|
showSuccess("点击一个Button")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,15 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "./component"
|
||||||
|
|
||||||
FluContentPage {
|
FluScrollablePage {
|
||||||
|
|
||||||
title:"TreeView"
|
title:"TreeView"
|
||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
function randomName() {
|
function randomName() {
|
||||||
var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"]
|
var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"]
|
||||||
@ -50,95 +52,110 @@ FluContentPage {
|
|||||||
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
|
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
FluTreeView{
|
id:layout_actions
|
||||||
id:tree_view
|
Layout.fillWidth: true
|
||||||
width:240
|
Layout.topMargin: 20
|
||||||
anchors{
|
height: 50
|
||||||
top:parent.top
|
paddings: 10
|
||||||
left:parent.left
|
RowLayout{
|
||||||
bottom:parent.bottom
|
spacing: 14
|
||||||
}
|
FluDropDownButton{
|
||||||
onItemClicked:
|
id:btn_selection_model
|
||||||
(model)=>{
|
Layout.preferredWidth: 140
|
||||||
showSuccess(model.text)
|
text:"None"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"None"
|
||||||
|
onClicked: {
|
||||||
|
btn_selection_model.text = text
|
||||||
|
tree_view.selectionMode = FluTabView.Equal
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Single"
|
||||||
|
onClicked: {
|
||||||
|
btn_selection_model.text = text
|
||||||
|
tree_view.selectionMode = FluTabView.SizeToContent
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Muiltple"
|
||||||
|
onClicked: {
|
||||||
|
btn_selection_model.text = text
|
||||||
|
tree_view.selectionMode = FluTabView.Compact
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
FluFilledButton{
|
||||||
|
text:"获取选中的数据"
|
||||||
|
onClicked: {
|
||||||
|
if(tree_view.selectionMode === FluTreeView.None){
|
||||||
|
showError("当前非选择模式,没有选中的数据")
|
||||||
|
}
|
||||||
|
if(tree_view.selectionMode === FluTreeView.Single){
|
||||||
|
if(!tree_view.signleData()){
|
||||||
|
showError("没有选中数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
showSuccess(tree_view.signleData().text)
|
||||||
|
}
|
||||||
|
if(tree_view.selectionMode === FluTreeView.Multiple){
|
||||||
|
if(tree_view.multipData().length===0){
|
||||||
|
showError("没有选中数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var info = []
|
||||||
|
tree_view.multipData().map((value)=>info.push(value.text))
|
||||||
|
showSuccess(info.join(","))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
var org = createOrg(3, 3, 3)
|
|
||||||
updateData(org)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 10
|
||||||
|
paddings: 10
|
||||||
|
height: 400
|
||||||
|
FluTreeView{
|
||||||
|
id:tree_view
|
||||||
|
width:240
|
||||||
|
anchors{
|
||||||
|
top:parent.top
|
||||||
|
left:parent.left
|
||||||
|
bottom:parent.bottom
|
||||||
|
}
|
||||||
|
onItemClicked:
|
||||||
|
(model)=>{
|
||||||
|
showSuccess(model.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
var org = createOrg(3, 3, 3)
|
||||||
|
createItem()
|
||||||
|
updateData(org)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
ColumnLayout{
|
Layout.fillWidth: true
|
||||||
anchors{
|
code:'FluTreeView{
|
||||||
left: tree_view.right
|
id:tree_view
|
||||||
right: parent.right
|
width:240
|
||||||
top: parent.top
|
height:600
|
||||||
}
|
Component.onCompleted: {
|
||||||
|
var datas = []
|
||||||
FluText{
|
datas.push(createItem("Node1",false))
|
||||||
text:{
|
datas.push(createItem("Node2",false))
|
||||||
if(tree_view.selectionMode === FluTreeView.None){
|
datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
|
||||||
return "selectionMode->FluTreeView.None"
|
updateData(datas)
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Single){
|
|
||||||
return "selectionMode->FluTreeView.Single"
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Multiple){
|
|
||||||
return "selectionMode->FluTreeView.Multiple"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"None"
|
|
||||||
onClicked: {
|
|
||||||
tree_view.selectionMode = FluTreeView.None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"Single"
|
|
||||||
onClicked: {
|
|
||||||
tree_view.selectionMode = FluTreeView.Single
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"Multiple"
|
|
||||||
onClicked: {
|
|
||||||
tree_view.selectionMode = FluTreeView.Multiple
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluFilledButton{
|
|
||||||
text:"获取选中的数据"
|
|
||||||
onClicked: {
|
|
||||||
if(tree_view.selectionMode === FluTreeView.None){
|
|
||||||
showError("当前非选择模式,没有选中的数据")
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Single){
|
|
||||||
if(!tree_view.signleData()){
|
|
||||||
showError("没有选中数据")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
showSuccess(tree_view.signleData().text)
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Multiple){
|
|
||||||
if(tree_view.multipData().length===0){
|
|
||||||
showError("没有选中数据")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var info = []
|
|
||||||
tree_view.multipData().map((value)=>info.push(value.text))
|
|
||||||
showSuccess(info.join(","))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -15,15 +15,19 @@ FluContentPage {
|
|||||||
slider.seek(0)
|
slider.seek(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView{
|
FluArea{
|
||||||
clip: true
|
anchors{
|
||||||
width: parent.width
|
top:parent.top
|
||||||
contentWidth: parent.width
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
topMargin: 20
|
||||||
|
}
|
||||||
|
paddings: 10
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
spacing: 0
|
spacing: 0
|
||||||
FluText{
|
FluText{
|
||||||
text:"Display"
|
text:"Display"
|
||||||
Layout.topMargin: 20
|
|
||||||
padding: 0
|
padding: 0
|
||||||
pixelSize: textSize
|
pixelSize: textSize
|
||||||
fontStyle: FluText.Display
|
fontStyle: FluText.Display
|
||||||
@ -65,21 +69,26 @@ FluContentPage {
|
|||||||
fontStyle: FluText.Caption
|
fontStyle: FluText.Caption
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluSlider{
|
||||||
|
id:slider
|
||||||
|
vertical:true
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 45
|
||||||
|
top: parent.top
|
||||||
|
topMargin: 30
|
||||||
|
}
|
||||||
|
onValueChanged:{
|
||||||
|
textSize = value/100*6+FluTheme.textSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluSlider{
|
|
||||||
id:slider
|
|
||||||
vertical:true
|
|
||||||
anchors{
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: 45
|
|
||||||
top: parent.top
|
|
||||||
topMargin: 30
|
|
||||||
}
|
|
||||||
onValueChanged:{
|
|
||||||
textSize = value/100*6+FluTheme.textSize
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
130
example/component/CodeExpander.qml
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluExpander{
|
||||||
|
|
||||||
|
property string code: ""
|
||||||
|
|
||||||
|
headerText: "Source"
|
||||||
|
contentHeight:content.height
|
||||||
|
|
||||||
|
FluMultilineTextBox{
|
||||||
|
id:content
|
||||||
|
width:parent.width
|
||||||
|
readOnly:true
|
||||||
|
text:highlightQmlCode(code)
|
||||||
|
focus:false
|
||||||
|
textFormat: FluMultilineTextBox.RichText
|
||||||
|
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||||
|
background:Rectangle{
|
||||||
|
radius: 4
|
||||||
|
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
|
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||||
|
border.width: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluIconButton{
|
||||||
|
iconSource:FluentIcons.Copy
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
top: parent.top
|
||||||
|
rightMargin: 5
|
||||||
|
topMargin: 5
|
||||||
|
}
|
||||||
|
onClicked:{
|
||||||
|
FluApp.clipText(content.text)
|
||||||
|
showSuccess("复制成功")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function htmlEncode(e){
|
||||||
|
var i,s;
|
||||||
|
for(i in s={
|
||||||
|
"&":/&/g,//""//":/"/g,"'":/'/g,
|
||||||
|
"<":/</g,">":/>/g,"<br/>":/\n/g,
|
||||||
|
" ":/ /g," ":/\t/g
|
||||||
|
})e=e.replace(s[i],i);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
function highlightQmlCode(code) {
|
||||||
|
// 定义 QML 关键字列表
|
||||||
|
var qmlKeywords = [
|
||||||
|
"FluTextButton",
|
||||||
|
"FluAppBar",
|
||||||
|
"FluAutoSuggestBox",
|
||||||
|
"FluBadge",
|
||||||
|
"FluButton",
|
||||||
|
"FluCalendarPicker",
|
||||||
|
"FluCalendarView",
|
||||||
|
"FluCarousel",
|
||||||
|
"FluCheckBox",
|
||||||
|
"FluColorPicker",
|
||||||
|
"FluColorView",
|
||||||
|
"FluComboBox",
|
||||||
|
"FluContentDialog",
|
||||||
|
"FluContentPage",
|
||||||
|
"FluControl",
|
||||||
|
"FluDatePicker",
|
||||||
|
"FluDivider",
|
||||||
|
"FluDropDownButton",
|
||||||
|
"FluExpander",
|
||||||
|
"FluFilledButton",
|
||||||
|
"FluFlipView",
|
||||||
|
"FluFocusRectangle",
|
||||||
|
"FluIcon",
|
||||||
|
"FluIconButton",
|
||||||
|
"FluInfoBar",
|
||||||
|
"FluItem",
|
||||||
|
"FluMediaPlayer",
|
||||||
|
"FluMenu",
|
||||||
|
"FluMenuItem",
|
||||||
|
"FluMultilineTextBox",
|
||||||
|
"FluNavigationView",
|
||||||
|
"FluObject",
|
||||||
|
"FluPaneItem",
|
||||||
|
"FluPaneItemExpander",
|
||||||
|
"FluPaneItemHeader",
|
||||||
|
"FluPaneItemSeparator",
|
||||||
|
"FluPivot",
|
||||||
|
"FluPivotItem",
|
||||||
|
"FluProgressBar",
|
||||||
|
"FluProgressRing",
|
||||||
|
"FluRadioButton",
|
||||||
|
"FluRectangle",
|
||||||
|
"FluScrollablePage",
|
||||||
|
"FluScrollBar",
|
||||||
|
"FluShadow",
|
||||||
|
"FluSlider",
|
||||||
|
"FluTabView",
|
||||||
|
"FluText",
|
||||||
|
"FluTextArea",
|
||||||
|
"FluTextBox",
|
||||||
|
"FluTextBoxBackground",
|
||||||
|
"FluTextBoxMenu",
|
||||||
|
"FluTextButton",
|
||||||
|
"FluTextFiled",
|
||||||
|
"FluTimePicker",
|
||||||
|
"FluToggleSwitch",
|
||||||
|
"FluTooltip",
|
||||||
|
"FluTreeView",
|
||||||
|
"FluWindow",
|
||||||
|
"FluWindowResize",
|
||||||
|
"FluToggleButton",
|
||||||
|
"FluTableView",
|
||||||
|
"FluColors",
|
||||||
|
"FluTheme",
|
||||||
|
"FluStatusView"
|
||||||
|
];
|
||||||
|
code = code.replace(/\n/g, "<br>");
|
||||||
|
code = code.replace(/ /g, " ");
|
||||||
|
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -23,13 +23,15 @@ CONFIG(debug,debug|release) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
contains(QT_ARCH, i386) {
|
|
||||||
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x86/*.dll) $$DESTDIR
|
contains(QMAKE_CC, cl) {
|
||||||
|
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/msvc/*.dll) $$DESTDIR
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
|
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
|
||||||
} else {
|
} else {
|
||||||
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x64/*.dll) $$DESTDIR
|
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/mingw/*.dll) $$DESTDIR
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
|
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
|
|
||||||
FluObject{
|
FluObject{
|
||||||
|
|
||||||
property var navigationView
|
property var navigationView
|
||||||
@ -19,7 +18,6 @@ FluObject{
|
|||||||
FluPaneItemExpander{
|
FluPaneItemExpander{
|
||||||
title:"Basic input"
|
title:"Basic input"
|
||||||
icon:FluentIcons.CheckboxComposite
|
icon:FluentIcons.CheckboxComposite
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Buttons"
|
title:"Buttons"
|
||||||
image:"qrc:/res/image/control/Button.png"
|
image:"qrc:/res/image/control/Button.png"
|
||||||
@ -38,7 +36,6 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_Slider.qml")
|
navigationView.push("qrc:/T_Slider.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"CheckBox"
|
title:"CheckBox"
|
||||||
image:"qrc:/res/image/control/Checkbox.png"
|
image:"qrc:/res/image/control/Checkbox.png"
|
||||||
@ -48,7 +45,6 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_CheckBox.qml")
|
navigationView.push("qrc:/T_CheckBox.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"ToggleSwitch"
|
title:"ToggleSwitch"
|
||||||
onTap:{
|
onTap:{
|
||||||
@ -92,11 +88,9 @@ FluObject{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluPaneItemExpander{
|
FluPaneItemExpander{
|
||||||
title:"Surface"
|
title:"Surface"
|
||||||
icon:FluentIcons.SurfaceHub
|
icon:FluentIcons.SurfaceHub
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"InfoBar"
|
title:"InfoBar"
|
||||||
image:"qrc:/res/image/control/InfoBar.png"
|
image:"qrc:/res/image/control/InfoBar.png"
|
||||||
@ -106,42 +100,42 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_InfoBar.qml")
|
navigationView.push("qrc:/T_InfoBar.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Progress"
|
title:"Progress"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Progress.qml")
|
navigationView.push("qrc:/T_Progress.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Badge"
|
title:"Badge"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Badge.qml")
|
navigationView.push("qrc:/T_Badge.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Rectangle"
|
title:"Rectangle"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Rectangle.qml")
|
navigationView.push("qrc:/T_Rectangle.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"StatusView"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_StatusView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Carousel"
|
title:"Carousel"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Carousel.qml")
|
navigationView.push("qrc:/T_Carousel.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Expander"
|
title:"Expander"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Expander.qml")
|
navigationView.push("qrc:/T_Expander.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemExpander{
|
FluPaneItemExpander{
|
||||||
@ -153,14 +147,12 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_Dialog.qml")
|
navigationView.push("qrc:/T_Dialog.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Tooltip"
|
title:"Tooltip"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Tooltip.qml")
|
navigationView.push("qrc:/T_Tooltip.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Menu"
|
title:"Menu"
|
||||||
onTap:{
|
onTap:{
|
||||||
@ -172,7 +164,6 @@ FluObject{
|
|||||||
FluPaneItemExpander{
|
FluPaneItemExpander{
|
||||||
title:"Navigation"
|
title:"Navigation"
|
||||||
icon:FluentIcons.AllApps
|
icon:FluentIcons.AllApps
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Pivot"
|
title:"Pivot"
|
||||||
image:"qrc:/res/image/control/Pivot.png"
|
image:"qrc:/res/image/control/Pivot.png"
|
||||||
@ -199,6 +190,16 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_TreeView.qml")
|
navigationView.push("qrc:/T_TreeView.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TableView"
|
||||||
|
image:"qrc:/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"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TableView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"MultiWindow"
|
title:"MultiWindow"
|
||||||
onTap:{
|
onTap:{
|
||||||
@ -226,19 +227,18 @@ FluObject{
|
|||||||
navigationView.push("qrc:/T_Theme.qml")
|
navigationView.push("qrc:/T_Theme.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Awesome"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Awesome.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Typography"
|
title:"Typography"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Typography.qml")
|
navigationView.push("qrc:/T_Typography.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Awesome"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Awesome.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemExpander{
|
FluPaneItemExpander{
|
||||||
|
@ -36,7 +36,7 @@ FluWindow {
|
|||||||
fontStyle: FluText.Title
|
fontStyle: FluText.Title
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"v1.1.9"
|
text:"v1.2.2"
|
||||||
fontStyle: FluText.Body
|
fontStyle: FluText.Body
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ FluWindow {
|
|||||||
rightMargin: 10
|
rightMargin: 10
|
||||||
}
|
}
|
||||||
height: Math.min(textbox.implicitHeight,64)
|
height: Math.min(textbox.implicitHeight,64)
|
||||||
FluMultiLineTextBox{
|
FluMultilineTextBox{
|
||||||
id:textbox
|
id:textbox
|
||||||
focus:true
|
focus:true
|
||||||
placeholderText: "请输入消息"
|
placeholderText: "请输入消息"
|
||||||
|
@ -155,5 +155,8 @@
|
|||||||
<file>page/MediaPage.qml</file>
|
<file>page/MediaPage.qml</file>
|
||||||
<file>T_FlipView.qml</file>
|
<file>T_FlipView.qml</file>
|
||||||
<file>T_Pivot.qml</file>
|
<file>T_Pivot.qml</file>
|
||||||
|
<file>component/CodeExpander.qml</file>
|
||||||
|
<file>T_TableView.qml</file>
|
||||||
|
<file>T_StatusView.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -10,6 +10,10 @@ set(QT_INSTALL_QML ${Qt6Core_DIR}/../../../qml)
|
|||||||
set(TARGET_TYPE SHARED)
|
set(TARGET_TYPE SHARED)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(TARGET_RESOURCES res.qrc)
|
set(TARGET_RESOURCES res.qrc)
|
||||||
set(TARGET_SOURCES
|
set(TARGET_SOURCES
|
||||||
Def.cpp
|
Def.cpp
|
||||||
|
@ -33,6 +33,10 @@ void Fluent::registerTypes(const char *uri){
|
|||||||
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
||||||
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
||||||
|
|
||||||
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluStatusView.qml"),uri,major,minor,"FluStatusView");
|
||||||
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPagination.qml"),uri,major,minor,"FluPagination");
|
||||||
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluToggleButton.qml"),uri,major,minor,"FluToggleButton");
|
||||||
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTableView.qml"),uri,major,minor,"FluTableView");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivotItem.qml"),uri,major,minor,"FluPivotItem");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivotItem.qml"),uri,major,minor,"FluPivotItem");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivot.qml"),uri,major,minor,"FluPivot");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPivot.qml"),uri,major,minor,"FluPivot");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFlipView.qml"),uri,major,minor,"FluFlipView");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluFlipView.qml"),uri,major,minor,"FluFlipView");
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
@ -43,11 +43,17 @@ Button {
|
|||||||
if(disabled){
|
if(disabled){
|
||||||
return Qt.rgba(131/255,131/255,131/255,1)
|
return Qt.rgba(131/255,131/255,131/255,1)
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return Qt.rgba(162/255,162/255,162/255,1)
|
||||||
|
}
|
||||||
return Qt.rgba(1,1,1,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
if(disabled){
|
if(disabled){
|
||||||
return Qt.rgba(160/255,160/255,160/255,1)
|
return Qt.rgba(160/255,160/255,160/255,1)
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return Qt.rgba(96/255,96/255,96/255,1)
|
||||||
|
}
|
||||||
return Qt.rgba(0,0,0,1)
|
return Qt.rgba(0,0,0,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property var clickFunc
|
property var clickFunc
|
||||||
@ -12,10 +12,13 @@ Button {
|
|||||||
property color borderSelectedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color borderSelectedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
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 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 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 normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
property color selectedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color selectedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(244/255,244/255,244/255,1)
|
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 selectedHoverColor: FluTheme.dark ? Qt.darker(selectedColor,1.1) : Qt.lighter(selectedColor,1.1)
|
property color selectedHoverColor: FluTheme.dark ? Qt.darker(selectedColor,1.15) : Qt.lighter(selectedColor,1.15)
|
||||||
|
property color selectedPreesedColor: FluTheme.dark ? Qt.darker(selectedColor,1.3) : Qt.lighter(selectedColor,1.3)
|
||||||
property color selectedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
property color selectedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||||
|
|
||||||
@ -52,6 +55,9 @@ Button {
|
|||||||
if(selected){
|
if(selected){
|
||||||
return borderSelectedColor
|
return borderSelectedColor
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return borderPressedColor
|
||||||
|
}
|
||||||
if(hovered){
|
if(hovered){
|
||||||
return borderHoverColor
|
return borderHoverColor
|
||||||
}
|
}
|
||||||
@ -63,6 +69,9 @@ Button {
|
|||||||
if(disabled){
|
if(disabled){
|
||||||
return selectedDisableColor
|
return selectedDisableColor
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return selectedPreesedColor
|
||||||
|
}
|
||||||
if(hovered){
|
if(hovered){
|
||||||
return selectedHoverColor
|
return selectedHoverColor
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
|
FluControl{
|
||||||
Button{
|
|
||||||
id:control
|
id:control
|
||||||
width: 36
|
width: 36
|
||||||
height: 36
|
height: 36
|
||||||
|
13
src/controls/FluControl.qml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Controls.impl
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
T.Button {
|
||||||
|
id: control
|
||||||
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||||
|
implicitContentWidth + leftPadding + rightPadding)
|
||||||
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||||
|
implicitContentHeight + topPadding + bottomPadding)
|
||||||
|
}
|
@ -3,7 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
@ -58,11 +58,17 @@ Button {
|
|||||||
if(disabled){
|
if(disabled){
|
||||||
return Qt.rgba(131/255,131/255,131/255,1)
|
return Qt.rgba(131/255,131/255,131/255,1)
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return Qt.rgba(162/255,162/255,162/255,1)
|
||||||
|
}
|
||||||
return Qt.rgba(1,1,1,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
if(disabled){
|
if(disabled){
|
||||||
return Qt.rgba(160/255,160/255,160/255,1)
|
return Qt.rgba(160/255,160/255,160/255,1)
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return Qt.rgba(96/255,96/255,96/255,1)
|
||||||
|
}
|
||||||
return Qt.rgba(0,0,0,1)
|
return Qt.rgba(0,0,0,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
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 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)
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
@ -27,6 +28,9 @@ Button {
|
|||||||
if(disabled){
|
if(disabled){
|
||||||
return disableColor
|
return disableColor
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return pressedColor
|
||||||
|
}
|
||||||
return hovered ? hoverColor :normalColor
|
return hovered ? hoverColor :normalColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -44,6 +48,5 @@ Button {
|
|||||||
return Qt.rgba(1,1,1,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
font.pixelSize: 14
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ Item{
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Button{
|
FluControl{
|
||||||
id:btn_start
|
id:btn_start
|
||||||
height: vertical ? 20 : 40
|
height: vertical ? 20 : 40
|
||||||
width: vertical ? 40 : 20
|
width: vertical ? 40 : 20
|
||||||
@ -82,7 +82,7 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button{
|
FluControl{
|
||||||
id:btn_end
|
id:btn_end
|
||||||
height: vertical ? 20 : 40
|
height: vertical ? 20 : 40
|
||||||
width: vertical ? 40 : 20
|
width: vertical ? 40 : 20
|
||||||
|
@ -2,19 +2,23 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property int iconSize: 20
|
property int iconSize: 20
|
||||||
property int iconSource
|
property int iconSource
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property int radius:4
|
property int radius:4
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(0,0,0,0.03)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(0,0,0,0.03)
|
||||||
|
property color pressedColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : 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 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 disableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||||
property color color: {
|
property color color: {
|
||||||
if(disabled){
|
if(disabled){
|
||||||
return disableColor
|
return disableColor
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return pressedColor
|
||||||
|
}
|
||||||
return hovered ? hoverColor : normalColor
|
return hovered ? hoverColor : normalColor
|
||||||
}
|
}
|
||||||
property color iconColor: {
|
property color iconColor: {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
TextArea{
|
FluTextArea{
|
||||||
|
|
||||||
property int fontStyle: FluText.Body
|
property int fontStyle: FluText.Body
|
||||||
property int pixelSize : FluTheme.textSize
|
property int pixelSize : FluTheme.textSize
|
||||||
|
@ -150,20 +150,20 @@ Item {
|
|||||||
}
|
}
|
||||||
color: {
|
color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(item_mouse.containsMouse){
|
|
||||||
return Qt.rgba(1,1,1,0.03)
|
|
||||||
}
|
|
||||||
if((nav_list.currentIndex === position)&&type===0){
|
if((nav_list.currentIndex === position)&&type===0){
|
||||||
return Qt.rgba(1,1,1,0.06)
|
return Qt.rgba(1,1,1,0.06)
|
||||||
}
|
}
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(1,1,1,0.03)
|
||||||
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
}else{
|
}else{
|
||||||
if(item_mouse.containsMouse){
|
|
||||||
return Qt.rgba(0,0,0,0.03)
|
|
||||||
}
|
|
||||||
if(nav_list.currentIndex === position&&type===0){
|
if(nav_list.currentIndex === position&&type===0){
|
||||||
return Qt.rgba(0,0,0,0.06)
|
return Qt.rgba(0,0,0,0.06)
|
||||||
}
|
}
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(0,0,0,0.03)
|
||||||
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,6 +193,12 @@ Item {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left:item_icon.right
|
left:item_icon.right
|
||||||
}
|
}
|
||||||
|
color:{
|
||||||
|
if(item_mouse.pressed){
|
||||||
|
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
|
||||||
|
}
|
||||||
|
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,7 +239,10 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(type===0){
|
if(type===0){
|
||||||
model.repTap()
|
if(model.tapFunc){
|
||||||
|
model.tapFunc()
|
||||||
|
return
|
||||||
|
}
|
||||||
if(nav_list.currentIndex !== position){
|
if(nav_list.currentIndex !== position){
|
||||||
nav_list.currentIndex = position
|
nav_list.currentIndex = position
|
||||||
model.tap()
|
model.tap()
|
||||||
@ -246,20 +255,20 @@ Item {
|
|||||||
}
|
}
|
||||||
color: {
|
color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(item_mouse.containsMouse){
|
|
||||||
return Qt.rgba(1,1,1,0.03)
|
|
||||||
}
|
|
||||||
if((nav_list.currentIndex === position)&&type===0){
|
if((nav_list.currentIndex === position)&&type===0){
|
||||||
return Qt.rgba(1,1,1,0.06)
|
return Qt.rgba(1,1,1,0.06)
|
||||||
}
|
}
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(1,1,1,0.03)
|
||||||
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
}else{
|
}else{
|
||||||
if(item_mouse.containsMouse){
|
|
||||||
return Qt.rgba(0,0,0,0.03)
|
|
||||||
}
|
|
||||||
if(nav_list.currentIndex === position&&type===0){
|
if(nav_list.currentIndex === position&&type===0){
|
||||||
return Qt.rgba(0,0,0,0.06)
|
return Qt.rgba(0,0,0,0.06)
|
||||||
}
|
}
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(0,0,0,0.03)
|
||||||
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -285,6 +294,12 @@ Item {
|
|||||||
FluText{
|
FluText{
|
||||||
id:item_title
|
id:item_title
|
||||||
text:model.title
|
text:model.title
|
||||||
|
color:{
|
||||||
|
if(item_mouse.pressed){
|
||||||
|
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
|
||||||
|
}
|
||||||
|
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||||
|
}
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left:item_icon.right
|
left:item_icon.right
|
||||||
|
112
src/controls/FluPagination.qml
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
|
||||||
|
signal requestPage(int page,int count)
|
||||||
|
property string previousText: "<上一页"
|
||||||
|
property string nextText: "下一页>"
|
||||||
|
property int pageCurrent: 0
|
||||||
|
property int itemCount: 0
|
||||||
|
property int pageCount: itemCount>0?Math.ceil(itemCount/__itemPerPage):0
|
||||||
|
property int __itemPerPage: 10
|
||||||
|
property int pageButtonCount: 5
|
||||||
|
property int __pageButtonHalf: Math.floor(pageButtonCount/2)+1
|
||||||
|
|
||||||
|
|
||||||
|
implicitHeight: 40
|
||||||
|
implicitWidth: content.width
|
||||||
|
|
||||||
|
Row{
|
||||||
|
id: content
|
||||||
|
height: control.height
|
||||||
|
spacing: 25
|
||||||
|
padding: 10
|
||||||
|
|
||||||
|
|
||||||
|
FluToggleButton{
|
||||||
|
visible: control.pageCount>1
|
||||||
|
disabled: control.pageCurrent<=1
|
||||||
|
text:control.previousText
|
||||||
|
onClicked: {
|
||||||
|
control.calcNewPage(control.pageCurrent-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
FluToggleButton{
|
||||||
|
property int pageNumber:1
|
||||||
|
visible: control.pageCount>0
|
||||||
|
enabled: control.pageCurrent>1
|
||||||
|
selected: pageNumber === control.pageCurrent
|
||||||
|
text:String(pageNumber)
|
||||||
|
onClicked: {
|
||||||
|
control.calcNewPage(pageNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
visible: (control.pageCount>control.pageButtonCount&&
|
||||||
|
control.pageCurrent>control.__pageButtonHalf)
|
||||||
|
text: "..."
|
||||||
|
}
|
||||||
|
Repeater{
|
||||||
|
id: button_repeator
|
||||||
|
model: (control.pageCount<2)?0:(control.pageCount>=control.pageButtonCount)?(control.pageButtonCount-2):(control.pageCount-2)
|
||||||
|
delegate:FluToggleButton{
|
||||||
|
property int pageNumber: {
|
||||||
|
return (control.pageCurrent<=control.__pageButtonHalf)
|
||||||
|
?(2+index)
|
||||||
|
:(control.pageCount-control.pageCurrent<=control.pageButtonCount-control.__pageButtonHalf)
|
||||||
|
?(control.pageCount-button_repeator.count+index)
|
||||||
|
:(control.pageCurrent+2+index-control.__pageButtonHalf)
|
||||||
|
}
|
||||||
|
text:String(pageNumber)
|
||||||
|
selected: pageNumber === control.pageCurrent
|
||||||
|
onClicked: {
|
||||||
|
control.calcNewPage(pageNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
visible: (control.pageCount>control.pageButtonCount&&
|
||||||
|
control.pageCount-control.pageCurrent>control.pageButtonCount-control.__pageButtonHalf)
|
||||||
|
text: "..."
|
||||||
|
}
|
||||||
|
FluToggleButton{
|
||||||
|
property int pageNumber:control.pageCount
|
||||||
|
visible: control.pageCount>1
|
||||||
|
selected: pageNumber === control.pageCurrent
|
||||||
|
text:String(pageNumber)
|
||||||
|
onClicked: {
|
||||||
|
control.calcNewPage(pageNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluToggleButton{
|
||||||
|
visible: control.pageCount>1
|
||||||
|
disabled: control.pageCurrent>=control.pageCount
|
||||||
|
text:control.nextText
|
||||||
|
onClicked: {
|
||||||
|
control.calcNewPage(control.pageCurrent+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function calcNewPage(page)
|
||||||
|
{
|
||||||
|
if(!page)
|
||||||
|
return
|
||||||
|
let page_num=Number(page)
|
||||||
|
if(page_num<1||page_num>control.pageCount||page_num===control.pageCurrent)
|
||||||
|
return
|
||||||
|
control.pageCurrent=page_num
|
||||||
|
control.requestPage(page_num,control.__itemPerPage)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -14,5 +14,5 @@ QtObject {
|
|||||||
property var parent
|
property var parent
|
||||||
property int idx
|
property int idx
|
||||||
signal tap
|
signal tap
|
||||||
signal repTap
|
property var tapFunc
|
||||||
}
|
}
|
||||||
|
@ -10,5 +10,4 @@ FluObject {
|
|||||||
property var parent
|
property var parent
|
||||||
property int idx
|
property int idx
|
||||||
signal tap
|
signal tap
|
||||||
signal repTap
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
|
FluControl {
|
||||||
Button {
|
|
||||||
|
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
@ -9,14 +9,6 @@ Item{
|
|||||||
property bool shadow: true
|
property bool shadow: true
|
||||||
default property alias contentItem: container.data
|
default property alias contentItem: container.data
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
id:container
|
|
||||||
width: control.width
|
|
||||||
height: control.height
|
|
||||||
opacity: 0
|
|
||||||
color:control.color
|
|
||||||
}
|
|
||||||
|
|
||||||
FluShadow{
|
FluShadow{
|
||||||
anchors.fill: container
|
anchors.fill: container
|
||||||
radius: control.radius[0]
|
radius: control.radius[0]
|
||||||
@ -28,6 +20,14 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
id:container
|
||||||
|
width: control.width
|
||||||
|
height: control.height
|
||||||
|
opacity: 0
|
||||||
|
color:control.color
|
||||||
|
}
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
id: canvas
|
id: canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -114,11 +114,9 @@ ScrollBar {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onEntered: {
|
onEntered: {
|
||||||
timer.restart()
|
timer.restart()
|
||||||
console.debug("onEntered")
|
|
||||||
}
|
}
|
||||||
onExited: {
|
onExited: {
|
||||||
timer.restart()
|
timer.restart()
|
||||||
console.debug("onExited")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
108
src/controls/FluStatusView.qml
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
Item{
|
||||||
|
|
||||||
|
enum StatusMode {
|
||||||
|
Loading,
|
||||||
|
Empty,
|
||||||
|
Error,
|
||||||
|
Success
|
||||||
|
}
|
||||||
|
default property alias content: container.data
|
||||||
|
property int statusMode: FluStatusView.Loading
|
||||||
|
signal errorClicked
|
||||||
|
|
||||||
|
Item{
|
||||||
|
id:container
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: statusMode === FluStatusView.Success
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
paddings: 0
|
||||||
|
border.width: 0
|
||||||
|
anchors.fill: container
|
||||||
|
visible: opacity
|
||||||
|
opacity: statusMode === FluStatusView.Loading
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation { duration: 150 }
|
||||||
|
}
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: statusMode === FluStatusView.Loading
|
||||||
|
FluProgressRing{
|
||||||
|
indeterminate: true
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"正在加载..."
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
paddings: 0
|
||||||
|
border.width: 0
|
||||||
|
anchors.fill: container
|
||||||
|
visible: opacity
|
||||||
|
opacity: statusMode === FluStatusView.Empty
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation { duration: 150 }
|
||||||
|
}
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: statusMode === FluStatusView.Empty
|
||||||
|
FluText{
|
||||||
|
text:"空空如也"
|
||||||
|
fontStyle: FluText.BodyStrong
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
paddings: 0
|
||||||
|
border.width: 0
|
||||||
|
anchors.fill: container
|
||||||
|
visible: opacity
|
||||||
|
opacity: statusMode === FluStatusView.Error
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation { duration: 150 }
|
||||||
|
}
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
FluText{
|
||||||
|
text:"页面出错了..."
|
||||||
|
fontStyle: FluText.BodyStrong
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
}
|
||||||
|
FluFilledButton{
|
||||||
|
id:btn_error
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
text:"重新加载"
|
||||||
|
onClicked:{
|
||||||
|
errorClicked.call()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function showSuccessView(){
|
||||||
|
statusMode = FluStatusView.Success
|
||||||
|
}
|
||||||
|
function showLoadingView(){
|
||||||
|
statusMode = FluStatusView.Loading
|
||||||
|
}
|
||||||
|
function showEmptyView(){
|
||||||
|
statusMode = FluStatusView.Empty
|
||||||
|
}
|
||||||
|
function showErrorView(){
|
||||||
|
statusMode = FluStatusView.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
193
src/controls/FluTableView.qml
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
Item {
|
||||||
|
|
||||||
|
id:control
|
||||||
|
property var columns : []
|
||||||
|
property var dataSource : []
|
||||||
|
property int pageCurrent: 1
|
||||||
|
property int itemCount: 1000
|
||||||
|
property int pageCount: 10
|
||||||
|
property int itemHeight: 56
|
||||||
|
signal requestPage(int page,int count)
|
||||||
|
|
||||||
|
implicitHeight: layout_coumns.height + layout_table.height
|
||||||
|
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
preventStealing: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel{
|
||||||
|
id:model_coumns
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel{
|
||||||
|
id:model_data_source
|
||||||
|
}
|
||||||
|
|
||||||
|
onColumnsChanged: {
|
||||||
|
model_coumns.clear()
|
||||||
|
model_coumns.append(columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
onDataSourceChanged: {
|
||||||
|
model_data_source.clear()
|
||||||
|
model_data_source.append(dataSource)
|
||||||
|
}
|
||||||
|
|
||||||
|
FluRectangle{
|
||||||
|
id:layout_coumns
|
||||||
|
height: control.itemHeight
|
||||||
|
width: parent.width
|
||||||
|
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
|
radius: [12,12,0,0]
|
||||||
|
|
||||||
|
Row{
|
||||||
|
id:list_coumns
|
||||||
|
spacing: 0
|
||||||
|
anchors.fill: parent
|
||||||
|
Repeater{
|
||||||
|
model: model_coumns
|
||||||
|
delegate: Item{
|
||||||
|
height: list_coumns.height
|
||||||
|
width: model.width
|
||||||
|
FluText{
|
||||||
|
text:model.title
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
leftMargin: 14
|
||||||
|
}
|
||||||
|
fontStyle: FluText.BodyStrong
|
||||||
|
}
|
||||||
|
FluDivider{
|
||||||
|
width: 1
|
||||||
|
height: 40
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: index !== list_coumns.count-1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: layout_table
|
||||||
|
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView{
|
||||||
|
id:layout_table
|
||||||
|
anchors{
|
||||||
|
top: layout_coumns.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
height: contentHeight
|
||||||
|
clip:true
|
||||||
|
footer: Item{
|
||||||
|
height: 50
|
||||||
|
width: layout_table.width
|
||||||
|
FluPagination{
|
||||||
|
id:pagination
|
||||||
|
height: 40
|
||||||
|
pageCurrent: control.pageCurrent
|
||||||
|
itemCount: control.itemCount
|
||||||
|
pageCount: control.pageCount
|
||||||
|
onRequestPage:
|
||||||
|
(page,count)=> {
|
||||||
|
control.requestPage(page,count)
|
||||||
|
}
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model:model_data_source
|
||||||
|
delegate: Item{
|
||||||
|
height: list_coumns.height
|
||||||
|
width: layout_table.width
|
||||||
|
property var model_values : getObjectValues(index)
|
||||||
|
property var itemObject: getObject(index)
|
||||||
|
property var listModel: model
|
||||||
|
Row{
|
||||||
|
spacing: 0
|
||||||
|
anchors.fill: parent
|
||||||
|
Repeater{
|
||||||
|
model: model_values
|
||||||
|
delegate:Item{
|
||||||
|
height: list_coumns.height
|
||||||
|
width: modelData.width
|
||||||
|
Loader{
|
||||||
|
property var model : modelData
|
||||||
|
property var dataModel : listModel
|
||||||
|
property var dataObject : itemObject
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceComponent: {
|
||||||
|
if(model.itemData instanceof Component){
|
||||||
|
return model.itemData
|
||||||
|
}
|
||||||
|
return com_text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluDivider{
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id:com_text
|
||||||
|
Item{
|
||||||
|
MouseArea{
|
||||||
|
id:item_mouse
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:String(model.itemData)
|
||||||
|
width: parent.width - 14
|
||||||
|
elide: Text.ElideRight
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
leftMargin: 14
|
||||||
|
}
|
||||||
|
FluTooltip{
|
||||||
|
visible: item_mouse.containsMouse
|
||||||
|
text:parent.text
|
||||||
|
delay: 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getObject(index){
|
||||||
|
return model_data_source.get(index)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getObjectValues(index) {
|
||||||
|
var obj = model_data_source.get(index)
|
||||||
|
if(!obj)
|
||||||
|
return
|
||||||
|
var data = []
|
||||||
|
for(var i=0;i<model_coumns.count;i++){
|
||||||
|
var item = model_coumns.get(i)
|
||||||
|
data.push({itemData:obj[item.dataIndex],width:item.width})
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -4,7 +4,7 @@ import FluentUI
|
|||||||
Text {
|
Text {
|
||||||
|
|
||||||
property int fontStyle: FluText.Body
|
property int fontStyle: FluText.Body
|
||||||
property color textColor: FluTheme.dark ? "#FFFFFF" : "#1A1A1A"
|
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||||
property int pixelSize : FluTheme.textSize
|
property int pixelSize : FluTheme.textSize
|
||||||
|
|
||||||
enum FontStyle {
|
enum FontStyle {
|
||||||
|
38
src/controls/FluTextArea.qml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls.impl
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
|
||||||
|
T.TextArea {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
|
||||||
|
implicitBackgroundWidth + leftInset + rightInset,
|
||||||
|
placeholder.implicitWidth + leftPadding + rightPadding)
|
||||||
|
implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
|
||||||
|
implicitBackgroundHeight + topInset + bottomInset,
|
||||||
|
placeholder.implicitHeight + topPadding + bottomPadding)
|
||||||
|
|
||||||
|
padding: 6
|
||||||
|
leftPadding: padding + 4
|
||||||
|
|
||||||
|
color: control.palette.text
|
||||||
|
placeholderTextColor: control.palette.placeholderText
|
||||||
|
selectionColor: control.palette.highlight
|
||||||
|
selectedTextColor: control.palette.highlightedText
|
||||||
|
|
||||||
|
PlaceholderText {
|
||||||
|
id: placeholder
|
||||||
|
x: control.leftPadding
|
||||||
|
y: control.topPadding
|
||||||
|
width: control.width - (control.leftPadding + control.rightPadding)
|
||||||
|
height: control.height - (control.topPadding + control.bottomPadding)
|
||||||
|
|
||||||
|
text: control.placeholderText
|
||||||
|
font: control.font
|
||||||
|
color: control.placeholderTextColor
|
||||||
|
verticalAlignment: control.verticalAlignment
|
||||||
|
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
|
||||||
|
elide: Text.ElideRight
|
||||||
|
renderType: control.renderType
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
TextField{
|
FluTextFiled{
|
||||||
|
|
||||||
property int fontStyle: FluText.Body
|
property int fontStyle: FluText.Body
|
||||||
property int pixelSize : FluTheme.textSize
|
property int pixelSize : FluTheme.textSize
|
||||||
|
@ -11,7 +11,7 @@ FluMenu{
|
|||||||
focus: false
|
focus: false
|
||||||
FluMenuItem{
|
FluMenuItem{
|
||||||
text: cutText
|
text: cutText
|
||||||
visible: inputItem.text !== ""
|
visible: inputItem.text !== "" && !inputItem.readOnly
|
||||||
onClicked: {
|
onClicked: {
|
||||||
inputItem.cut()
|
inputItem.cut()
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.3) : Qt.lighter(normalColor,1.3)
|
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 disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
property bool textBold: true
|
property bool textBold: true
|
||||||
|
|
||||||
@ -36,6 +37,9 @@ Button {
|
|||||||
if(disabled){
|
if(disabled){
|
||||||
return disableColor
|
return disableColor
|
||||||
}
|
}
|
||||||
|
if(pressed){
|
||||||
|
return pressedColor
|
||||||
|
}
|
||||||
return hovered ? hoverColor :normalColor
|
return hovered ? hoverColor :normalColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
46
src/controls/FluTextFiled.qml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls.impl
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
|
||||||
|
T.TextField {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||||
|
|| Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding
|
||||||
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||||
|
contentHeight + topPadding + bottomPadding,
|
||||||
|
placeholder.implicitHeight + topPadding + bottomPadding)
|
||||||
|
|
||||||
|
padding: 6
|
||||||
|
leftPadding: padding + 4
|
||||||
|
|
||||||
|
color: control.palette.text
|
||||||
|
selectionColor: control.palette.highlight
|
||||||
|
selectedTextColor: control.palette.highlightedText
|
||||||
|
placeholderTextColor: control.palette.placeholderText
|
||||||
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
|
||||||
|
PlaceholderText {
|
||||||
|
id: placeholder
|
||||||
|
x: control.leftPadding
|
||||||
|
y: control.topPadding
|
||||||
|
width: control.width - (control.leftPadding + control.rightPadding)
|
||||||
|
height: control.height - (control.topPadding + control.bottomPadding)
|
||||||
|
|
||||||
|
text: control.placeholderText
|
||||||
|
font: control.font
|
||||||
|
color: control.placeholderTextColor
|
||||||
|
verticalAlignment: control.verticalAlignment
|
||||||
|
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
|
||||||
|
elide: Text.ElideRight
|
||||||
|
renderType: control.renderType
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
implicitWidth: 200
|
||||||
|
implicitHeight: 40
|
||||||
|
border.width: control.activeFocus ? 2 : 1
|
||||||
|
color: control.palette.base
|
||||||
|
border.color: control.activeFocus ? control.palette.highlight : control.palette.mid
|
||||||
|
}
|
||||||
|
}
|
100
src/controls/FluToggleButton.qml
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluControl {
|
||||||
|
|
||||||
|
property bool disabled: false
|
||||||
|
property bool selected: false
|
||||||
|
property color normalColor: {
|
||||||
|
if(selected){
|
||||||
|
return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
|
}else{
|
||||||
|
return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
property color hoverColor: {
|
||||||
|
if(selected){
|
||||||
|
return FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
||||||
|
}else{
|
||||||
|
return FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
property color disableColor: {
|
||||||
|
if(selected){
|
||||||
|
return FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
|
}else{
|
||||||
|
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2)
|
||||||
|
|
||||||
|
id: control
|
||||||
|
enabled: !disabled
|
||||||
|
topPadding:5
|
||||||
|
bottomPadding:5
|
||||||
|
leftPadding:15
|
||||||
|
rightPadding:15
|
||||||
|
Keys.onSpacePressed: control.visualFocus&&clicked()
|
||||||
|
focusPolicy:Qt.TabFocus
|
||||||
|
background: Rectangle{
|
||||||
|
radius: 4
|
||||||
|
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
||||||
|
border.width: selected ? 0 : 1
|
||||||
|
FluFocusRectangle{
|
||||||
|
visible: control.visualFocus
|
||||||
|
radius:8
|
||||||
|
}
|
||||||
|
color:{
|
||||||
|
if(disabled){
|
||||||
|
return disableColor
|
||||||
|
}
|
||||||
|
if(selected){
|
||||||
|
if(pressed){
|
||||||
|
return pressedColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hovered ? hoverColor :normalColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
contentItem: FluText {
|
||||||
|
text: control.text
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
color: {
|
||||||
|
if(selected){
|
||||||
|
if(FluTheme.dark){
|
||||||
|
if(disabled){
|
||||||
|
return Qt.rgba(173/255,173/255,173/255,1)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,1)
|
||||||
|
}else{
|
||||||
|
return Qt.rgba(1,1,1,1)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(FluTheme.dark){
|
||||||
|
if(disabled){
|
||||||
|
return Qt.rgba(131/255,131/255,131/255,1)
|
||||||
|
}
|
||||||
|
if(!selected){
|
||||||
|
if(pressed){
|
||||||
|
return Qt.rgba(162/255,162/255,162/255,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Qt.rgba(1,1,1,1)
|
||||||
|
}else{
|
||||||
|
if(disabled){
|
||||||
|
return Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
}
|
||||||
|
if(!selected){
|
||||||
|
if(pressed){
|
||||||
|
return Qt.rgba(96/255,96/255,96/255,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
Button {
|
FluControl {
|
||||||
|
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property var clickFunc
|
property var clickFunc
|
||||||
|
@ -64,5 +64,12 @@
|
|||||||
<file>controls/FluFlipView.qml</file>
|
<file>controls/FluFlipView.qml</file>
|
||||||
<file>controls/FluPivot.qml</file>
|
<file>controls/FluPivot.qml</file>
|
||||||
<file>controls/FluPivotItem.qml</file>
|
<file>controls/FluPivotItem.qml</file>
|
||||||
|
<file>controls/FluControl.qml</file>
|
||||||
|
<file>controls/FluTextFiled.qml</file>
|
||||||
|
<file>controls/FluTextArea.qml</file>
|
||||||
|
<file>controls/FluTableView.qml</file>
|
||||||
|
<file>controls/FluPagination.qml</file>
|
||||||
|
<file>controls/FluToggleButton.qml</file>
|
||||||
|
<file>controls/FluStatusView.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|