mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 09:35:28 +08:00
Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
47ab4dabbd | |||
206669e5f0 | |||
08457dc75e | |||
0c59a233ea | |||
fcb8da2c50 | |||
a8701256d4 | |||
8eaa4b6cbb | |||
af80a882d0 | |||
9d89328a43 | |||
0d4477437f | |||
6b3e73ce0b | |||
625bc74e26 | |||
731e4f27b4 | |||
fce64eccc6 | |||
689e0805e7 | |||
986f1242dd | |||
a9c97a5c56 | |||
81e78834d0 | |||
5279a2c7b2 | |||
6391fc8dc6 | |||
9cf4b4b1af | |||
32c0b4ccd6 | |||
b2bfdd17da | |||
27db8160d4 | |||
ed0c9048b0 | |||
de2c891912 | |||
16daeb5268 | |||
0b37ddcb6e | |||
d2e3e6dd4b | |||
1e5bd75123 | |||
1b97b197a4 | |||
936a310ca6 | |||
3236be8a7f | |||
2008e0f524 | |||
4e53936bb7 | |||
eb758f7765 | |||
1ab69e401a | |||
e014aa774d | |||
0595e2e640 | |||
b5894158d2 | |||
4829ce58fd | |||
b5f44f4f7d | |||
cbd4c229aa | |||
7720208d17 | |||
9790ae12eb | |||
37ae17d92d | |||
036450f0a3 | |||
5a1b10fef8 | |||
a33a63abc9 |
25
.github/workflows/macos.yml
vendored
25
.github/workflows/macos.yml
vendored
@ -16,24 +16,25 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11.0]
|
os: [macos-12]
|
||||||
qt_ver: [5.15.2]
|
qt_ver: [6.4.3]
|
||||||
qt_arch: [clang_64]
|
qt_arch: [clang_64]
|
||||||
env:
|
env:
|
||||||
targetName: example
|
targetName: example
|
||||||
steps:
|
steps:
|
||||||
# macos 11.0 默认环境变了,要指定
|
- name: '⚙️ Cache Qt'
|
||||||
- name: prepare env
|
id: cache-qt
|
||||||
if: ${{ matrix.os == 'macos-11.0' }}
|
uses: actions/cache@v3
|
||||||
run: |
|
with:
|
||||||
softwareupdate --all --install --force
|
path: ${{ runner.workspace }}/Qt
|
||||||
sudo xcode-select --print-path
|
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
|
||||||
sudo xcode-select --switch /Library/Developer/CommandLineTools
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v2
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
cached: 'false'
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
|
arch: ${{ matrix.qt_arch }}
|
||||||
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
@ -58,6 +59,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: bin/release/${{ env.targetName }}.dmg
|
file: bin/release/${{ env.targetName }}.dmg
|
||||||
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.dmg
|
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.dmg
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
18
.github/workflows/ubuntu.yml
vendored
18
.github/workflows/ubuntu.yml
vendored
@ -19,16 +19,24 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04]
|
os: [ubuntu-20.04]
|
||||||
qt_ver: [5.15.2]
|
qt_ver: [6.4.3]
|
||||||
qt_arch: [gcc_64]
|
qt_arch: [gcc_64]
|
||||||
env:
|
env:
|
||||||
targetName: example
|
targetName: example
|
||||||
steps:
|
steps:
|
||||||
|
- name: '⚙️ Cache Qt'
|
||||||
|
id: cache-qt
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ runner.workspace }}/Qt
|
||||||
|
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v2
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
cached: 'false'
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
|
arch: ${{ matrix.qt_arch }}
|
||||||
|
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 libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -42,6 +50,8 @@ jobs:
|
|||||||
uses: miurahr/install-linuxdeploy-action@v1
|
uses: miurahr/install-linuxdeploy-action@v1
|
||||||
with:
|
with:
|
||||||
plugins: qt appimage
|
plugins: qt appimage
|
||||||
|
- name: Check if svg file exists
|
||||||
|
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
|
||||||
# 打包
|
# 打包
|
||||||
- name: package
|
- name: package
|
||||||
run: |
|
run: |
|
||||||
@ -62,6 +72,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: ${{ env.targetName }}.AppImage
|
file: ${{ env.targetName }}.AppImage
|
||||||
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.AppImage
|
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.AppImage
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
76
.github/workflows/windows-mingw.yml
vendored
Normal file
76
.github/workflows/windows-mingw.yml
vendored
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
name: Windows MinGW
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '*.pro'
|
||||||
|
- 'src/**'
|
||||||
|
- '.github/workflows/windows-mingw.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '*.pro'
|
||||||
|
- 'src/**'
|
||||||
|
- '.github/workflows/windows-mingw.yml'
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: windows-2022
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- qt_arch: win64_mingw
|
||||||
|
qt_ver: 6.4.3
|
||||||
|
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||||||
|
qt_tools_mingw_install: mingw900_64
|
||||||
|
env:
|
||||||
|
targetName: example.exe
|
||||||
|
fileName: example
|
||||||
|
steps:
|
||||||
|
- name: Install Qt
|
||||||
|
uses: jurplel/install-qt-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.qt_ver }}
|
||||||
|
arch: ${{ matrix.qt_arch }}
|
||||||
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Qt6 environment configuration
|
||||||
|
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Output "${{ env.Qt6_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
Write-Output "${{ env.Qt6_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
- name: where is qmake & where is mingw32-make
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Get-Command -Name 'qmake' | Format-List
|
||||||
|
Get-Command -Name 'mingw32-make' | Format-List
|
||||||
|
- name: mingw-build
|
||||||
|
id: build
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
qmake
|
||||||
|
mingw32-make
|
||||||
|
- name: package
|
||||||
|
id: package
|
||||||
|
env:
|
||||||
|
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}
|
||||||
|
$name = ${env:archiveName}
|
||||||
|
echo "::set-output name=packageName::$name"
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ steps.package.outputs.packageName }}
|
||||||
|
path: ${{ steps.package.outputs.packageName }}
|
||||||
|
- name: uploadRelease
|
||||||
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ${{ steps.package.outputs.packageName }}.zip
|
||||||
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.zip
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
27
.github/workflows/windows.yml
vendored
27
.github/workflows/windows.yml
vendored
@ -16,17 +16,13 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
# 运行平台, windows-latest目前是windows server 2019
|
# 运行平台, windows-latest目前是windows server 2019
|
||||||
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
|
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
|
||||||
runs-on: windows-2019
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
# 矩阵配置
|
# 矩阵配置
|
||||||
matrix:
|
matrix:
|
||||||
|
os: [windows-2019]
|
||||||
include:
|
include:
|
||||||
# 5.15.2 参考 https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/windows_x86/desktop/qt5_5152/
|
- qt_ver: 6.4.3
|
||||||
- qt_ver: 5.15.2
|
|
||||||
qt_arch: win32_msvc2019
|
|
||||||
msvc_arch: x86
|
|
||||||
qt_arch_install: msvc2019
|
|
||||||
- qt_ver: 5.15.2
|
|
||||||
qt_arch: win64_msvc2019_64
|
qt_arch: win64_msvc2019_64
|
||||||
msvc_arch: x64
|
msvc_arch: x64
|
||||||
qt_arch_install: msvc2019_64
|
qt_arch_install: msvc2019_64
|
||||||
@ -35,18 +31,21 @@ jobs:
|
|||||||
fileName: example
|
fileName: example
|
||||||
# 步骤
|
# 步骤
|
||||||
steps:
|
steps:
|
||||||
|
- name: '⚙️ Cache Qt'
|
||||||
|
id: cache-qt
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ runner.workspace }}\Qt
|
||||||
|
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
|
||||||
# 安装Qt
|
# 安装Qt
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
# 使用外部action。这个action专门用来安装Qt
|
# 使用外部action。这个action专门用来安装Qt
|
||||||
uses: jurplel/install-qt-action@v2
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
# Version of Qt to install
|
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
# Target platform for build
|
|
||||||
# target: ${{ matrix.qt_target }}
|
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
cached: 'false'
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
aqtversion: '==2.0.5'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
# 拉取代码
|
# 拉取代码
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@ -88,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: ${{ steps.package.outputs.packageName }}.zip
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,3 +33,4 @@ CMakeLists.txt.user*
|
|||||||
|
|
||||||
src/build-preset/plugins.qmltypes
|
src/build-preset/plugins.qmltypes
|
||||||
bin
|
bin
|
||||||
|
.DS_Store
|
5
CMakeLists.txt
Normal file
5
CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(FluentUI VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(example)
|
21
License
Normal file
21
License
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 zhuzichu
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
@ -65,9 +65,9 @@
|
|||||||
|
|
||||||
# 部分效果预览
|
# 部分效果预览
|
||||||
|
|
||||||
## 一个聊天Demo,调用了ChatGPT的接口
|
## 首页
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 各种Button按钮
|
## 各种Button按钮
|
||||||
|
|
||||||
|
BIN
doc/preview/home.png
Normal file
BIN
doc/preview/home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
@ -1,13 +1,15 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtGraphicalEffects 1.15
|
import QtMultimedia
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
id:app
|
id:app
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
//初始化一个MediaPlayer,解决macos切换到T_MediaPalyer页面崩溃问题
|
||||||
|
MediaPlayer{}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
FluApp.init(app,properties)
|
FluApp.init(app,properties)
|
||||||
FluTheme.frameless = ("windows" === Qt.platform.os)
|
FluTheme.frameless = ("windows" === Qt.platform.os)
|
||||||
@ -17,6 +19,7 @@ Window {
|
|||||||
"/about":"qrc:/page/AboutPage.qml",
|
"/about":"qrc:/page/AboutPage.qml",
|
||||||
"/login":"qrc:/page/LoginPage.qml",
|
"/login":"qrc:/page/LoginPage.qml",
|
||||||
"/chat":"qrc:/page/ChatPage.qml",
|
"/chat":"qrc:/page/ChatPage.qml",
|
||||||
|
"/media":"qrc:/page/MediaPage.qml",
|
||||||
}
|
}
|
||||||
FluApp.initialRoute = "/"
|
FluApp.initialRoute = "/"
|
||||||
FluApp.run()
|
FluApp.run()
|
||||||
|
86
example/CMakeLists.txt
Normal file
86
example/CMakeLists.txt
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(example)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
set(platform 64)
|
||||||
|
else()
|
||||||
|
set(platform 32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/debug)
|
||||||
|
else()
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/release)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Qt6 COMPONENTS Core Quick QuickControls2 Concurrent Network Multimedia REQUIRED)
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
|
ChatController.cpp
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(HEADERS
|
||||||
|
ChatController.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(RESOURCES
|
||||||
|
qml.qrc
|
||||||
|
)
|
||||||
|
|
||||||
|
set(RC_ICONS
|
||||||
|
favicon.ico
|
||||||
|
)
|
||||||
|
|
||||||
|
qt_add_resources(QT_RESOURCES ${RESOURCES})
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${QT_RESOURCES} ${RC_ICONS})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
if(platform EQUAL 32)
|
||||||
|
file(GLOB DLL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../third/Win_x86/*.dll)
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
${DLL_FILES}
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
file(GLOB DLL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../third/Win_x64/*.dll)
|
||||||
|
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
|
||||||
|
QT_DEPRECATED_WARNINGS
|
||||||
|
QT_NO_WARNING_OUTPUT
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Qt6::Core
|
||||||
|
Qt6::Quick
|
||||||
|
Qt6::QuickControls2
|
||||||
|
Qt6::Concurrent
|
||||||
|
Qt6::Network
|
||||||
|
Qt6::Multimedia
|
||||||
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE UNICODE WIN32 _WINDOWS)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
MACOSX_BUNDLE_INFO_PLIST Info.plist
|
||||||
|
)
|
||||||
|
endif()
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluContentPage {
|
FluContentPage {
|
||||||
|
|
||||||
@ -67,7 +67,6 @@ FluContentPage {
|
|||||||
width:parent.width
|
width:parent.width
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
text: modelData.name
|
text: modelData.name
|
||||||
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -14,7 +13,7 @@ FluScrollablePage{
|
|||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 106
|
height: 106
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
title:"Buttons"
|
title:"Buttons"
|
||||||
@ -19,7 +19,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -27,7 +27,6 @@ FluScrollablePage{
|
|||||||
disabled:text_button_switch.selected
|
disabled:text_button_switch.selected
|
||||||
text:"Text Button"
|
text:"Text Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.debug(Screen.devicePixelRatio)
|
|
||||||
showInfo("点击Text Button")
|
showInfo("点击Text Button")
|
||||||
}
|
}
|
||||||
anchors{
|
anchors{
|
||||||
@ -51,7 +50,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -82,7 +81,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -114,7 +113,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -146,7 +145,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 100
|
height: 100
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -229,7 +228,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
@ -256,6 +255,4 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ FluScrollablePage{
|
|||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 350
|
height: 350
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -21,7 +21,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ FluScrollablePage{
|
|||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 370
|
height: 370
|
||||||
paddings: 10
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -13,7 +13,11 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluCheckBox{
|
FluCheckBox{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 10
|
|
||||||
Layout.bottomMargin: 20
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluCheckBox{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
text:"Text"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ FluScrollablePage{
|
|||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 280
|
height: 280
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -40,7 +39,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 60
|
height: 60
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ FluScrollablePage{
|
|||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -36,7 +36,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -46,13 +45,15 @@ FluScrollablePage{
|
|||||||
headerText:"打开一个滑动文本框"
|
headerText:"打开一个滑动文本框"
|
||||||
Item{
|
Item{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
ScrollView{
|
Flickable{
|
||||||
id:scrollview
|
id:scrollview
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
contentWidth: parent.width
|
contentWidth: width
|
||||||
|
contentHeight: text_info.height
|
||||||
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
FluText{
|
FluText{
|
||||||
id:test
|
id:text_info
|
||||||
width: scrollview.width
|
width: scrollview.width
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
padding: 14
|
padding: 14
|
||||||
|
78
example/T_FlipView.qml
Normal file
78
example/T_FlipView.qml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"FlipView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 340
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluText{
|
||||||
|
text:"水平方向的FlipView"
|
||||||
|
}
|
||||||
|
FluFlipView{
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
sourceSize: Qt.size(400,300)
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_2.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_3.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 340
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluText{
|
||||||
|
text:"垂直方向的FlipView"
|
||||||
|
}
|
||||||
|
FluFlipView{
|
||||||
|
vertical:true
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
sourceSize: Qt.size(400,300)
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_2.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/res/image/banner_3.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,8 +1,9 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import "qrc:///global/"
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -56,7 +57,6 @@ FluScrollablePage{
|
|||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
orientation: ListView.Horizontal
|
orientation: ListView.Horizontal
|
||||||
boundsBehavior: ListView.StopAtBounds
|
|
||||||
height: 240
|
height: 240
|
||||||
model: model_header
|
model: model_header
|
||||||
header: Item{height: 10;width: 10}
|
header: Item{height: 10;width: 10}
|
||||||
@ -101,7 +101,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text: model.title
|
text: model.title
|
||||||
fontStyle: FluText.BodyLarge
|
fontStyle: FluText.Body
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 20
|
Layout.leftMargin: 20
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 5
|
Layout.topMargin: 5
|
||||||
Layout.preferredWidth: 160
|
Layout.preferredWidth: 160
|
||||||
Layout.leftMargin: 20
|
Layout.leftMargin: 20
|
||||||
color: FluColors.Grey100
|
color: FluColors.Grey120
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ FluScrollablePage{
|
|||||||
id:item_mouse
|
id:item_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onWheel: {
|
onWheel: (wheel)=>{
|
||||||
if (wheel.angleDelta.y > 0) scrollbar_header.decrease()
|
if (wheel.angleDelta.y > 0) scrollbar_header.decrease()
|
||||||
else scrollbar_header.increase()
|
else scrollbar_header.increase()
|
||||||
}
|
}
|
||||||
@ -142,44 +142,6 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_added
|
|
||||||
ListElement{
|
|
||||||
title:"TabView"
|
|
||||||
icon:"qrc:/res/image/control/TabView.png"
|
|
||||||
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
|
||||||
}
|
|
||||||
ListElement{
|
|
||||||
title:"MediaPlayer"
|
|
||||||
icon:"qrc:/res/image/control/MediaPlayerElement.png"
|
|
||||||
desc:"A control to display video and image content"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_update
|
|
||||||
ListElement{
|
|
||||||
title:"Buttons"
|
|
||||||
icon:"qrc:/res/image/control/Button.png"
|
|
||||||
desc:"A control that responds to user input and raisesa Click event."
|
|
||||||
}
|
|
||||||
ListElement{
|
|
||||||
title:"InfoBar"
|
|
||||||
icon:"qrc:/res/image/control/InfoBar.png"
|
|
||||||
desc:"An inline message to display app-wide statuschange information."
|
|
||||||
}
|
|
||||||
ListElement{
|
|
||||||
title:"Slider"
|
|
||||||
icon:"qrc:/res/image/control/Slider.png"
|
|
||||||
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
|
|
||||||
}
|
|
||||||
ListElement{
|
|
||||||
title:"CheckBox"
|
|
||||||
icon:"qrc:/res/image/control/Checkbox.png"
|
|
||||||
desc:"A control that a user can select or clear."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_item
|
id:com_item
|
||||||
Item{
|
Item{
|
||||||
@ -211,7 +173,7 @@ FluScrollablePage{
|
|||||||
id:item_icon
|
id:item_icon
|
||||||
height: 40
|
height: 40
|
||||||
width: 40
|
width: 40
|
||||||
source: model.icon
|
source: modelData.image
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 20
|
leftMargin: 20
|
||||||
@ -221,8 +183,8 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_title
|
id:item_title
|
||||||
text:model.title
|
text:modelData.title
|
||||||
fontStyle: FluText.Subtitle
|
fontStyle: FluText.BodyStrong
|
||||||
anchors{
|
anchors{
|
||||||
left: item_icon.right
|
left: item_icon.right
|
||||||
leftMargin: 20
|
leftMargin: 20
|
||||||
@ -232,10 +194,11 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_desc
|
id:item_desc
|
||||||
text:model.desc
|
text:modelData.desc
|
||||||
color:FluColors.Grey100
|
color:FluColors.Grey120
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
fontStyle: FluText.Caption
|
||||||
maximumLineCount: 2
|
maximumLineCount: 2
|
||||||
anchors{
|
anchors{
|
||||||
left: item_title.left
|
left: item_title.left
|
||||||
@ -246,12 +209,25 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
height: 12
|
||||||
|
width: 12
|
||||||
|
radius: 6
|
||||||
|
color: FluTheme.primaryColor.dark
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
top: parent.top
|
||||||
|
rightMargin: 14
|
||||||
|
topMargin: 14
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:item_mouse
|
id:item_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
rootwindow.startPageByTitle(model.title)
|
ItemsOriginal.startPageByItem(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +236,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text: "Recently added samples"
|
text: "Recently added samples"
|
||||||
fontStyle: FluText.TitleLarge
|
fontStyle: FluText.Title
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 20
|
Layout.leftMargin: 20
|
||||||
}
|
}
|
||||||
@ -270,14 +246,14 @@ FluScrollablePage{
|
|||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
boundsBehavior: GridView.StopAtBounds
|
model:ItemsOriginal.getRecentlyAddedData()
|
||||||
model:model_added
|
interactive: false
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text: "Recently updated samples"
|
text: "Recently updated samples"
|
||||||
fontStyle: FluText.TitleLarge
|
fontStyle: FluText.Title
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 20
|
Layout.leftMargin: 20
|
||||||
}
|
}
|
||||||
@ -287,8 +263,8 @@ FluScrollablePage{
|
|||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
boundsBehavior: GridView.StopAtBounds
|
interactive: false
|
||||||
model: model_update
|
model: ItemsOriginal.getRecentlyUpdatedData()
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -21,7 +20,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 320
|
height: 320
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -30,17 +29,28 @@ FluScrollablePage{
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left:parent.left
|
left:parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
FluMediaPlayer{
|
FluMediaPlayer{
|
||||||
id:player
|
id:player
|
||||||
// source:"http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4"
|
|
||||||
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
||||||
// source:"http://video.chinanews.com/flv/2019/04/23/400/111773_web.mp4"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
Layout.topMargin: 20
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"跳转到视频播放器窗口"
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClicked:{
|
||||||
|
FluApp.navigate("/media",{source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 100
|
height: 100
|
||||||
paddings: 10
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
@ -48,7 +48,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 130
|
height: 130
|
||||||
paddings: 10
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
@ -75,6 +75,4 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
51
example/T_Pivot.qml
Normal file
51
example/T_Pivot.qml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Pivot"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 400
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
FluPivot{
|
||||||
|
anchors.fill: parent
|
||||||
|
FluPivotItem{
|
||||||
|
title:"All"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"All emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem{
|
||||||
|
title:"Unread"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"Unread emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem{
|
||||||
|
title:"Flagged"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"Flagged emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem{
|
||||||
|
title:"Urgent"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"Urgent emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"配合图片使用"
|
text:"配合图片使用"
|
||||||
fontStyle: FluText.Subtitle
|
fontStyle: FluText.SubTitle
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
RowLayout{
|
RowLayout{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ FluScrollablePage{
|
|||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
}
|
}
|
||||||
FluSlider{
|
FluSlider{
|
||||||
orientation:FluSlider.Vertical
|
vertical:true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
Layout.bottomMargin: 20
|
Layout.bottomMargin: 20
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -11,6 +11,8 @@ FluScrollablePage{
|
|||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
|
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_page
|
id:com_page
|
||||||
Rectangle{
|
Rectangle{
|
||||||
@ -19,26 +21,93 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function newTab(){
|
||||||
|
tab_view.appendTab("qrc:/res/image/favicon.ico","Document "+tab_view.count(),com_page,colors[Math.floor(Math.random() * 8)].dark)
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var colors = [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
newTab()
|
||||||
for(var i =0;i<colors.length;i++){
|
newTab()
|
||||||
tab_view.appendTab("","Document "+i,com_page,colors[i].dark)
|
newTab()
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 50
|
||||||
|
paddings: 10
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
FluDropDownButton{
|
||||||
|
id:btn_tab_width_behavior
|
||||||
|
Layout.preferredWidth: 140
|
||||||
|
text:"Equal"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Equal"
|
||||||
|
onClicked: {
|
||||||
|
btn_tab_width_behavior.text = text
|
||||||
|
tab_view.tabWidthBehavior = FluTabView.Equal
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"SizeToContent"
|
||||||
|
onClicked: {
|
||||||
|
btn_tab_width_behavior.text = text
|
||||||
|
tab_view.tabWidthBehavior = FluTabView.SizeToContent
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Compact"
|
||||||
|
onClicked: {
|
||||||
|
btn_tab_width_behavior.text = text
|
||||||
|
tab_view.tabWidthBehavior = FluTabView.Compact
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
FluDropDownButton{
|
||||||
|
id:btn_close_button_visibility
|
||||||
|
text:"Always"
|
||||||
|
Layout.preferredWidth: 120
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Nerver"
|
||||||
|
onClicked: {
|
||||||
|
btn_close_button_visibility.text = text
|
||||||
|
tab_view.closeButtonVisibility = FluTabView.Nerver
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Always"
|
||||||
|
onClicked: {
|
||||||
|
btn_close_button_visibility.text = text
|
||||||
|
tab_view.closeButtonVisibility = FluTabView.Always
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"OnHover"
|
||||||
|
onClicked: {
|
||||||
|
btn_close_button_visibility.text = text
|
||||||
|
tab_view.closeButtonVisibility = FluTabView.OnHover
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 5
|
||||||
height: 400
|
height: 400
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
|
|
||||||
FluTabView{
|
FluTabView{
|
||||||
id:tab_view
|
id:tab_view
|
||||||
|
onNewPressed:{
|
||||||
|
newTab()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ FluScrollablePage{
|
|||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
disabled:toggle_switch.selected
|
disabled:toggle_switch.selected
|
||||||
}
|
}
|
||||||
FluMultiLineTextBox{
|
FluMultilineTextBox{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
placeholderText: "多行输入框"
|
placeholderText: "多行输入框"
|
||||||
@ -26,7 +25,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluAutoSuggestBox{
|
FluAutoSuggestBox{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
values:generateRandomNames(100)
|
items:generateRandomNames(100)
|
||||||
placeholderText: "AutoSuggestBox"
|
placeholderText: "AutoSuggestBox"
|
||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
disabled:toggle_switch.selected
|
disabled:toggle_switch.selected
|
||||||
@ -52,7 +51,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
for (let i = 0; i < numNames; i++) {
|
for (let i = 0; i < numNames; i++) {
|
||||||
const name = generateRandomName();
|
const name = generateRandomName();
|
||||||
names.push(name);
|
names.push({title:name});
|
||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ FluScrollablePage{
|
|||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -36,7 +36,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -17,6 +16,6 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
text:"Disabled"
|
text:"Text"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtGraphicalEffects 1.15
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -45,7 +44,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluContentPage {
|
FluContentPage {
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluContentPage {
|
FluContentPage {
|
||||||
|
|
||||||
title: "Typography"
|
title: "Typography"
|
||||||
property int textSize: 13
|
property int textSize: FluTheme.textSize
|
||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
slider.seek(31)
|
slider.seek(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView{
|
ScrollView{
|
||||||
@ -44,13 +44,7 @@ FluContentPage {
|
|||||||
text:"Subtitle"
|
text:"Subtitle"
|
||||||
padding: 0
|
padding: 0
|
||||||
pixelSize: textSize
|
pixelSize: textSize
|
||||||
fontStyle: FluText.Subtitle
|
fontStyle: FluText.SubTitle
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"Body Large"
|
|
||||||
padding: 0
|
|
||||||
pixelSize: textSize
|
|
||||||
fontStyle: FluText.BodyLarge
|
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"Body Strong"
|
text:"Body Strong"
|
||||||
@ -76,7 +70,7 @@ FluContentPage {
|
|||||||
|
|
||||||
FluSlider{
|
FluSlider{
|
||||||
id:slider
|
id:slider
|
||||||
orientation:FluSlider.Vertical
|
vertical:true
|
||||||
anchors{
|
anchors{
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: 45
|
rightMargin: 45
|
||||||
@ -84,7 +78,7 @@ FluContentPage {
|
|||||||
topMargin: 30
|
topMargin: 30
|
||||||
}
|
}
|
||||||
onValueChanged:{
|
onValueChanged:{
|
||||||
textSize = value/100*16+8
|
textSize = value/100*6+FluTheme.textSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
QT += quick concurrent network multimedia
|
QT += quick quickcontrols2 concurrent network multimedia
|
||||||
CONFIG += c++11
|
CONFIG += c++17
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
|
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
@ -25,18 +25,10 @@ CONFIG(debug,debug|release) {
|
|||||||
win32 {
|
win32 {
|
||||||
contains(QT_ARCH, i386) {
|
contains(QT_ARCH, i386) {
|
||||||
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x86/*.dll) $$DESTDIR
|
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x86/*.dll) $$DESTDIR
|
||||||
contains(QMAKE_CC, cl) {
|
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, \\)
|
|
||||||
} else {
|
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$COPYDLL
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x64/*.dll) $$DESTDIR
|
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x64/*.dll) $$DESTDIR
|
||||||
contains(QMAKE_CC, cl) {
|
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, \\)
|
|
||||||
} else {
|
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$COPYDLL
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
21
example/global/ItemsFooter.qml
Normal file
21
example/global/ItemsFooter.qml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluObject{
|
||||||
|
id:footer_items
|
||||||
|
FluPaneItemSeparator{}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"意见反馈"
|
||||||
|
onTap:{
|
||||||
|
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/issues/new")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"关于"
|
||||||
|
onTap:{
|
||||||
|
FluApp.navigate("/about")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
321
example/global/ItemsOriginal.qml
Normal file
321
example/global/ItemsOriginal.qml
Normal file
@ -0,0 +1,321 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
|
||||||
|
FluObject{
|
||||||
|
|
||||||
|
property var navigationView
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Home"
|
||||||
|
icon:FluentIcons.Home
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Home.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Basic input"
|
||||||
|
icon:FluentIcons.CheckboxComposite
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Buttons"
|
||||||
|
image:"qrc:/res/image/control/Button.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that responds to user input and raisesa Click event."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Buttons.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Slider"
|
||||||
|
image:"qrc:/res/image/control/Slider.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Slider.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"CheckBox"
|
||||||
|
image:"qrc:/res/image/control/Checkbox.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that a user can select or clear."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_CheckBox.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ToggleSwitch"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_ToggleSwitch.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Form"
|
||||||
|
icon:FluentIcons.GridView
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TextBox"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TextBox.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TimePicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TimePicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"DatePicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_DatePicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"CalendarPicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_CalendarPicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ColorPicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_ColorPicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Surface"
|
||||||
|
icon:FluentIcons.SurfaceHub
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"InfoBar"
|
||||||
|
image:"qrc:/res/image/control/InfoBar.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"An inline message to display app-wide statuschange information."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_InfoBar.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Progress"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Progress.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Badge"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Badge.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Rectangle"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Rectangle.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Carousel"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Carousel.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Expander"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Expander.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Popus"
|
||||||
|
icon:FluentIcons.ButtonMenu
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Dialog"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Dialog.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Tooltip"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Tooltip.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Menu"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Menu.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Navigation"
|
||||||
|
icon:FluentIcons.AllApps
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Pivot"
|
||||||
|
image:"qrc:/res/image/control/Pivot.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:3
|
||||||
|
desc:"Presents information from different sources in atabbed view."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Pivot.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TabView"
|
||||||
|
image:"qrc:/res/image/control/TabView.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:1
|
||||||
|
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TabView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TreeView"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TreeView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"MultiWindow"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_MultiWindow.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"FlipView"
|
||||||
|
image:"qrc:/res/image/control/FlipView.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:2
|
||||||
|
desc:"Presents a collection of items that the user canflip through, one item at a time."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_FlipView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Theming"
|
||||||
|
icon:FluentIcons.Brightness
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Theme"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Theme.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Awesome"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Awesome.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Typography"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Typography.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:"Media"
|
||||||
|
icon:FluentIcons.Media
|
||||||
|
FluPaneItem{
|
||||||
|
title:"MediaPlayer"
|
||||||
|
image:"qrc:/res/image/control/MediaPlayerElement.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:0
|
||||||
|
desc:"A control to display video and image content."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_MediaPlayer.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecentlyAddedData(){
|
||||||
|
var arr = []
|
||||||
|
for(var i=0;i<children.length;i++){
|
||||||
|
var item = children[i]
|
||||||
|
if(item instanceof FluPaneItem && item.recentlyAdded){
|
||||||
|
arr.push(item)
|
||||||
|
}
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
if(itemChild instanceof FluPaneItem && itemChild.recentlyAdded){
|
||||||
|
arr.push(itemChild)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arr.sort(function(o1,o2){ return o2.order-o1.order })
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecentlyUpdatedData(){
|
||||||
|
var arr = []
|
||||||
|
var items = navigationView.getItems();
|
||||||
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
||||||
|
arr.push(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSearchData(){
|
||||||
|
var arr = []
|
||||||
|
var items = navigationView.getItems();
|
||||||
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item instanceof FluPaneItem){
|
||||||
|
arr.push({title:item.title,key:item.key})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
|
||||||
|
function startPageByItem(data){
|
||||||
|
var items = navigationView.getItems();
|
||||||
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item.key === data.key){
|
||||||
|
if(navigationView.getCurrentIndex() === i){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
item.tap()
|
||||||
|
navigationView.setCurrentIndex(i)
|
||||||
|
if(item.parent){
|
||||||
|
item.parent.isExpand = true
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
2
example/global/qmldir
Normal file
2
example/global/qmldir
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
singleton ItemsOriginal 1.0 ItemsOriginal.qml
|
||||||
|
singleton ItemsFooter 1.0 ItemsFooter.qml
|
@ -3,12 +3,13 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
|
#include <QQuickStyle>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include "ChatController.h"
|
#include "ChatController.h"
|
||||||
|
|
||||||
QMap<QString, QVariant> properties(){
|
QMap<QString, QVariant> properties(){
|
||||||
QMap<QString, QVariant> map;
|
QMap<QString, QVariant> map;
|
||||||
// map["installHelper"] = QVariant::fromValue(QVariant::fromValue(InstallHelper::getInstance()));
|
// map["installHelper"] = QVariant::fromValue(QVariant::fromValue(InstallHelper::getInstance()));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,8 +18,7 @@ int main(int argc, char *argv[])
|
|||||||
QCoreApplication::setOrganizationName("ZhuZiChu");
|
QCoreApplication::setOrganizationName("ZhuZiChu");
|
||||||
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||||
QCoreApplication::setApplicationName("FluentUI");
|
QCoreApplication::setApplicationName("FluentUI");
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QQuickStyle::setStyle("Basic");
|
||||||
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
@ -17,6 +17,7 @@ FluWindow {
|
|||||||
FluAppBar{
|
FluAppBar{
|
||||||
id:appbar
|
id:appbar
|
||||||
title:"关于"
|
title:"关于"
|
||||||
|
width:parent.width
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
@ -35,7 +36,7 @@ FluWindow {
|
|||||||
fontStyle: FluText.Title
|
fontStyle: FluText.Title
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"v1.1.5"
|
text:"v1.1.9"
|
||||||
fontStyle: FluText.Body
|
fontStyle: FluText.Body
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
import Controller 1.0
|
import Controller
|
||||||
import QtQuick.Dialogs 1.3
|
import QtQuick.Dialogs
|
||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
@ -43,6 +43,7 @@ FluWindow {
|
|||||||
FluAppBar{
|
FluAppBar{
|
||||||
id:appbar
|
id:appbar
|
||||||
title:"ChatGPT"
|
title:"ChatGPT"
|
||||||
|
width:parent.width
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import FluentUI 1.0
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
@ -17,13 +18,14 @@ FluWindow {
|
|||||||
|
|
||||||
onInitArgument:
|
onInitArgument:
|
||||||
(argument)=>{
|
(argument)=>{
|
||||||
textbox_uesrname.text = argument.username
|
textbox_uesrname.updateText(argument.username)
|
||||||
textbox_password.focus = true
|
textbox_password.focus = true
|
||||||
}
|
}
|
||||||
|
|
||||||
FluAppBar{
|
FluAppBar{
|
||||||
id:appbar
|
id:appbar
|
||||||
title:"登录"
|
title:"登录"
|
||||||
|
width:parent.width
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
@ -33,10 +35,9 @@ FluWindow {
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluAutoSuggestBox{
|
FluAutoSuggestBox{
|
||||||
id:textbox_uesrname
|
id:textbox_uesrname
|
||||||
values:["Admin","User"]
|
items:[{title:"Admin"},{title:"User"}]
|
||||||
placeholderText: "请输入账号"
|
placeholderText: "请输入账号"
|
||||||
Layout.preferredWidth: 260
|
Layout.preferredWidth: 260
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtGraphicalEffects 1.15
|
import "qrc:///global/"
|
||||||
|
import FluentUI
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
id:rootwindow
|
id:rootwindow
|
||||||
@ -12,263 +11,39 @@ FluWindow {
|
|||||||
height: 640
|
height: 640
|
||||||
title: "FluentUI"
|
title: "FluentUI"
|
||||||
minimumWidth: 520
|
minimumWidth: 520
|
||||||
minimumHeight: 400
|
minimumHeight: 460
|
||||||
|
|
||||||
FluAppBar{
|
FluAppBar{
|
||||||
id:appbar
|
id:appbar
|
||||||
z:10
|
z:10
|
||||||
showDark: true
|
showDark: true
|
||||||
}
|
width:parent.width
|
||||||
|
|
||||||
FluObject{
|
|
||||||
id:original_items
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Home"
|
|
||||||
icon:FluentIcons.Home
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Home.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Inputs"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Buttons"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Buttons.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Slider"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Slider.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"CheckBox"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_CheckBox.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"ToggleSwitch"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_ToggleSwitch.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Form"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TextBox"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_TextBox.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TimePicker"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_TimePicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"DatePicker"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_DatePicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"CalendarPicker"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_CalendarPicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"ColorPicker"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_ColorPicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Surface"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"InfoBar"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_InfoBar.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Progress"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Progress.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Badge"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Badge.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Rectangle"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Rectangle.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Carousel"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Carousel.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Expander"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Expander.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Popus"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Dialog"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Dialog.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Tooltip"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Tooltip.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Menu"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Menu.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Navigation"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TabView"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_TabView.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TreeView"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_TreeView.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"MultiWindow"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_MultiWindow.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Theming"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Theme"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Theme.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Awesome"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Awesome.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Typography"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_Typography.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Media"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"MediaPlayer"
|
|
||||||
onTap:{
|
|
||||||
nav_view.push("qrc:/T_MediaPlayer.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
FluObject{
|
|
||||||
id:footer_items
|
|
||||||
FluPaneItemSeparator{}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"意见反馈"
|
|
||||||
onTap:{
|
|
||||||
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/issues/new")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"关于"
|
|
||||||
onTap:{
|
|
||||||
FluApp.navigate("/about")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluNavigationView{
|
FluNavigationView{
|
||||||
id:nav_view
|
id:nav_view
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
items: original_items
|
items: ItemsOriginal
|
||||||
footerItems:footer_items
|
footerItems:ItemsFooter
|
||||||
logo: "qrc:/res/image/favicon.ico"
|
logo: "qrc:/res/image/favicon.ico"
|
||||||
z: 11
|
z: 11
|
||||||
|
title:"FluentUI"
|
||||||
|
autoSuggestBox:FluAutoSuggestBox{
|
||||||
|
width: 280
|
||||||
|
anchors.centerIn: parent
|
||||||
|
iconSource: FluentIcons.Zoom
|
||||||
|
items: ItemsOriginal.getSearchData()
|
||||||
|
placeholderText: "查找"
|
||||||
|
onItemClicked:
|
||||||
|
(data)=>{
|
||||||
|
ItemsOriginal.startPageByItem(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
ItemsOriginal.navigationView = nav_view
|
||||||
nav_view.setCurrentIndex(0)
|
nav_view.setCurrentIndex(0)
|
||||||
nav_view.push("qrc:/T_Home.qml")
|
nav_view.push("qrc:/T_Home.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPageByTitle(title){
|
|
||||||
console.debug(title)
|
|
||||||
nav_view.startPageByTitle(title)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
37
example/page/MediaPage.qml
Normal file
37
example/page/MediaPage.qml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
width: 640
|
||||||
|
height: 480
|
||||||
|
minimumWidth: 640
|
||||||
|
minimumHeight: 480
|
||||||
|
|
||||||
|
title:"视频播放器"
|
||||||
|
|
||||||
|
onInitArgument:
|
||||||
|
(argument)=>{
|
||||||
|
player.source = argument.source
|
||||||
|
}
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
title:"视频播放器"
|
||||||
|
width:parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluMediaPlayer{
|
||||||
|
id:player
|
||||||
|
anchors{
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
top: appbar.bottom
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -149,5 +149,11 @@
|
|||||||
<file>res/image/control/WebView.png</file>
|
<file>res/image/control/WebView.png</file>
|
||||||
<file>res/image/control/XamlUICommand.png</file>
|
<file>res/image/control/XamlUICommand.png</file>
|
||||||
<file>T_CheckBox.qml</file>
|
<file>T_CheckBox.qml</file>
|
||||||
|
<file>global/ItemsOriginal.qml</file>
|
||||||
|
<file>global/qmldir</file>
|
||||||
|
<file>global/ItemsFooter.qml</file>
|
||||||
|
<file>page/MediaPage.qml</file>
|
||||||
|
<file>T_FlipView.qml</file>
|
||||||
|
<file>T_Pivot.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
34
scripts/windows-mingw-publish.ps1
Normal file
34
scripts/windows-mingw-publish.ps1
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
param (
|
||||||
|
[string] $archiveName, [string] $targetName
|
||||||
|
)
|
||||||
|
# 外部环境变量包括:
|
||||||
|
# archiveName: ${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
|
||||||
|
|
||||||
|
|
||||||
|
# archiveName: 5.15.2-win64_mingw81
|
||||||
|
|
||||||
|
$scriptDir = $PSScriptRoot
|
||||||
|
$currentDir = Get-Location
|
||||||
|
Write-Host "currentDir" $currentDir
|
||||||
|
Write-Host "scriptDir" $scriptDir
|
||||||
|
|
||||||
|
function Main() {
|
||||||
|
|
||||||
|
New-Item -ItemType Directory $archiveName
|
||||||
|
# 拷贝exe
|
||||||
|
Copy-Item bin\release\* $archiveName\
|
||||||
|
# 拷贝依赖
|
||||||
|
windeployqt --qmldir . --plugindir $archiveName\plugins --no-translations --compiler-runtime $archiveName\$targetName
|
||||||
|
# 删除不必要的文件
|
||||||
|
$excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
|
||||||
|
Remove-Item -Path $archiveName -Include $excludeList -Recurse -Force
|
||||||
|
# 打包zip
|
||||||
|
Compress-Archive -Path $archiveName $archiveName'.zip'
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($null -eq $archiveName || $null -eq $targetName) {
|
||||||
|
Write-Host "args missing, archiveName is" $archiveName ", targetName is" $targetName
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Main
|
68
src/CMakeLists.txt
Normal file
68
src/CMakeLists.txt
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(FluentUI)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
find_package(Qt6 COMPONENTS Core Quick Svg REQUIRED)
|
||||||
|
set(QT_INSTALL_QML ${Qt6Core_DIR}/../../../qml)
|
||||||
|
set(TARGET_TYPE SHARED)
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
||||||
|
|
||||||
|
set(TARGET_RESOURCES res.qrc)
|
||||||
|
set(TARGET_SOURCES
|
||||||
|
Def.cpp
|
||||||
|
FluApp.cpp
|
||||||
|
FluColorSet.cpp
|
||||||
|
FluColors.cpp
|
||||||
|
FluRegister.cpp
|
||||||
|
FluTheme.cpp
|
||||||
|
Fluent.cpp
|
||||||
|
FluentUI.cpp
|
||||||
|
WindowHelper.cpp
|
||||||
|
qml_plugin.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(TARGET_HEADERS
|
||||||
|
Def.h
|
||||||
|
FluApp.h
|
||||||
|
FluColorSet.h
|
||||||
|
FluColors.h
|
||||||
|
FluRegister.h
|
||||||
|
FluTheme.h
|
||||||
|
Fluent.h
|
||||||
|
FluentUI.h
|
||||||
|
FramelessView.h
|
||||||
|
WindowHelper.h
|
||||||
|
qml_plugin.h
|
||||||
|
stdafx.h
|
||||||
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(TARGET_SOURCES ${TARGET_SOURCES} FramelessView_win.cpp)
|
||||||
|
else()
|
||||||
|
set(TARGET_SOURCES ${TARGET_SOURCES} FramelessView_unix.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_definitions(-DVERSION_IN="1.0.0")
|
||||||
|
add_definitions(-DVURI_STR="FluentUI")
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} ${TARGET_TYPE} ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESOURCES})
|
||||||
|
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
|
||||||
|
else()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick Qt6::Svg)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
include(build_windows.cmake)
|
||||||
|
else()
|
||||||
|
include(build_macos.cmake)
|
||||||
|
endif()
|
@ -5,6 +5,7 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QUuid>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include "Def.h"
|
#include "Def.h"
|
||||||
|
|
||||||
@ -99,3 +100,7 @@ QJsonArray FluApp::awesomelist(const QString& keyword)
|
|||||||
void FluApp::clipText(const QString& text){
|
void FluApp::clipText(const QString& text){
|
||||||
QGuiApplication::clipboard()->setText(text);
|
QGuiApplication::clipboard()->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString FluApp::uuid(){
|
||||||
|
return QUuid::createUuid().toString();
|
||||||
|
}
|
||||||
|
@ -37,6 +37,8 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE void clipText(const QString& text);
|
Q_INVOKABLE void clipText(const QString& text);
|
||||||
|
|
||||||
|
Q_INVOKABLE QString uuid();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<QString, QVariant> properties;
|
QMap<QString, QVariant> properties;
|
||||||
static FluApp* m_instance;
|
static FluApp* m_instance;
|
||||||
|
@ -17,7 +17,7 @@ FluTheme::FluTheme(QObject *parent)
|
|||||||
{
|
{
|
||||||
primaryColor(FluColors::getInstance()->Blue());
|
primaryColor(FluColors::getInstance()->Blue());
|
||||||
textSize(13);
|
textSize(13);
|
||||||
nativeText(false);
|
nativeText(true);
|
||||||
frameless(true);
|
frameless(true);
|
||||||
dark(false);
|
dark(false);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,11 @@ 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/FluPivotItem.qml"),uri,major,minor,"FluPivotItem");
|
||||||
|
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/FluPaneItemExpander.qml"),uri,major,minor,"FluPaneItemExpander");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
||||||
@ -57,7 +62,7 @@ void Fluent::registerTypes(const char *uri){
|
|||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenu.qml"),uri,major,minor,"FluMenu");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMenu.qml"),uri,major,minor,"FluMenu");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluScrollBar.qml"),uri,major,minor,"FluScrollBar");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluScrollBar.qml"),uri,major,minor,"FluScrollBar");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTextButton.qml"),uri,major,minor,"FluTextButton");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTextButton.qml"),uri,major,minor,"FluTextButton");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMultiLineTextBox.qml"),uri,major,minor,"FluMultiLineTextBox");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluMultilineTextBox.qml"),uri,major,minor,"FluMultilineTextBox");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTooltip.qml"),uri,major,minor,"FluTooltip");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTooltip.qml"),uri,major,minor,"FluTooltip");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDivider.qml"),uri,major,minor,"FluDivider");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluDivider.qml"),uri,major,minor,"FluDivider");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluIcon.qml"),uri,major,minor,"FluIcon");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluIcon.qml"),uri,major,minor,"FluIcon");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
QT += qml quick svg
|
QT += qml quick svg
|
||||||
CONFIG += plugin c++11
|
CONFIG += plugin c++17
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = FluentUI
|
TARGET = FluentUI
|
||||||
TARGET = $$qtLibraryTarget($$TARGET)
|
TARGET = $$qtLibraryTarget($$TARGET)
|
||||||
|
32
src/build_macos.cmake
Normal file
32
src/build_macos.cmake
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
set(OUTP ${CMAKE_BINARY_DIR}/bin/FluentUI/)
|
||||||
|
|
||||||
|
add_definitions(-DMACOS)
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_PREFIX ${OUTP})
|
||||||
|
set(CMAKE_INSTALL_DESTDIR ${OUTP})
|
||||||
|
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
set(QMAKE_MOC_OPTIONS -Muri=${uri})
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND chmod -R 777 ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh PRESET ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(${TARGET_TYPE} STREQUAL "SHARED")
|
||||||
|
|
||||||
|
set(INST_QMLPATH ${QT_INSTALL_QML}/FluentUI)
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh INSTALL ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP} ${INST_QMLPATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
27
src/build_windows.cmake
Normal file
27
src/build_windows.cmake
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
set(OUTP "${CMAKE_BINARY_DIR}/bin/FluentUI")
|
||||||
|
set(BUILDBIN_PATH "${OUTP}")
|
||||||
|
set(QTQMLFLUENT_PATH "${QT_INSTALL_QML}/FluentUI")
|
||||||
|
set(PRESET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-preset")
|
||||||
|
set(SOLIBFILE_PATH "${CMAKE_BINARY_DIR}/libFluentUI.so")
|
||||||
|
set(ANDROID NO)
|
||||||
|
if (ANDROID)
|
||||||
|
set(ANDROID YES)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTP})
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${OUTP}")
|
||||||
|
endif()
|
||||||
|
set(SHAREDSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/win_install.bat SHARED ${CMAKE_CURRENT_SOURCE_DIR} ${PRESET_PATH} ${BUILDBIN_PATH} ${QTQMLFLUENT_PATH} ${ANDROID} ${SOLIBFILE_PATH})
|
||||||
|
set(STATICSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/win_install.bat STATIC ${CMAKE_CURRENT_SOURCE_DIR} ${PRESET_PATH} ${BUILDBIN_PATH} ${QTQMLFLUENT_PATH} ${ANDROID} ${SOLIBFILE_PATH})
|
||||||
|
string(REPLACE "/" "\\" SHAREDSCRIPT "${SHAREDSCRIPT}")
|
||||||
|
string(REPLACE "/" "\\" STATICSCRIPT "${STATICSCRIPT}")
|
||||||
|
if (${TARGET_TYPE} STREQUAL "SHARED")
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${SHAREDSCRIPT}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${STATICSCRIPT}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
@ -4,17 +4,14 @@ QTQMLFLUENT_PATH = $$[QT_INSTALL_QML]/FluentUI
|
|||||||
PRESET_PATH = $$PWD/build-preset
|
PRESET_PATH = $$PWD/build-preset
|
||||||
SOLIBFILE_PATH = $$OUT_PWD/libFluentUI.so
|
SOLIBFILE_PATH = $$OUT_PWD/libFluentUI.so
|
||||||
ANDROID = NO
|
ANDROID = NO
|
||||||
|
|
||||||
android{
|
android{
|
||||||
ANDROID=YES
|
ANDROID=YES
|
||||||
QMAKE_PRE_LINK *= md $$replace(OUTP, /, \\)
|
QMAKE_PRE_LINK *= md $$replace(OUTP, /, \\)
|
||||||
}else{
|
}else{
|
||||||
DESTDIR += $$OUTP
|
DESTDIR += $$OUTP
|
||||||
}
|
}
|
||||||
|
|
||||||
SHAREDSCRIPT = "$$PWD\win_install.bat" SHARED "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
|
SHAREDSCRIPT = "$$PWD\win_install.bat" SHARED "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
|
||||||
STATICSCRIPT = "$$PWD\win_install.bat" STATIC "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
|
STATICSCRIPT = "$$PWD\win_install.bat" STATIC "$$PWD" "$$PRESET_PATH" "$$BUILDBIN_PATH" "$$QTQMLFLUENT_PATH" $$ANDROID "$$SOLIBFILE_PATH"
|
||||||
|
|
||||||
CONFIG(sharedlib){
|
CONFIG(sharedlib){
|
||||||
QMAKE_POST_LINK *= $$replace(SHAREDSCRIPT, /, \\)
|
QMAKE_POST_LINK *= $$replace(SHAREDSCRIPT, /, \\)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import "content"
|
import "content"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
Grid {
|
Grid {
|
||||||
id: root
|
id: root
|
||||||
property int cellSide: 5
|
property int cellSide: 5
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property int cursorHeight: 7
|
property int cursorHeight: 7
|
||||||
@ -30,10 +30,10 @@ Item {
|
|||||||
pickerCursor.y = Math.max(0, Math.min(height, mouse.y)-cursorHeight)
|
pickerCursor.y = Math.max(0, Math.min(height, mouse.y)-cursorHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onPositionChanged: {
|
onPositionChanged:(mouse)=> {
|
||||||
handleMouse(mouse)
|
handleMouse(mouse)
|
||||||
}
|
}
|
||||||
onPressed: handleMouse(mouse)
|
onPressed:(mouse)=> handleMouse(mouse)
|
||||||
}
|
}
|
||||||
|
|
||||||
function setValue(val) {
|
function setValue(val) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
property alias caption: captionBox.text
|
property alias caption: captionBox.text
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width : 40; height : 15; radius: 2
|
width : 40; height : 15; radius: 2
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
@ -48,22 +48,15 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
x: r
|
x: r
|
||||||
y: r
|
y: r
|
||||||
|
preventStealing: true
|
||||||
function handleMouse(mouse) {
|
function handleMouse(mouse) {
|
||||||
if (mouse.buttons & Qt.LeftButton) {
|
if (mouse.buttons & Qt.LeftButton) {
|
||||||
|
|
||||||
pickerCursor.x = Math.max(0,Math.min(mouse.x - r,width-2*r));
|
pickerCursor.x = Math.max(0,Math.min(mouse.x - r,width-2*r));
|
||||||
pickerCursor.y = Math.max(0,Math.min(mouse.y - r,height-2*r));
|
pickerCursor.y = Math.max(0,Math.min(mouse.y - r,height-2*r));
|
||||||
|
|
||||||
|
|
||||||
// pickerCursor.x = Math.max(-r,Math.min(mouse.x - r,width+r));
|
|
||||||
// pickerCursor.y = Math.max(-r,Math.min(mouse.y - r,height+r));
|
|
||||||
|
|
||||||
// pickerCursor.x = Math.max(0, Math.min(width, mouse.x) - 2 * r);
|
|
||||||
// pickerCursor.y = Math.max(0, Math.min(height, mouse.y) - 2 * r);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onPositionChanged: handleMouse(mouse)
|
onPositionChanged:(mouse)=> handleMouse(mouse)
|
||||||
onPressed: handleMouse(mouse)
|
onPressed:(mouse)=> handleMouse(mouse)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,33 +1,41 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
||||||
property string title: ""
|
property string title: ""
|
||||||
|
property string darkText : "夜间模式"
|
||||||
|
property string minimizeText : "最小化"
|
||||||
|
property string restoreText : "向下还原"
|
||||||
|
property string maximizeText : "最大化"
|
||||||
|
property string closeText : "关闭"
|
||||||
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||||
|
property color minimizeNormalColor: Qt.rgba(0,0,0,0)
|
||||||
|
property color minimizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.1) : Qt.rgba(0,0,0,0.06)
|
||||||
|
property color maximizeNormalColor: Qt.rgba(0,0,0,0)
|
||||||
|
property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.1) : Qt.rgba(0,0,0,0.06)
|
||||||
|
property color closeNormalColor: Qt.rgba(0,0,0,0)
|
||||||
|
property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1)
|
||||||
|
|
||||||
|
|
||||||
property bool showDark: false
|
property bool showDark: false
|
||||||
property bool showFps: false
|
|
||||||
property var window: Window.window
|
|
||||||
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property bool resizable: {
|
|
||||||
if(window == null){
|
Item{
|
||||||
return false
|
id:d
|
||||||
}
|
property var win: Window.window
|
||||||
return !(window.minimumHeight === window.maximumHeight && window.maximumWidth === window.minimumWidth)
|
property bool isRestore: win && Window.Maximized === win.visibility
|
||||||
|
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
|
||||||
}
|
}
|
||||||
|
|
||||||
id:root
|
id:root
|
||||||
color: Qt.rgba(0,0,0,0)
|
color: Qt.rgba(0,0,0,0)
|
||||||
visible: FluTheme.frameless
|
visible: FluTheme.frameless
|
||||||
height: visible ? 30 : 0
|
height: visible ? 30 : 0
|
||||||
width: {
|
opacity: visible
|
||||||
if(parent==null)
|
|
||||||
return 200
|
|
||||||
return parent.width
|
|
||||||
}
|
|
||||||
z: 65535
|
z: 65535
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
@ -38,7 +46,7 @@ Rectangle{
|
|||||||
DragHandler {
|
DragHandler {
|
||||||
target: null
|
target: null
|
||||||
grabPermissions: TapHandler.CanTakeOverFromAnything
|
grabPermissions: TapHandler.CanTakeOverFromAnything
|
||||||
onActiveChanged: if (active) { window.startSystemMove(); }
|
onActiveChanged: if (active) { d.win.startSystemMove(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText {
|
FluText {
|
||||||
@ -59,13 +67,6 @@ Rectangle{
|
|||||||
height: root.height
|
height: root.height
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
TFpsMonitor{
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
Layout.rightMargin: 20
|
|
||||||
Layout.topMargin: 5
|
|
||||||
color:root.textColor
|
|
||||||
visible: showFps
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
@ -73,9 +74,8 @@ Rectangle{
|
|||||||
visible: showDark
|
visible: showDark
|
||||||
spacing: 5
|
spacing: 5
|
||||||
FluText{
|
FluText{
|
||||||
text:"夜间模式"
|
text:darkText
|
||||||
color:root.textColor
|
color:root.textColor
|
||||||
fontStyle: FluText.Caption
|
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
selected: FluTheme.dark
|
selected: FluTheme.dark
|
||||||
@ -91,53 +91,24 @@ Rectangle{
|
|||||||
iconSource : FluentIcons.ChromeMinimize
|
iconSource : FluentIcons.ChromeMinimize
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
iconSize: 11
|
iconSize: 11
|
||||||
text:"最小化"
|
text:minimizeText
|
||||||
radius: 0
|
radius: 0
|
||||||
textColor: root.textColor
|
iconColor: root.textColor
|
||||||
color:{
|
color: hovered ? minimizeHoverColor : minimizeNormalColor
|
||||||
if(FluTheme.dark){
|
|
||||||
if(hovered){
|
|
||||||
return Qt.rgba(1,1,1,0.06)
|
|
||||||
}
|
|
||||||
return Qt.rgba(0,0,0,0)
|
|
||||||
}else{
|
|
||||||
if(hovered){
|
|
||||||
return Qt.rgba(0,0,0,0.06)
|
|
||||||
}
|
|
||||||
return Qt.rgba(0,0,0,0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
window.showMinimized()
|
d.win.showMinimized()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
width: 40
|
width: 40
|
||||||
height: 30
|
height: 30
|
||||||
property bool isRestore:{
|
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||||
if(window == null)
|
color: hovered ? maximizeHoverColor : maximizeNormalColor
|
||||||
return false
|
|
||||||
return Window.Maximized === window.visibility
|
|
||||||
}
|
|
||||||
iconSource : isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
|
||||||
color:{
|
|
||||||
if(FluTheme.dark){
|
|
||||||
if(hovered){
|
|
||||||
return Qt.rgba(1,1,1,0.06)
|
|
||||||
}
|
|
||||||
return Qt.rgba(0,0,0,0)
|
|
||||||
}else{
|
|
||||||
if(hovered){
|
|
||||||
return Qt.rgba(0,0,0,0.06)
|
|
||||||
}
|
|
||||||
return Qt.rgba(0,0,0,0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: resizable
|
visible: d.resizable
|
||||||
radius: 0
|
radius: 0
|
||||||
textColor: root.textColor
|
iconColor: root.textColor
|
||||||
text:isRestore?"向下还原":"最大化"
|
text:d.isRestore?restoreText:maximizeText
|
||||||
iconSize: 11
|
iconSize: 11
|
||||||
onClicked: {
|
onClicked: {
|
||||||
toggleMaximized()
|
toggleMaximized()
|
||||||
@ -146,26 +117,26 @@ Rectangle{
|
|||||||
FluIconButton{
|
FluIconButton{
|
||||||
iconSource : FluentIcons.ChromeClose
|
iconSource : FluentIcons.ChromeClose
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text:"关闭"
|
text:closeText
|
||||||
width: 40
|
width: 40
|
||||||
height: 30
|
height: 30
|
||||||
radius: 0
|
radius: 0
|
||||||
iconSize: 10
|
iconSize: 10
|
||||||
textColor: hovered ? Qt.rgba(1,1,1,1) : root.textColor
|
iconColor: hovered ? Qt.rgba(1,1,1,1) : root.textColor
|
||||||
color:hovered ? Qt.rgba(251/255,115/255,115/255,1) : "#00000000"
|
color:hovered ? closeHoverColor : closeNormalColor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Window.window.close()
|
d.win.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleMaximized() {
|
function toggleMaximized() {
|
||||||
if(!resizable)
|
if(!d.resizable)
|
||||||
return
|
return
|
||||||
if (window.visibility === Window.Maximized) {
|
if (d.win.visibility === Window.Maximized) {
|
||||||
window.showNormal();
|
d.win.showNormal();
|
||||||
} else {
|
} else {
|
||||||
window.showMaximized();
|
d.win.showMaximized();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
|
@ -1,151 +1,30 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
TextField{
|
|
||||||
|
|
||||||
property var values:[]
|
|
||||||
property int fontStyle: FluText.Body
|
|
||||||
property int pixelSize : FluTheme.textSize
|
|
||||||
property int iconSource: 0
|
|
||||||
property bool disabled: false
|
|
||||||
signal itemClicked(string data)
|
|
||||||
|
|
||||||
id:input
|
|
||||||
width: 300
|
|
||||||
enabled: !disabled
|
|
||||||
color: {
|
|
||||||
if(disabled){
|
|
||||||
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
|
||||||
}
|
|
||||||
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
|
|
||||||
}
|
|
||||||
selectionColor: {
|
|
||||||
if(FluTheme.dark){
|
|
||||||
return FluTheme.primaryColor.lighter
|
|
||||||
}else{
|
|
||||||
return FluTheme.primaryColor.dark
|
|
||||||
}
|
|
||||||
}
|
|
||||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
|
||||||
placeholderTextColor: {
|
|
||||||
if(disabled){
|
|
||||||
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
|
||||||
}
|
|
||||||
if(focus){
|
|
||||||
return FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
|
||||||
}
|
|
||||||
return FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
|
||||||
}
|
|
||||||
rightPadding: icon_right.visible ? 50 : 30
|
|
||||||
selectByMouse: true
|
|
||||||
|
|
||||||
Keys.onUpPressed: {
|
|
||||||
list_view.currentIndex = Math.max(list_view.currentIndex-1,0)
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onDownPressed: {
|
|
||||||
list_view.currentIndex = Math.min(list_view.currentIndex+1,list_view.count-1)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
FluTextBox{
|
||||||
|
property var items:[]
|
||||||
|
property string emptyText: "没有找到结果"
|
||||||
|
signal itemClicked(var data)
|
||||||
signal handleClicked
|
signal handleClicked
|
||||||
Keys.onEnterPressed:handleClicked()
|
QtObject{
|
||||||
Keys.onReturnPressed:handleClicked()
|
id:d
|
||||||
|
property bool flagVisible: true
|
||||||
|
|
||||||
font.bold: {
|
|
||||||
switch (fontStyle) {
|
|
||||||
case FluText.Display:
|
|
||||||
return true
|
|
||||||
case FluText.TitleLarge:
|
|
||||||
return true
|
|
||||||
case FluText.Title:
|
|
||||||
return true
|
|
||||||
case FluText.Subtitle:
|
|
||||||
return true
|
|
||||||
case FluText.BodyLarge:
|
|
||||||
return false
|
|
||||||
case FluText.BodyStrong:
|
|
||||||
return true
|
|
||||||
case FluText.Body:
|
|
||||||
return false
|
|
||||||
case FluText.Caption:
|
|
||||||
return false
|
|
||||||
default:
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
font.pixelSize: {
|
id:control
|
||||||
switch (fontStyle) {
|
width: 300
|
||||||
case FluText.Display:
|
|
||||||
return input.pixelSize * 4
|
|
||||||
case FluText.TitleLarge:
|
|
||||||
return input.pixelSize * 2
|
|
||||||
case FluText.Title:
|
|
||||||
return input.pixelSize * 1.5
|
|
||||||
case FluText.Subtitle:
|
|
||||||
return input.pixelSize * 0.9
|
|
||||||
case FluText.BodyLarge:
|
|
||||||
return input.pixelSize * 1.1
|
|
||||||
case FluText.BodyStrong:
|
|
||||||
return input.pixelSize * 1.0
|
|
||||||
case FluText.Body:
|
|
||||||
return input.pixelSize * 1.0
|
|
||||||
case FluText.Caption:
|
|
||||||
return input.pixelSize * 0.8
|
|
||||||
default:
|
|
||||||
return input.pixelSize * 1.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
background: FluTextBoxBackground{
|
|
||||||
inputItem: input
|
|
||||||
|
|
||||||
FluIconButton{
|
|
||||||
iconSource:FluentIcons.ChromeClose
|
|
||||||
iconSize: 10
|
|
||||||
width: 20
|
|
||||||
height: 20
|
|
||||||
opacity: 0.5
|
|
||||||
visible: input.text !== ""
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: icon_right.visible ? 25 : 5
|
|
||||||
}
|
|
||||||
onClicked:{
|
|
||||||
input.text = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluIcon{
|
|
||||||
id:icon_right
|
|
||||||
iconSource: input.iconSource
|
|
||||||
iconSize: 15
|
|
||||||
opacity: 0.5
|
|
||||||
visible: input.iconSource != 0
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: 5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
searchData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
Popup{
|
Popup{
|
||||||
id:input_popup
|
id:control_popup
|
||||||
visible: input.focus
|
y:control.height
|
||||||
y:input.height
|
focus: false
|
||||||
modal: true
|
|
||||||
dim:false
|
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "y"
|
property: "y"
|
||||||
from:0
|
from:0
|
||||||
to:input_popup.y
|
to:control_popup.y
|
||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
@ -155,16 +34,13 @@ TextField{
|
|||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClosed: {
|
|
||||||
input.focus = false
|
|
||||||
}
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if(visible){
|
if(visible){
|
||||||
list_view.currentIndex = -1
|
list_view.currentIndex = -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
width: input.width
|
width: control.width
|
||||||
radius: 4
|
radius: 4
|
||||||
FluShadow{
|
FluShadow{
|
||||||
radius: 4
|
radius: 4
|
||||||
@ -173,18 +49,16 @@ TextField{
|
|||||||
height: 38*Math.min(Math.max(list_view.count,1),8)
|
height: 38*Math.min(Math.max(list_view.count,1),8)
|
||||||
ListView{
|
ListView{
|
||||||
id:list_view
|
id:list_view
|
||||||
signal closePopup
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
boundsBehavior: ListView.StopAtBounds
|
|
||||||
clip: true
|
clip: true
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
header: Item{
|
header: Item{
|
||||||
width: input.width
|
width: control.width
|
||||||
height: visible ? 38 : 0
|
height: visible ? 38 : 0
|
||||||
visible: list_view.count === 0
|
visible: list_view.count === 0
|
||||||
FluText{
|
FluText{
|
||||||
text:"没有找到结果"
|
text:emptyText
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -193,7 +67,7 @@ TextField{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
delegate:Control{
|
delegate:Control{
|
||||||
width: input.width
|
width: control.width
|
||||||
padding:10
|
padding:10
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
color: {
|
color: {
|
||||||
@ -209,19 +83,14 @@ TextField{
|
|||||||
id:mouse_area
|
id:mouse_area
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Connections{
|
Connections{
|
||||||
target: input
|
target: control
|
||||||
function onHandleClicked(){
|
function onHandleClicked(){
|
||||||
if((list_view.currentIndex === index)){
|
if((list_view.currentIndex === index)){
|
||||||
mouse_area.handleClick()
|
handleClick(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClicked: handleClick()
|
onClicked: handleClick(modelData)
|
||||||
function handleClick(){
|
|
||||||
input_popup.close()
|
|
||||||
input.itemClicked(modelData)
|
|
||||||
input.text = modelData
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: 3
|
width: 3
|
||||||
@ -236,53 +105,50 @@ TextField{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text:modelData
|
text:modelData.title
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// Item{
|
|
||||||
// height: 38
|
|
||||||
// width: input.width
|
|
||||||
// Rectangle{
|
|
||||||
// anchors.fill: parent
|
|
||||||
// anchors.topMargin: 2
|
|
||||||
// anchors.bottomMargin: 2
|
|
||||||
// anchors.leftMargin: 5
|
|
||||||
// anchors.rightMargin: 5
|
|
||||||
|
|
||||||
// radius: 3
|
|
||||||
// MouseArea{
|
|
||||||
// id:item_mouse
|
|
||||||
// anchors.fill: parent
|
|
||||||
// hoverEnabled: true
|
|
||||||
// onClicked: {
|
|
||||||
// input_popup.close()
|
|
||||||
// input.itemClicked(modelData)
|
|
||||||
// input.text = modelData
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
searchData()
|
loadData()
|
||||||
|
if(d.flagVisible){
|
||||||
|
control_popup.visible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TapHandler {
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
onTapped: control.echoMode !== TextInput.Password && menu.popup()
|
||||||
|
}
|
||||||
|
FluTextBoxMenu{
|
||||||
|
id:menu
|
||||||
|
inputItem: control
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchData(){
|
function handleClick(modelData){
|
||||||
|
control_popup.visible = false
|
||||||
|
control.itemClicked(modelData)
|
||||||
|
updateText(modelData.title)
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateText(text){
|
||||||
|
d.flagVisible = false
|
||||||
|
control.text = text
|
||||||
|
d.flagVisible = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadData(){
|
||||||
var result = []
|
var result = []
|
||||||
if(values==null){
|
if(items==null){
|
||||||
list_view.model = result
|
list_view.model = result
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
values.map(function(item){
|
items.map(function(item){
|
||||||
if(item.indexOf(input.text)!==-1){
|
if(item.title.indexOf(control.text)!==-1){
|
||||||
result.push(item)
|
result.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -290,4 +156,3 @@ TextField{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
property color dividerColor: FluTheme.dark ? Qt.rgba(77/255,77/255,77/255,1) : Qt.rgba(239/255,239/255,239/255,1)
|
property color dividerColor: FluTheme.dark ? Qt.rgba(77/255,77/255,77/255,1) : Qt.rgba(239/255,239/255,239/255,1)
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
|
property string text: "请选择日期"
|
||||||
property var window : Window.window
|
property var window : Window.window
|
||||||
|
|
||||||
id:root
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(mouse_area.containsMouse){
|
if(mouse_area.containsMouse){
|
||||||
return hoverColor
|
return hoverColor
|
||||||
@ -44,13 +45,13 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text:"请选择日期"
|
text:control.text
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIcon{
|
FluIcon{
|
||||||
iconSource: FluentIcons.Calendar
|
iconSource: FluentIcons.Calendar
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
color: text_date.color
|
iconColor: text_date.color
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
right: parent.right
|
right: parent.right
|
||||||
@ -59,7 +60,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Popup{
|
Menu{
|
||||||
id:popup
|
id:popup
|
||||||
height: container.height
|
height: container.height
|
||||||
width: container.width
|
width: container.width
|
||||||
@ -79,28 +80,31 @@ Rectangle {
|
|||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: FluCalendarView{
|
contentItem: Item{
|
||||||
id:container
|
anchors.fill: parent
|
||||||
onDateClicked:
|
FluCalendarView{
|
||||||
(date)=>{
|
id:container
|
||||||
popup.close()
|
onDateClicked:
|
||||||
var year = date.getFullYear()
|
(date)=>{
|
||||||
var month = date.getMonth()
|
popup.close()
|
||||||
var day = date.getDate()
|
var year = date.getFullYear()
|
||||||
text_date.text = year+"-"+(month+1)+"-"+day
|
var month = date.getMonth()
|
||||||
}
|
var day = date.getDate()
|
||||||
|
text_date.text = year+"-"+(month+1)+"-"+day
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
contentItem: Item{}
|
background: Item{}
|
||||||
function showPopup() {
|
function showPopup() {
|
||||||
var pos = root.mapToItem(null, 0, 0)
|
var pos = control.mapToItem(null, 0, 0)
|
||||||
if(window.height>pos.y+root.height+popup.height){
|
if(window.height>pos.y+control.height+popup.height){
|
||||||
popup.y = root.height
|
popup.y = control.height
|
||||||
} else if(pos.y>popup.height){
|
} else if(pos.y>popup.height){
|
||||||
popup.y = -popup.height
|
popup.y = -popup.height
|
||||||
} else {
|
} else {
|
||||||
popup.y = window.height-(pos.y+popup.height)
|
popup.y = window.height-(pos.y+popup.height)
|
||||||
}
|
}
|
||||||
popup.x = -(popup.width-root.width)/2
|
popup.x = -(popup.width-control.width)/2
|
||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
@ -73,16 +73,28 @@ Button {
|
|||||||
}
|
}
|
||||||
return normalColor
|
return normalColor
|
||||||
}
|
}
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
FluIcon {
|
FluIcon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
iconSource: FluentIcons.AcceptMedium
|
iconSource: FluentIcons.AcceptMedium
|
||||||
iconSize: 15
|
iconSize: 15
|
||||||
visible: selected
|
visible: selected
|
||||||
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
iconColor: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||||
|
Behavior on visible {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:control.text
|
text: control.text
|
||||||
|
Layout.leftMargin: 5
|
||||||
|
visible: text !== ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
|
|
||||||
Button{
|
Button{
|
||||||
@ -27,15 +27,19 @@ Button{
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
popup.showPopup()
|
popup.showPopup()
|
||||||
}
|
}
|
||||||
Popup{
|
Menu{
|
||||||
id:popup
|
id:popup
|
||||||
modal: true
|
modal: true
|
||||||
dim:false
|
dim:false
|
||||||
height: container.height
|
height: container.height
|
||||||
width: container.width
|
width: container.width
|
||||||
background: FluColorView{
|
contentItem: Item{
|
||||||
id:container
|
anchors.fill: parent
|
||||||
|
FluColorView{
|
||||||
|
id:container
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
background:Item{}
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "y"
|
property: "y"
|
||||||
@ -50,7 +54,6 @@ Button{
|
|||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentItem: Item{}
|
|
||||||
function showPopup() {
|
function showPopup() {
|
||||||
var pos = control.mapToItem(null, 0, 0)
|
var pos = control.mapToItem(null, 0, 0)
|
||||||
if(window.height>pos.y+control.height+popup.height){
|
if(window.height>pos.y+control.height+popup.height){
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import "../colorpicker"
|
import "../colorpicker"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
|
|
||||||
Popup {
|
Popup {
|
||||||
id: popup
|
id: popup
|
||||||
@ -17,11 +17,11 @@ Popup {
|
|||||||
return 400
|
return 400
|
||||||
return Math.min(Window.window.width,400)
|
return Math.min(Window.window.width,400)
|
||||||
}
|
}
|
||||||
|
|
||||||
modal:true
|
modal:true
|
||||||
anchors.centerIn: Overlay.overlay
|
anchors.centerIn: Overlay.overlay
|
||||||
closePolicy: Popup.CloseOnEscape
|
closePolicy: Popup.CloseOnEscape
|
||||||
background: Rectangle {
|
background:Item{}
|
||||||
|
contentItem: Rectangle {
|
||||||
id:layout_content
|
id:layout_content
|
||||||
implicitWidth:minWidth
|
implicitWidth:minWidth
|
||||||
implicitHeight: text_title.height + text_message.height + layout_actions.height
|
implicitHeight: text_title.height + text_message.height + layout_actions.height
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
@ -97,12 +97,11 @@ Rectangle {
|
|||||||
text:"日"
|
text:"日"
|
||||||
}
|
}
|
||||||
|
|
||||||
Popup{
|
Menu{
|
||||||
id:popup
|
id:popup
|
||||||
width: container.width
|
|
||||||
height: container.height
|
|
||||||
contentItem: Item{}
|
|
||||||
modal: true
|
modal: true
|
||||||
|
width: 300
|
||||||
|
height: 340
|
||||||
dim:false
|
dim:false
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
@ -118,12 +117,12 @@ Rectangle {
|
|||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: Rectangle{
|
background:Item{}
|
||||||
|
contentItem: Rectangle{
|
||||||
id:container
|
id:container
|
||||||
width: 300
|
|
||||||
radius: 4
|
radius: 4
|
||||||
|
anchors.fill: parent
|
||||||
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
|
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
|
||||||
height: 340
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
@ -337,9 +336,7 @@ Rectangle {
|
|||||||
popup.close()
|
popup.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
y:35
|
y:35
|
||||||
function showPopup() {
|
function showPopup() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ Button {
|
|||||||
rightMargin: 10
|
rightMargin: 10
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
color:title.color
|
iconColor:title.color
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
@ -51,15 +51,22 @@ Item {
|
|||||||
if(root_mouse.containsMouse){
|
if(root_mouse.containsMouse){
|
||||||
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(245/255,245/255,245/255,1)
|
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(245/255,245/255,245/255,1)
|
||||||
}
|
}
|
||||||
return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
return FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||||
}
|
}
|
||||||
iconSize: 15
|
|
||||||
iconSource: expand ? FluentIcons.ChevronUp : FluentIcons.ChevronDown
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
expand = !expand
|
expand = !expand
|
||||||
}
|
}
|
||||||
|
contentItem: FluIcon{
|
||||||
|
rotation: expand?0:180
|
||||||
|
iconSource:FluentIcons.ChevronUp
|
||||||
|
iconSize: 15
|
||||||
|
Behavior on rotation {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
|
116
src/controls/FluFlipView.qml
Normal file
116
src/controls/FluFlipView.qml
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
Item{
|
||||||
|
|
||||||
|
property bool vertical: false
|
||||||
|
default property alias content : swipe.contentData
|
||||||
|
property alias currentIndex: swipe.currentIndex
|
||||||
|
|
||||||
|
id:control
|
||||||
|
width: 400
|
||||||
|
height: 300
|
||||||
|
implicitWidth: width
|
||||||
|
implicitHeight: height
|
||||||
|
|
||||||
|
QtObject{
|
||||||
|
id:d
|
||||||
|
property bool flag: true
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
preventStealing: true
|
||||||
|
onWheel:
|
||||||
|
(wheel)=>{
|
||||||
|
if(!d.flag)
|
||||||
|
return
|
||||||
|
if (wheel.angleDelta.y > 0){
|
||||||
|
btn_start.clicked()
|
||||||
|
}else{
|
||||||
|
btn_end.clicked()
|
||||||
|
}
|
||||||
|
d.flag = false
|
||||||
|
timer.restart()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer{
|
||||||
|
id:timer
|
||||||
|
interval: 250
|
||||||
|
onTriggered: {
|
||||||
|
d.flag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SwipeView {
|
||||||
|
id:swipe
|
||||||
|
clip: true
|
||||||
|
interactive: false
|
||||||
|
orientation:control.vertical ? Qt.Vertical : Qt.Horizontal
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
Button{
|
||||||
|
id:btn_start
|
||||||
|
height: vertical ? 20 : 40
|
||||||
|
width: vertical ? 40 : 20
|
||||||
|
anchors{
|
||||||
|
left: vertical ? undefined : parent.left
|
||||||
|
leftMargin: vertical ? undefined : 2
|
||||||
|
verticalCenter: vertical ? undefined : parent.verticalCenter
|
||||||
|
horizontalCenter: !vertical ? undefined : parent.horizontalCenter
|
||||||
|
top: !vertical ? undefined :parent.top
|
||||||
|
topMargin: !vertical ? undefined :2
|
||||||
|
}
|
||||||
|
background: Rectangle{
|
||||||
|
radius: 4
|
||||||
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
||||||
|
}
|
||||||
|
contentItem:FluIcon{
|
||||||
|
iconSource: vertical ? FluentIcons.CaretUpSolid8 : FluentIcons.CaretLeftSolid8
|
||||||
|
width: 10
|
||||||
|
height: 10
|
||||||
|
iconSize: 10
|
||||||
|
iconColor: btn_start.hovered ? FluColors.Grey220 : FluColors.Grey120
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
visible: swipe.currentIndex !==0
|
||||||
|
onClicked: {
|
||||||
|
swipe.currentIndex = Math.max(swipe.currentIndex - 1, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button{
|
||||||
|
id:btn_end
|
||||||
|
height: vertical ? 20 : 40
|
||||||
|
width: vertical ? 40 : 20
|
||||||
|
anchors{
|
||||||
|
right: vertical ? undefined : parent.right
|
||||||
|
rightMargin: vertical ? undefined : 2
|
||||||
|
verticalCenter: vertical ? undefined : parent.verticalCenter
|
||||||
|
horizontalCenter: !vertical ? undefined : parent.horizontalCenter
|
||||||
|
bottom: !vertical ? undefined :parent.bottom
|
||||||
|
bottomMargin: !vertical ? undefined :2
|
||||||
|
}
|
||||||
|
background: Rectangle{
|
||||||
|
radius: 4
|
||||||
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
||||||
|
}
|
||||||
|
visible: swipe.currentIndex !== swipe.count - 1
|
||||||
|
contentItem:FluIcon{
|
||||||
|
iconSource: vertical ? FluentIcons.CaretDownSolid8 : FluentIcons.CaretRightSolid8
|
||||||
|
width: 10
|
||||||
|
height: 10
|
||||||
|
iconSize: 10
|
||||||
|
iconColor: btn_end.hovered ? FluColors.Grey220 : FluColors.Grey120
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
swipe.currentIndex = Math.min(swipe.currentIndex + 1,swipe.count-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ Button {
|
|||||||
}
|
}
|
||||||
return hovered ? hoverColor : normalColor
|
return hovered ? hoverColor : normalColor
|
||||||
}
|
}
|
||||||
property color textColor: {
|
property color iconColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(disabled){
|
if(disabled){
|
||||||
return Qt.rgba(130/255,130/255,130/255,1)
|
return Qt.rgba(130/255,130/255,130/255,1)
|
||||||
@ -57,7 +57,7 @@ Button {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color:control.textColor
|
color:control.iconColor
|
||||||
text: (String.fromCharCode(iconSource).toString(16));
|
text: (String.fromCharCode(iconSource).toString(16));
|
||||||
}
|
}
|
||||||
FluTooltip{
|
FluTooltip{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluObject {
|
FluObject {
|
||||||
id:infoBar
|
id:infoBar
|
||||||
@ -178,7 +178,7 @@ FluObject {
|
|||||||
return FluentIcons.FA_info_circle
|
return FluentIcons.FA_info_circle
|
||||||
}
|
}
|
||||||
iconSize:20
|
iconSize:20
|
||||||
color: {
|
iconColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
switch(_super.type){
|
switch(_super.type){
|
||||||
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1);
|
||||||
@ -208,23 +208,23 @@ FluObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSuccess(text,duration,moremsg){
|
function showSuccess(text,duration=1000,moremsg){
|
||||||
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showInfo(text,duration,moremsg){
|
function showInfo(text,duration=1000,moremsg){
|
||||||
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showWarning(text,duration,moremsg){
|
function showWarning(text,duration=1000,moremsg){
|
||||||
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showError(text,duration,moremsg){
|
function showError(text,duration=1000,moremsg){
|
||||||
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showCustom(itemcomponent,duration){
|
function showCustom(itemcomponent,duration=1000){
|
||||||
mcontrol.createCustom(itemcomponent,duration);
|
mcontrol.createCustom(itemcomponent,duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtGraphicalEffects 1.15
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:control
|
id:control
|
||||||
@ -14,6 +14,18 @@ Item{
|
|||||||
opacity: 0
|
opacity: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onWidthChanged: {
|
||||||
|
canvas.requestPaint()
|
||||||
|
}
|
||||||
|
|
||||||
|
onHeightChanged: {
|
||||||
|
canvas.requestPaint()
|
||||||
|
}
|
||||||
|
|
||||||
|
onRadiusChanged: {
|
||||||
|
canvas.requestPaint()
|
||||||
|
}
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
id: canvas
|
id: canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtMultimedia 5.15
|
import QtMultimedia
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
@ -17,6 +17,7 @@ Rectangle {
|
|||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
preventStealing: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showControl = !showControl
|
showControl = !showControl
|
||||||
}
|
}
|
||||||
@ -25,22 +26,28 @@ Rectangle {
|
|||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: mediaplayer
|
id: mediaplayer
|
||||||
property bool autoSeek:true
|
property bool autoSeek:true
|
||||||
autoPlay: true
|
|
||||||
source: control.source
|
source: control.source
|
||||||
onError: {
|
videoOutput: video_output
|
||||||
console.debug(error)
|
audioOutput: AudioOutput{
|
||||||
|
id:audio_output
|
||||||
}
|
}
|
||||||
|
onErrorChanged:
|
||||||
|
(error)=> {
|
||||||
|
console.debug(error)
|
||||||
|
}
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
if(autoSeek){
|
if(autoSeek){
|
||||||
slider.seek(mediaplayer.position*slider.maxValue/mediaplayer.duration)
|
slider.seek(mediaplayer.position*slider.maxValue/mediaplayer.duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onStatusChanged: {
|
onMediaStatusChanged:
|
||||||
if(status===6){
|
(status)=> {
|
||||||
slider.maxValue = mediaplayer.duration
|
if(status===2){
|
||||||
showControl = true
|
slider.maxValue = mediaplayer.duration
|
||||||
|
showControl = true
|
||||||
|
mediaplayer.play()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
@ -48,29 +55,31 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoOutput {
|
VideoOutput {
|
||||||
|
id:video_output
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: mediaplayer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
height: 100
|
height: 100
|
||||||
y:showControl ? control.height - 110 : control.height
|
y:showControl ? control.height - 110 : control.height
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
horizontalCenter: parent.horizontalCenter
|
||||||
right: parent.right
|
|
||||||
leftMargin: 10
|
|
||||||
rightMargin: 10
|
|
||||||
}
|
}
|
||||||
|
width: 460
|
||||||
|
opacity: showControl
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
Behavior on opacity{
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
Behavior on y{
|
Behavior on y{
|
||||||
NumberAnimation{
|
NumberAnimation{
|
||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
||||||
@ -82,25 +91,23 @@ Rectangle {
|
|||||||
size:parent.width-20
|
size:parent.width-20
|
||||||
y:20
|
y:20
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
enableTip:false
|
tipEnabled:false
|
||||||
onPressed: {
|
onPressed: {
|
||||||
mediaplayer.autoSeek = false
|
mediaplayer.autoSeek = false
|
||||||
mediaplayer.pause()
|
mediaplayer.pause()
|
||||||
}
|
}
|
||||||
value:0
|
value:mediaplayer.position
|
||||||
onReleased: {
|
onReleased: {
|
||||||
mediaplayer.autoSeek = true
|
mediaplayer.autoSeek = true
|
||||||
mediaplayer.play()
|
mediaplayer.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
if(mediaplayer.autoSeek == false){
|
if(mediaplayer.autoSeek == false){
|
||||||
mediaplayer.seek(value*mediaplayer.duration/slider.maxValue)
|
mediaplayer.position = value*mediaplayer.duration/slider.maxValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onLineClickFunc:function(val){
|
onLineClickFunc:function(val){
|
||||||
mediaplayer.seek(val*mediaplayer.duration/slider.maxValue)
|
mediaplayer.position = val*mediaplayer.duration/slider.maxValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +121,6 @@ Rectangle {
|
|||||||
text: formatDuration(slider.value*mediaplayer.duration/slider.maxValue)
|
text: formatDuration(slider.value*mediaplayer.duration/slider.maxValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:end_time
|
id:end_time
|
||||||
anchors{
|
anchors{
|
||||||
@ -125,7 +131,6 @@ Rectangle {
|
|||||||
text: formatDuration(mediaplayer.duration)
|
text: formatDuration(mediaplayer.duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
spacing: 10
|
spacing: 10
|
||||||
anchors{
|
anchors{
|
||||||
@ -137,14 +142,14 @@ Rectangle {
|
|||||||
iconSize: 17
|
iconSize: 17
|
||||||
iconSource: FluentIcons.SkipBack10
|
iconSource: FluentIcons.SkipBack10
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mediaplayer.seek(Math.max(mediaplayer.position-10*1000,0))
|
mediaplayer.position = Math.max(mediaplayer.position-10*1000,0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
iconSize: 15
|
iconSize: 15
|
||||||
iconSource: mediaplayer.playbackState === Audio.PlayingState ? FluentIcons.Pause : FluentIcons.Play
|
iconSource: mediaplayer.playbackState === MediaPlayer.PlayingState ? FluentIcons.Pause : FluentIcons.Play
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(mediaplayer.playbackState === Audio.PlayingState){
|
if(mediaplayer.playbackState === MediaPlayer.PlayingState){
|
||||||
mediaplayer.pause()
|
mediaplayer.pause()
|
||||||
}else{
|
}else{
|
||||||
mediaplayer.play()
|
mediaplayer.play()
|
||||||
@ -155,16 +160,15 @@ Rectangle {
|
|||||||
iconSize: 17
|
iconSize: 17
|
||||||
iconSource: FluentIcons.SkipForward30
|
iconSource: FluentIcons.SkipForward30
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mediaplayer.seek(Math.min(mediaplayer.position+30*1000,mediaplayer.duration))
|
mediaplayer.position = Math.min(mediaplayer.position+30*1000,mediaplayer.duration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_volume
|
id:btn_volume
|
||||||
iconSize: 17
|
iconSize: 17
|
||||||
iconSource: mediaplayer.volume ? FluentIcons.Volume : FluentIcons.Mute
|
iconSource: audio_output.muted ? FluentIcons.Mute : FluentIcons.Volume
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 5
|
leftMargin: 5
|
||||||
@ -172,7 +176,7 @@ Rectangle {
|
|||||||
bottomMargin: 10
|
bottomMargin: 10
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mediaplayer.volume = !mediaplayer.volume
|
audio_output.muted = !audio_output.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,10 +191,9 @@ Rectangle {
|
|||||||
leftMargin: 10
|
leftMargin: 10
|
||||||
}
|
}
|
||||||
onValueChanged:{
|
onValueChanged:{
|
||||||
mediaplayer.volume = value/100
|
audio_output.volume = value/100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDuration(duration) {
|
function formatDuration(duration) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
|
|
||||||
@ -9,10 +9,8 @@ Menu {
|
|||||||
id: popup
|
id: popup
|
||||||
width: 140
|
width: 140
|
||||||
height: container.height
|
height: container.height
|
||||||
modal: true
|
modal:true
|
||||||
dim:false
|
dim:false
|
||||||
contentItem: Item{}
|
|
||||||
|
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "y"
|
property: "y"
|
||||||
@ -27,8 +25,8 @@ Menu {
|
|||||||
duration: animEnabled ? 150 : 0
|
duration: animEnabled ? 150 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
background:Item{}
|
||||||
background: Item {
|
contentItem: Item {
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,0.97) : Qt.rgba(237/255,237/255,237/255,0.97)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
import QtQuick 2.15
|
|
||||||
import QtQuick.Controls 2.15
|
|
||||||
import FluentUI 1.0
|
|
||||||
|
|
||||||
TextArea{
|
|
||||||
|
|
||||||
property int fontStyle: FluText.Body
|
|
||||||
property int pixelSize : FluTheme.textSize
|
|
||||||
property bool disabled: false
|
|
||||||
|
|
||||||
id:input
|
|
||||||
width: 300
|
|
||||||
color: {
|
|
||||||
if(disabled){
|
|
||||||
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
|
||||||
}
|
|
||||||
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
|
|
||||||
}
|
|
||||||
enabled: !disabled
|
|
||||||
wrapMode: Text.WrapAnywhere
|
|
||||||
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
|
||||||
selectByMouse: true
|
|
||||||
selectionColor: {
|
|
||||||
if(FluTheme.dark){
|
|
||||||
return FluTheme.primaryColor.lighter
|
|
||||||
}else{
|
|
||||||
return FluTheme.primaryColor.dark
|
|
||||||
}
|
|
||||||
}
|
|
||||||
background: FluTextBoxBackground{
|
|
||||||
inputItem: input
|
|
||||||
}
|
|
||||||
placeholderTextColor: {
|
|
||||||
if(disabled){
|
|
||||||
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
|
||||||
}
|
|
||||||
if(focus){
|
|
||||||
return FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
|
||||||
}
|
|
||||||
return FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
|
||||||
}
|
|
||||||
font.bold: {
|
|
||||||
switch (fontStyle) {
|
|
||||||
case FluText.Display:
|
|
||||||
return true
|
|
||||||
case FluText.TitleLarge:
|
|
||||||
return true
|
|
||||||
case FluText.Title:
|
|
||||||
return true
|
|
||||||
case FluText.Subtitle:
|
|
||||||
return true
|
|
||||||
case FluText.BodyLarge:
|
|
||||||
return false
|
|
||||||
case FluText.BodyStrong:
|
|
||||||
return true
|
|
||||||
case FluText.Body:
|
|
||||||
return false
|
|
||||||
case FluText.Caption:
|
|
||||||
return false
|
|
||||||
default:
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
font.pixelSize: {
|
|
||||||
switch (fontStyle) {
|
|
||||||
case FluText.Display:
|
|
||||||
return input.pixelSize * 4
|
|
||||||
case FluText.TitleLarge:
|
|
||||||
return input.pixelSize * 2
|
|
||||||
case FluText.Title:
|
|
||||||
return input.pixelSize * 1.5
|
|
||||||
case FluText.Subtitle:
|
|
||||||
return input.pixelSize * 0.9
|
|
||||||
case FluText.BodyLarge:
|
|
||||||
return input.pixelSize * 1.1
|
|
||||||
case FluText.BodyStrong:
|
|
||||||
return input.pixelSize * 1.0
|
|
||||||
case FluText.Body:
|
|
||||||
return input.pixelSize * 1.0
|
|
||||||
case FluText.Caption:
|
|
||||||
return input.pixelSize * 0.8
|
|
||||||
default:
|
|
||||||
return input.pixelSize * 1.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
88
src/controls/FluMultilineTextBox.qml
Normal file
88
src/controls/FluMultilineTextBox.qml
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
TextArea{
|
||||||
|
|
||||||
|
property int fontStyle: FluText.Body
|
||||||
|
property int pixelSize : FluTheme.textSize
|
||||||
|
property bool disabled: false
|
||||||
|
property color normalColor: FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
|
||||||
|
property color disableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
|
||||||
|
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||||
|
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
|
||||||
|
id:control
|
||||||
|
width: 300
|
||||||
|
enabled: !disabled
|
||||||
|
color: {
|
||||||
|
if(disabled){
|
||||||
|
return disableColor
|
||||||
|
}
|
||||||
|
return normalColor
|
||||||
|
}
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
|
selectionColor: FluTheme.primaryColor.lightest
|
||||||
|
placeholderTextColor: {
|
||||||
|
if(disabled){
|
||||||
|
return placeholderDisableColor
|
||||||
|
}
|
||||||
|
if(focus){
|
||||||
|
return placeholderFocusColor
|
||||||
|
}
|
||||||
|
return placeholderNormalColor
|
||||||
|
}
|
||||||
|
font.bold: {
|
||||||
|
switch (fontStyle) {
|
||||||
|
case FluText.Display:
|
||||||
|
return true
|
||||||
|
case FluText.TitleLarge:
|
||||||
|
return true
|
||||||
|
case FluText.Title:
|
||||||
|
return true
|
||||||
|
case FluText.SubTitle:
|
||||||
|
return true
|
||||||
|
case FluText.BodyStrong:
|
||||||
|
return true
|
||||||
|
case FluText.Body:
|
||||||
|
return false
|
||||||
|
case FluText.Caption:
|
||||||
|
return false
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
font.pixelSize: {
|
||||||
|
switch (fontStyle) {
|
||||||
|
case FluText.Display:
|
||||||
|
return text.pixelSize * 4.857
|
||||||
|
case FluText.TitleLarge:
|
||||||
|
return text.pixelSize * 2.857
|
||||||
|
case FluText.Title:
|
||||||
|
return text.pixelSize * 2
|
||||||
|
case FluText.SubTitle:
|
||||||
|
return text.pixelSize * 1.428
|
||||||
|
case FluText.Body:
|
||||||
|
return text.pixelSize * 1.0
|
||||||
|
case FluText.BodyStrong:
|
||||||
|
return text.pixelSize * 1.0
|
||||||
|
case FluText.Caption:
|
||||||
|
return text.pixelSize * 0.857
|
||||||
|
default:
|
||||||
|
return text.pixelSize * 1.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selectByMouse: true
|
||||||
|
background: FluTextBoxBackground{ inputItem: control }
|
||||||
|
TapHandler {
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
onTapped: control.echoMode !== TextInput.Password && menu.popup()
|
||||||
|
}
|
||||||
|
FluTextBoxMenu{
|
||||||
|
id:menu
|
||||||
|
inputItem: control
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,16 +1,18 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property alias logo : image_logo.source
|
property alias logo : image_logo.source
|
||||||
|
property string title: ""
|
||||||
property FluObject items
|
property FluObject items
|
||||||
property FluObject footerItems
|
property FluObject footerItems
|
||||||
property int displayMode: width<=700 ? FluNavigationView.Minimal : FluNavigationView.Open
|
property int displayMode: width<=700 ? FluNavigationView.Minimal : FluNavigationView.Open
|
||||||
property bool displaMinimalMenu : false
|
property bool displaMinimalMenu : false
|
||||||
|
property Component autoSuggestBox
|
||||||
|
|
||||||
id:root
|
id:root
|
||||||
|
|
||||||
@ -46,14 +48,34 @@ Item {
|
|||||||
id:com_panel_item_separatorr
|
id:com_panel_item_separatorr
|
||||||
FluDivider{
|
FluDivider{
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
height: 1
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 1 : 0
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_header
|
id:com_panel_item_header
|
||||||
Item{
|
Item{
|
||||||
height: 30
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 30 : 0
|
||||||
|
}
|
||||||
|
return 30
|
||||||
|
}
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
FluText{
|
FluText{
|
||||||
text:model.title
|
text:model.title
|
||||||
@ -68,7 +90,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item
|
id:com_panel_item_expander
|
||||||
Item{
|
Item{
|
||||||
height: 38
|
height: 38
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
@ -90,11 +112,121 @@ Item {
|
|||||||
height: 18
|
height: 18
|
||||||
radius: 1.5
|
radius: 1.5
|
||||||
color: FluTheme.primaryColor.dark
|
color: FluTheme.primaryColor.dark
|
||||||
visible: nav_list.currentIndex === position && type===0
|
visible: {
|
||||||
|
for(var i=0;i<model.children.length;i++){
|
||||||
|
var item = model.children[i]
|
||||||
|
if(item.idx === nav_list.currentIndex && !model.isExpand){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluIcon{
|
||||||
|
rotation: model.isExpand?0:180
|
||||||
|
iconSource:FluentIcons.ChevronUp
|
||||||
|
iconSize: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 12
|
||||||
|
}
|
||||||
|
Behavior on rotation {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
id:item_mouse
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
model.isExpand = !model.isExpand
|
||||||
|
}
|
||||||
|
}
|
||||||
|
color: {
|
||||||
|
if(FluTheme.dark){
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(1,1,1,0.03)
|
||||||
|
}
|
||||||
|
if((nav_list.currentIndex === position)&&type===0){
|
||||||
|
return Qt.rgba(1,1,1,0.06)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,0)
|
||||||
|
}else{
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(0,0,0,0.03)
|
||||||
|
}
|
||||||
|
if(nav_list.currentIndex === position&&type===0){
|
||||||
|
return Qt.rgba(0,0,0,0.06)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluIcon{
|
||||||
|
id:item_icon
|
||||||
|
iconSource: {
|
||||||
|
if(model.icon){
|
||||||
|
return model.icon
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
width: 30
|
||||||
|
height: 30
|
||||||
|
iconSize: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:parent.left
|
||||||
|
leftMargin: 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
id:item_title
|
||||||
|
text:model.title
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:item_icon.right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id:com_panel_item
|
||||||
|
Item{
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 38 : 0
|
||||||
|
}
|
||||||
|
return 38
|
||||||
|
}
|
||||||
|
width: nav_list.width
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
radius: 4
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
topMargin: 2
|
||||||
|
bottomMargin: 2
|
||||||
|
leftMargin: 6
|
||||||
|
rightMargin: 6
|
||||||
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:item_mouse
|
id:item_mouse
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@ -214,7 +346,7 @@ Item {
|
|||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text:"FluentUI"
|
text:root.title
|
||||||
Layout.leftMargin: 12
|
Layout.leftMargin: 12
|
||||||
fontStyle: FluText.Body
|
fontStyle: FluText.Body
|
||||||
}
|
}
|
||||||
@ -257,6 +389,17 @@ Item {
|
|||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_list
|
id:layout_list
|
||||||
width: 300
|
width: 300
|
||||||
|
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
||||||
|
border.width: displayMode === FluNavigationView.Minimal ? 1 : 0
|
||||||
|
color: {
|
||||||
|
if(displayMode === FluNavigationView.Minimal){
|
||||||
|
return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||||
|
}
|
||||||
|
if(window && window.active){
|
||||||
|
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(238/255,244/255,249/255,1)
|
||||||
|
}
|
||||||
|
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
||||||
|
}
|
||||||
anchors{
|
anchors{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
@ -273,70 +416,29 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
color: {
|
|
||||||
if(displayMode === FluNavigationView.Minimal){
|
|
||||||
return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
|
||||||
}
|
|
||||||
if(window && window.active){
|
|
||||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(238/255,244/255,249/255,1)
|
|
||||||
}
|
|
||||||
return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
|
||||||
}
|
|
||||||
Behavior on color{
|
Behavior on color{
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
|
||||||
border.width: displayMode === FluNavigationView.Minimal ? 1 : 0
|
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:layout_header
|
id:layout_header
|
||||||
width: layout_list.width
|
width: layout_list.width
|
||||||
y:nav_app_bar.height
|
y:nav_app_bar.height
|
||||||
height: textbox_search.height
|
height: {
|
||||||
|
if(loader_auto_suggest_box.item){
|
||||||
FluAutoSuggestBox{
|
return loader_auto_suggest_box.item.height
|
||||||
id:textbox_search
|
|
||||||
width: 280
|
|
||||||
anchors.centerIn: parent
|
|
||||||
iconSource: FluentIcons.Zoom
|
|
||||||
values: {
|
|
||||||
var arr = []
|
|
||||||
if(items==null)
|
|
||||||
return arr
|
|
||||||
if(items.children==null)
|
|
||||||
return arr
|
|
||||||
for(var i=0;i<items.children.length;i++){
|
|
||||||
var item = items.children[i]
|
|
||||||
if(item instanceof FluPaneItem){
|
|
||||||
arr.push(item.title)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
}
|
}
|
||||||
placeholderText: "查找"
|
return 0
|
||||||
onItemClicked:
|
}
|
||||||
(data)=>{
|
Loader{
|
||||||
var arr = []
|
id:loader_auto_suggest_box
|
||||||
if(items==null)
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
return arr
|
sourceComponent: autoSuggestBox
|
||||||
if(items.children==null)
|
|
||||||
return arr
|
|
||||||
for(var i=0;i<items.children.length;i++){
|
|
||||||
if(items.children[i].title === data){
|
|
||||||
if(nav_list.currentIndex === i){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
items.children[i].tap()
|
|
||||||
nav_list.currentIndex = i
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id:nav_list
|
id:nav_list
|
||||||
property bool enableStack: true
|
property bool enableStack: true
|
||||||
@ -349,20 +451,29 @@ Item {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: layout_footer.top
|
bottom: layout_footer.top
|
||||||
}
|
}
|
||||||
|
highlightMoveDuration: 150
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
if(enableStack){
|
if(enableStack){
|
||||||
stackIndex.push(currentIndex)
|
stackIndex.push(currentIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
highlight: Item{
|
||||||
|
clip: true
|
||||||
model:{
|
Rectangle{
|
||||||
if(items){
|
height: 18
|
||||||
return items.children
|
radius: 1.5
|
||||||
|
color: FluTheme.primaryColor.dark
|
||||||
|
width: 3
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
leftMargin: 6
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boundsBehavior: ListView.StopAtBounds
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
|
model:handleItems()
|
||||||
delegate: Loader{
|
delegate: Loader{
|
||||||
property var model: modelData
|
property var model: modelData
|
||||||
property var position: index
|
property var position: index
|
||||||
@ -377,6 +488,9 @@ Item {
|
|||||||
if(modelData instanceof FluPaneItemSeparator){
|
if(modelData instanceof FluPaneItemSeparator){
|
||||||
return com_panel_item_separatorr
|
return com_panel_item_separatorr
|
||||||
}
|
}
|
||||||
|
if(modelData instanceof FluPaneItemExpander){
|
||||||
|
return com_panel_item_expander
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -386,7 +500,6 @@ Item {
|
|||||||
width: layout_list.width
|
width: layout_list.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
boundsBehavior: ListView.StopAtBounds
|
|
||||||
model: {
|
model: {
|
||||||
if(footerItems){
|
if(footerItems){
|
||||||
return footerItems.children
|
return footerItems.children
|
||||||
@ -412,6 +525,33 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleItems(){
|
||||||
|
var idx = 0
|
||||||
|
var data = []
|
||||||
|
if(items){
|
||||||
|
for(var i=0;i<items.children.length;i++){
|
||||||
|
var item = items.children[i]
|
||||||
|
item.idx = idx
|
||||||
|
data.push(item)
|
||||||
|
idx++
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
itemChild.parent = item
|
||||||
|
itemChild.idx = idx
|
||||||
|
data.push(itemChild)
|
||||||
|
idx++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
function getItems(){
|
||||||
|
return nav_list.model
|
||||||
|
}
|
||||||
|
|
||||||
function push(url){
|
function push(url){
|
||||||
nav_swipe.push(url)
|
nav_swipe.push(url)
|
||||||
}
|
}
|
||||||
@ -420,17 +560,8 @@ Item {
|
|||||||
nav_list.currentIndex = index
|
nav_list.currentIndex = index
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPageByTitle(title){
|
function getCurrentIndex(){
|
||||||
for(var i=0;i<items.children.length;i++){
|
return nav_list.currentIndex
|
||||||
if(items.children[i].title === title){
|
|
||||||
if(nav_list.currentIndex === i){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
items.children[i].tap()
|
|
||||||
nav_list.currentIndex = i
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id:flu_object;
|
id:flu_object;
|
||||||
|
@ -1,8 +1,18 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
readonly property string key : FluApp.uuid()
|
||||||
|
readonly property int flag : 0
|
||||||
property string title
|
property string title
|
||||||
property var icon
|
property int order : 0
|
||||||
|
property int icon
|
||||||
|
property bool recentlyAdded: false
|
||||||
|
property bool recentlyUpdated: false
|
||||||
|
property string desc
|
||||||
|
property var image
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
signal tap
|
signal tap
|
||||||
signal repTap
|
signal repTap
|
||||||
}
|
}
|
||||||
|
14
src/controls/FluPaneItemExpander.qml
Normal file
14
src/controls/FluPaneItemExpander.qml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluObject {
|
||||||
|
readonly property int flag : 3
|
||||||
|
readonly property string key : FluApp.uuid()
|
||||||
|
property string title
|
||||||
|
property int icon
|
||||||
|
property bool isExpand: false
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
|
signal tap
|
||||||
|
signal repTap
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user