Compare commits
69 Commits
Author | SHA1 | Date | |
---|---|---|---|
3eeaae24db | |||
e67e7e4d3b | |||
d5ca61c0f6 | |||
15f90471dc | |||
2129301cd2 | |||
6366651453 | |||
8480267127 | |||
9adc63b3bc | |||
0003f8192e | |||
1491abc614 | |||
edd1ea90b9 | |||
4aba260eb5 | |||
8668db1587 | |||
56681cb5a3 | |||
ab68770d63 | |||
594c0222a2 | |||
2fb322536e | |||
71d3af6d49 | |||
323927c3ae | |||
30c99c0907 | |||
d488ca481c | |||
3232ae9a7c | |||
0da8d18467 | |||
8b531e4637 | |||
bd422f96cf | |||
155960c15b | |||
1601b64883 | |||
5539c59233 | |||
4b2cbb542e | |||
b36ceed119 | |||
1129a935eb | |||
1446fd8933 | |||
4e4760e37f | |||
f365e08fb2 | |||
c0b76e6282 | |||
ac0b0aaaa9 | |||
a89d36fd14 | |||
7d7cd4144c | |||
68cf87dba9 | |||
55e668e95e | |||
e1889f7572 | |||
bcb862e316 | |||
b93f91a73f | |||
09dd381bbc | |||
09fa471a10 | |||
fb48ed543b | |||
b8179f0df4 | |||
1dd09ef676 | |||
bc6041b5a4 | |||
75193b216f | |||
c095008042 | |||
128bb94742 | |||
684cf47101 | |||
65f0dc2e55 | |||
0c4ff01732 | |||
48333a2bcc | |||
3e5d64f086 | |||
63354f2d8d | |||
bf5a4ef4f5 | |||
ea04380bd5 | |||
0c7fa3e5bb | |||
57fa166da3 | |||
87a1e4744c | |||
308e2407c3 | |||
74afdeaf49 | |||
84e863f664 | |||
8475ec7f03 | |||
fdcf2de3ee | |||
a648b683d9 |
2
.github/workflows/ubuntu.yml
vendored
@ -47,7 +47,7 @@ jobs:
|
|||||||
version: 1.10.2
|
version: 1.10.2
|
||||||
|
|
||||||
- name: ubuntu install GL library
|
- name: ubuntu install GL library
|
||||||
run: sudo apt-get install -y libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
run: sudo apt-get install -y libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
||||||
|
|
||||||
- name: build ubuntu
|
- name: build ubuntu
|
||||||
run: |
|
run: |
|
||||||
|
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "framelesshelper"]
|
||||||
|
path = framelesshelper
|
||||||
|
url = https://github.com/zhuzichu520/framelesshelper.git
|
@ -4,3 +4,4 @@ project(FluentUI VERSION 0.1 LANGUAGES CXX)
|
|||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
|
add_subdirectory(framelesshelper)
|
||||||
|
154
README.md
@ -1,99 +1,119 @@
|
|||||||
# FluentUI
|
<div align=center>
|
||||||
|
<img width=64 src="doc/preview/fluent_design.svg">
|
||||||
|
</div>
|
||||||
|
|
||||||
## 简介
|
<h1 align="center">
|
||||||
|
QML FluentUI
|
||||||
|
</h1>
|
||||||
|
<p align="center">
|
||||||
|
A fluent design component library for Qt QML
|
||||||
|
</p>
|
||||||
|
|
||||||
这是一个漂亮的Fluent组件库,使用QML插件开发的。main分支是Qt6.4.3,<a href="https://github.com/zhuzichu520/FluentUI/wiki/%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8" target="_blank">如何使用?</a>。如果需要qt5的请切换至qt5分支,<a href="https://github.com/zhuzichu520/FluentUI/wiki/%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8%EF%BC%881.2.7%E4%BB%A5%E5%8F%8A%E4%B9%8B%E5%89%8D%E7%89%88%E6%9C%AC%EF%BC%89" target="_blank">如何使用?</a>
|
![win-badge] ![ubuntu-badge] ![macos-badge] ![release-badge] ![download-badge] ![download-latest]
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
English | <a href="README_zh_CN.md">简体中文</a>
|
||||||
|
</p>
|
||||||
|
<div align=center>
|
||||||
|
<img src="doc/preview/demo_large.png">
|
||||||
|
</div>
|
||||||
|
|
||||||
## 编译状态
|
|
||||||
| [Windows][win-link]| [Ubuntu][ubuntu-link]|[MacOS][macos-link]|
|
|
||||||
|---------------|---------------|-----------------|
|
|
||||||
| ![win-badge] | ![ubuntu-badge] | ![macos-badge] |
|
|
||||||
|
|
||||||
[win-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AWindows "WindowsAction"
|
[win-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AWindows "WindowsAction"
|
||||||
[win-badge]: https://github.com/zhuzichu520/FluentUI/workflows/Windows/badge.svg "Windows"
|
[win-badge]: https://github.com/zhuzichu520/FluentUI/workflows/Windows/badge.svg "Windows"
|
||||||
|
|
||||||
[ubuntu-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AUbuntu "UbuntuAction"
|
[ubuntu-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AUbuntu "UbuntuAction"
|
||||||
[ubuntu-badge]: https://github.com/zhuzichu520/FluentUI/workflows/Ubuntu/badge.svg "Ubuntu"
|
[ubuntu-badge]: https://github.com/zhuzichu520/FluentUI/workflows/Ubuntu/badge.svg "Ubuntu"
|
||||||
|
|
||||||
[macos-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AMacOS "MacOSAction"
|
[macos-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AMacOS "MacOSAction"
|
||||||
[macos-badge]: https://github.com/zhuzichu520/FluentUI/workflows/MacOS/badge.svg "MacOS"
|
[macos-badge]: https://github.com/zhuzichu520/FluentUI/workflows/MacOS/badge.svg "MacOS"
|
||||||
|
|
||||||
## 发布
|
|
||||||
|
|
||||||
|[已发布][release-link]|[下载][download-link]|下载次数|
|
|
||||||
|:--:|:--:|:--:|
|
|
||||||
|![release-badge] |![download-badge]|![download-latest]|
|
|
||||||
|
|
||||||
[release-link]: https://github.com/zhuzichu520/FluentUI/releases "Release status"
|
[release-link]: https://github.com/zhuzichu520/FluentUI/releases "Release status"
|
||||||
[release-badge]: https://img.shields.io/github/release/zhuzichu520/FluentUI.svg?style=flat-square "Release status"
|
[release-badge]: https://img.shields.io/github/release/zhuzichu520/FluentUI.svg?style=flat-square "Release status"
|
||||||
[download-link]: https://github.com/zhuzichu520/FluentUI/releases/latest "Download status"
|
[download-link]: https://github.com/zhuzichu520/FluentUI/releases/latest "Download status"
|
||||||
[download-badge]: https://img.shields.io/github/downloads/zhuzichu520/FluentUI/total.svg "Download status"
|
[download-badge]: https://img.shields.io/github/downloads/zhuzichu520/FluentUI/total.svg "Download status"
|
||||||
[download-latest]: https://img.shields.io/github/downloads/zhuzichu520/FluentUI/latest/total.svg "latest status"
|
[download-latest]: https://img.shields.io/github/downloads/zhuzichu520/FluentUI/latest/total.svg "latest status"
|
||||||
|
|
||||||
## 支持的组件
|
|
||||||
|
|
||||||
|目录|说明|备注|
|
<p align=center>
|
||||||
|----|----|----|
|
This is a beautiful FluentUI component library based on Qt QML. Currently the main branch supports Qt 6. If you want to use it in Qt 5, checkout the Qt 5 branch.
|
||||||
|FluApp|初始化入口|支持路由跳转|
|
</p>
|
||||||
|FluWindow|无边框窗口|解决windows拖动闪烁问题|
|
|
||||||
|FluAppBar|窗口顶部标题栏|支持拖动窗口,最小化、最大化、关闭窗口|
|
|
||||||
|FluText|Text文本||
|
|
||||||
|FluButton|按钮||
|
|
||||||
|FluFilledButton|实心按钮||
|
|
||||||
|FluIconButton|图标按钮||
|
|
||||||
|FluTextButton|文本按钮||
|
|
||||||
|FluIcon|图标||
|
|
||||||
|FluRadioButton|单选按钮||
|
|
||||||
|FluTextBox|单行输入框||
|
|
||||||
|FluMultiLineTextBox|多行输入框||
|
|
||||||
|FluToggleSwitch|开关按钮||
|
|
||||||
|FluSlider|拖动条||
|
|
||||||
|FluInfoBar|提示Toast||
|
|
||||||
|FluContentDialog|对话框||
|
|
||||||
|FluProgressBar|条形进度条||
|
|
||||||
|FluProgressRing|圆形进度条||
|
|
||||||
|FluRectangle|矩形|支持部分圆角、clip|
|
|
||||||
|FluMenu|菜单框||
|
|
||||||
|FluTooltip|tooltip提示框||
|
|
||||||
|FluTreeView|树控件||
|
|
||||||
|FluTheme|主题设置|支持主题颜色切换,夜间模式|
|
|
||||||
|FluCarousel|轮播图组件|支持无限轮播|
|
|
||||||
|FluTimePicker|时间选择器||
|
|
||||||
|FluDatePicker|日期选择器||
|
|
||||||
|FluMenu|菜单Popup||
|
|
||||||
|FluNavigationView|响应式导航布局||
|
|
||||||
|FluScrollbar|滚动条||
|
|
||||||
|FluToggleButton|开关按钮||
|
|
||||||
|FluPagination|分页组件||
|
|
||||||
|FluTableView|表格组件||
|
|
||||||
|FluMediaPlayer|播放器||
|
|
||||||
|FluFlipView|FlipView||
|
|
||||||
|
|
||||||
# 部分效果预览
|
## Requirements
|
||||||
|
|
||||||
## 首页
|
+ Qt Core, Qt Quick, Qt QML, Qt ShaderTool, Qt 5 Compatibility Module. (**Essential**)
|
||||||
|
+ Qt LinguistTool (optional,for translations)
|
||||||
|
+ Qt Svg (optional, however essential for Qt 5)
|
||||||
|
|
||||||

|
Use [Qt Online Installers](https://download.qt.io/archive/online_installers/) to aquire the moudules (**Recommanded**) or compile them first before using the library.
|
||||||
|
|
||||||
## 各种Button按钮
|
## ⚽ Get started
|
||||||
|
|
||||||

|
+ Download the [pre-built release](https://github.com/zhuzichu520/FluentUI/releases). (Please pecify your platform and compilers.)
|
||||||
|
|
||||||
## 主题颜色切换、夜间模式
|
+ run `example` program.
|
||||||
|
|
||||||

|
or
|
||||||
|
|
||||||
## TableView表格组件
|
+ Clone the repository.
|
||||||
|
|
||||||

|
```SHELL
|
||||||
|
git clone --recursive https://github.com/zhuzichu520/FluentUI.git
|
||||||
|
```
|
||||||
|
|
||||||
## FluTreeView树组件
|
+ Build
|
||||||
|
|
||||||

|
```
|
||||||
|
git clone --recursive https://github.com/zhuzichu520/FluentUI.git
|
||||||
|
cd FluentUI
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_PREFIX_PATH=<YOUR_QT_SDK_DIR_PATH> -DCMAKE_BUILD_TYPE=Release -GNinja <PATH_TO_THE_REPOSITORY>
|
||||||
|
cmake --build . --config Release --target all --parallel
|
||||||
|
```
|
||||||
|
|
||||||
## 轮播图组件
|
+ Use your IDE (`Qt Creator` or `CLion`) to open the project. (only **CMake** supported).
|
||||||
|
|
||||||

|
<div align=center>
|
||||||
|
<img src="doc/preview/qt_creator_project.png">
|
||||||
|
</div>
|
||||||
|
|
||||||
### ⚡ Visitor count
|
+ Compile the project. Then try to execute the `example` demo program.
|
||||||
|
|
||||||
|
+ Great! Now you are ready to write your first QML FluentUI program! Check the documentations for more details.
|
||||||
|
|
||||||
|
|
||||||
|
## 📑 Documentations
|
||||||
|
|
||||||
|
(Work in progress...🚀)
|
||||||
|
|
||||||
|
## Supported components
|
||||||
|
|
||||||
|
|Catalog|Detail|Notes / Demos|
|
||||||
|
|:----:|:----:|:----:|
|
||||||
|
|FluApp|The initial entry of the program|Router supported(SPA)|
|
||||||
|
|FluWindow|Frameless Window|*This only works on windows|
|
||||||
|
|FluAppBar|Title bar on top of the window|Drag, minimize, maximize and close are supported.|
|
||||||
|
|FluText|Common text||
|
||||||
|
|FluButton|Common button| |
|
||||||
|
|FluFilledButton|Filled button||
|
||||||
|
|FluTextButton|Text button||
|
||||||
|
|FluToggleButton|Toggle buttons||
|
||||||
|
|FluIcon|Common icon||
|
||||||
|
|FluRadioButton|radio button||
|
||||||
|
|FluTextBox|Single-line input box||
|
||||||
|
|FluMultiLineTextBox|Multi-lines input area||
|
||||||
|
|FluToggleSwitch|toggle switch||
|
||||||
|
|
||||||
|
|
||||||
|
View more [`here`](doc/md/all_components.md)!
|
||||||
|
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
+ [**Windows design**: Design guidelines and toolkits of Microsoft.](https://learn.microsoft.com/en-us/windows/apps/design/)
|
||||||
|
+ [**Microsoft/WinUI-Gallery**: Microsoft's demo](https://github.com/microsoft/WinUI-Gallery)
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This FluentUI library currently licensed under [MIT License](./License)
|
||||||
|
|
||||||
|
## ⚡ Visitor count
|
||||||

|

|
||||||
|
99
README_zh_CN.md
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
# FluentUI
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
这是一个漂亮的Fluent组件库,使用QML插件开发的。main分支是Qt6.4.3,<a href="https://github.com/zhuzichu520/FluentUI/wiki/%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8" target="_blank">如何使用?</a>。如果需要qt5的请切换至qt5分支,<a href="https://github.com/zhuzichu520/FluentUI/wiki/%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8%EF%BC%881.2.7%E4%BB%A5%E5%8F%8A%E4%B9%8B%E5%89%8D%E7%89%88%E6%9C%AC%EF%BC%89" target="_blank">如何使用?</a>
|
||||||
|
|
||||||
|
## 编译状态
|
||||||
|
| [Windows][win-link]| [Ubuntu][ubuntu-link]|[MacOS][macos-link]|
|
||||||
|
|---------------|---------------|-----------------|
|
||||||
|
| ![win-badge] | ![ubuntu-badge] | ![macos-badge] |
|
||||||
|
|
||||||
|
[win-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AWindows "WindowsAction"
|
||||||
|
[win-badge]: https://github.com/zhuzichu520/FluentUI/workflows/Windows/badge.svg "Windows"
|
||||||
|
|
||||||
|
[ubuntu-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AUbuntu "UbuntuAction"
|
||||||
|
[ubuntu-badge]: https://github.com/zhuzichu520/FluentUI/workflows/Ubuntu/badge.svg "Ubuntu"
|
||||||
|
|
||||||
|
[macos-link]: https://github.com/zhuzichu520/FluentUI/actions?query=workflow%3AMacOS "MacOSAction"
|
||||||
|
[macos-badge]: https://github.com/zhuzichu520/FluentUI/workflows/MacOS/badge.svg "MacOS"
|
||||||
|
|
||||||
|
## 发布
|
||||||
|
|
||||||
|
|[已发布][release-link]|[下载][download-link]|下载次数|
|
||||||
|
|:--:|:--:|:--:|
|
||||||
|
|![release-badge] |![download-badge]|![download-latest]|
|
||||||
|
|
||||||
|
[release-link]: https://github.com/zhuzichu520/FluentUI/releases "Release status"
|
||||||
|
[release-badge]: https://img.shields.io/github/release/zhuzichu520/FluentUI.svg?style=flat-square "Release status"
|
||||||
|
[download-link]: https://github.com/zhuzichu520/FluentUI/releases/latest "Download status"
|
||||||
|
[download-badge]: https://img.shields.io/github/downloads/zhuzichu520/FluentUI/total.svg "Download status"
|
||||||
|
[download-latest]: https://img.shields.io/github/downloads/zhuzichu520/FluentUI/latest/total.svg "latest status"
|
||||||
|
|
||||||
|
## 支持的组件
|
||||||
|
|
||||||
|
|目录|说明|备注|
|
||||||
|
|----|----|----|
|
||||||
|
|FluApp|初始化入口|支持路由跳转|
|
||||||
|
|FluWindow|无边框窗口|解决windows拖动闪烁问题|
|
||||||
|
|FluAppBar|窗口顶部标题栏|支持拖动窗口,最小化、最大化、关闭窗口|
|
||||||
|
|FluText|Text文本||
|
||||||
|
|FluButton|按钮||
|
||||||
|
|FluFilledButton|实心按钮||
|
||||||
|
|FluIconButton|图标按钮||
|
||||||
|
|FluTextButton|文本按钮||
|
||||||
|
|FluIcon|图标||
|
||||||
|
|FluRadioButton|单选按钮||
|
||||||
|
|FluTextBox|单行输入框||
|
||||||
|
|FluMultiLineTextBox|多行输入框||
|
||||||
|
|FluToggleSwitch|开关按钮||
|
||||||
|
|FluSlider|拖动条||
|
||||||
|
|FluInfoBar|提示Toast||
|
||||||
|
|FluContentDialog|对话框||
|
||||||
|
|FluProgressBar|条形进度条||
|
||||||
|
|FluProgressRing|圆形进度条||
|
||||||
|
|FluRectangle|矩形|支持部分圆角、clip|
|
||||||
|
|FluMenu|菜单框||
|
||||||
|
|FluTooltip|tooltip提示框||
|
||||||
|
|FluTreeView|树控件||
|
||||||
|
|FluTheme|主题设置|支持主题颜色切换,夜间模式|
|
||||||
|
|FluCarousel|轮播图组件|支持无限轮播|
|
||||||
|
|FluTimePicker|时间选择器||
|
||||||
|
|FluDatePicker|日期选择器||
|
||||||
|
|FluMenu|菜单Popup||
|
||||||
|
|FluNavigationView|响应式导航布局||
|
||||||
|
|FluScrollbar|滚动条||
|
||||||
|
|FluToggleButton|开关按钮||
|
||||||
|
|FluPagination|分页组件||
|
||||||
|
|FluTableView|表格组件||
|
||||||
|
|FluMediaPlayer|播放器||
|
||||||
|
|FluFlipView|FlipView||
|
||||||
|
|
||||||
|
# 部分效果预览
|
||||||
|
|
||||||
|
## 首页
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 各种Button按钮
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 主题颜色切换、夜间模式
|
||||||
|
|
||||||
|

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

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

|
||||||
|
|
||||||
|
## 轮播图组件
|
||||||
|
|
||||||
|

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

|
37
doc/md/all_components.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# 支持的组件
|
||||||
|
|
||||||
|
|Catalog|Detail|Notes / Demos|
|
||||||
|
|:----:|:----:|:----:|
|
||||||
|
|FluApp|The initial entry of the program|Router supported(SPA)|
|
||||||
|
|FluWindow|Frameless Window|*This only works on windows|
|
||||||
|
|FluAppBar|Title bar on top of the window|Drag, minimize, maximize and close are supported.|
|
||||||
|
|FluText|Common text||
|
||||||
|
|FluButton|Common button| |
|
||||||
|
|FluFilledButton|Filled button||
|
||||||
|
|FluTextButton|Text button||
|
||||||
|
|FluToggleButton|Toggle buttons||
|
||||||
|
|FluIcon|fluent icons||
|
||||||
|
|FluRadioButton|radio button||
|
||||||
|
|FluTextBox|Single-line input box||
|
||||||
|
|FluMultiLineTextBox|Multi-lines input area||
|
||||||
|
|FluToggleSwitch|toggle switch||
|
||||||
|
|FluSlider|Slider||
|
||||||
|
|FluInfoBar|提示Toast||
|
||||||
|
|FluContentDialog| dialog ||
|
||||||
|
|FluProgressBar| progress bar ||
|
||||||
|
|FluProgressRing|circle progress||
|
||||||
|
|FluRectangle|reactangle| </br>*partially support `round` and `clip` feature|
|
||||||
|
|FluMenu|menu||
|
||||||
|
|FluTooltip|tooltip||
|
||||||
|
|FluTreeView|tree view component||
|
||||||
|
|FluTheme|theme settings|theme color changes, dark mode are supported|
|
||||||
|
|FluCarousel|-||
|
||||||
|
|FluTimePicker| time picker ||
|
||||||
|
|FluDatePicker|date picker||
|
||||||
|
|FluMenu|the menu popup||
|
||||||
|
|FluNavigationView|responsive navigation view||
|
||||||
|
|FluScrollbar|scroll bar||
|
||||||
|
|FluPagination|||
|
||||||
|
|FluTableView|table component||
|
||||||
|
|FluMediaPlayer|multimedia components||
|
||||||
|
|FluFlipView| flip view||
|
BIN
doc/preview/demo_content_dialog.png
Executable file
After Width: | Height: | Size: 12 KiB |
BIN
doc/preview/demo_filledbtn.png
Executable file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/preview/demo_icon.png
Executable file
After Width: | Height: | Size: 3.8 KiB |
BIN
doc/preview/demo_infobar.png
Executable file
After Width: | Height: | Size: 6.2 KiB |
BIN
doc/preview/demo_large.png
Executable file
After Width: | Height: | Size: 192 KiB |
BIN
doc/preview/demo_multiline_textbox.png
Executable file
After Width: | Height: | Size: 4.7 KiB |
BIN
doc/preview/demo_progress_bar_ring.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/preview/demo_radiobtn.png
Executable file
After Width: | Height: | Size: 2.5 KiB |
BIN
doc/preview/demo_rectangle.png
Executable file
After Width: | Height: | Size: 16 KiB |
BIN
doc/preview/demo_slider.png
Executable file
After Width: | Height: | Size: 997 B |
BIN
doc/preview/demo_standardbtn.png
Executable file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/preview/demo_textbox.png
Executable file
After Width: | Height: | Size: 2.9 KiB |
BIN
doc/preview/demo_textbtn.png
Executable file
After Width: | Height: | Size: 1.3 KiB |
BIN
doc/preview/demo_toggle_btn.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
doc/preview/demo_toggle_switch.png
Executable file
After Width: | Height: | Size: 1.1 KiB |
BIN
doc/preview/demo_tooltip.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/preview/demo_tree_view.png
Executable file
After Width: | Height: | Size: 12 KiB |
7
doc/preview/fluent_design.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
|
||||||
|
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
|
||||||
|
<svg width="800px" height="800px" viewBox="0 0 73 73" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" stroke="#000000">
|
||||||
|
|
||||||
|
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
|
||||||
|
|
After Width: | Height: | Size: 1.2 KiB |
BIN
doc/preview/qt_creator_project.png
Executable file
After Width: | Height: | Size: 61 KiB |
@ -1 +1,7 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1678260749060" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11227" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M0 0m170.663111 0l682.652445 0q170.663111 0 170.663111 170.663111l0 682.652445q0 170.663111-170.663111 170.663111l-682.652445 0q-170.663111 0-170.663111-170.663111l0-682.652445q0-170.663111 170.663111-170.663111Z" fill="#EBF2FF" p-id="11228"></path><path d="M512.351993 787.674257c182.822858 0 330.926439 98.568613 331.033103 231.312514 0 1.674632-0.031999 3.338597-0.106664 5.002563H181.43622c-0.074665-1.663965-0.106664-3.327931-0.106664-5.002563 0-132.743901 148.210246-231.312514 331.022437-231.312514z" fill="#7D99C8" p-id="11229"></path><path d="M592.264994 721.158309v79.817004h-0.810649c-5.546551 30.079373-38.847191 53.204225-79.102352 53.204225-40.244495 0-73.545134-23.114185-79.091686-53.193559h-0.81065V721.158309h159.815337z" fill="#FBDBCB" p-id="11230"></path><path d="M508.213412 765.626716c-44.105748-1.226641-85.363555-19.306264-118.568196-56.916147-22.826191-25.866128-35.199267-53.054895-37.097894-81.576968l-21.610217-1.610633a59.988084 59.988084 0 0 1-55.433511-56.585488l-0.319994-5.72788a34.932606 34.932606 0 0 1 43.124435-35.839254l0.949314-9.098477a608.008666 608.008666 0 0 1 40.031166-159.015354l10.389117-25.866127H655.026354l10.389117 25.866127a608.008666 608.008666 0 0 1 40.031166 159.015354l0.95998 9.098477a34.932606 34.932606 0 0 1 43.103102 35.839254l-0.309327 5.72788a59.988084 59.988084 0 0 1-55.433512 56.585488l-21.610217 1.610633c-1.909294 28.522072-14.271703 55.710839-37.097893 81.576968-34.239287 38.793858-77.054395 56.798817-122.717444 56.980146z" fill="#FFE7DB" p-id="11231"></path><path d="M546.911273 182.822858a10.666444 10.666444 0 0 1 1.429303 4.31991c0.533322 5.055895 0.714652 9.226474 0.533322 12.501073l-0.202662 2.346618 3.221266-0.543989c21.876878-3.733256 38.452532-9.877128 49.705631-18.452949l2.197288-1.73863a10.666444 10.666444 0 0 1 16.682319 3.98925c8.767817 20.650236 11.125102 40.681819 7.039853 60.116081l-0.373325 1.578633c4.746568 1.514635 9.589134 3.199933 14.506364 5.066562 27.882086 10.581113 57.769463 26.367451 76.883732 75.65709 20.212912 52.084248 18.826274 116.562905-4.149247 193.425304l-1.855961 6.101206H701.425387c-0.47999-51.732256-8.319827-90.526114-23.540843-116.392242-15.221016-25.866128-29.716714-46.185704-43.487094-60.969396-41.513802 10.399783-79.85967 15.914335-115.037603 16.564988l-6.997188 0.063998v0.191996c-37.065894 0-77.737047-5.546551-122.024124-16.628986-13.77038 10.954438-28.266078 31.220683-43.487094 60.7774-15.221016 29.556718-23.060853 68.414575-23.540843 116.584238h-11.114435c-24.746151-79.571676-26.740776-146.076957-6.005209-199.52651 8.746484-22.548864 19.732922-38.079207 31.764672-49.321639 18.079623-20.660903 40.180496-36.009916 66.302619-46.068374a424.716485 424.716485 0 0 1 32.319326-11.029103c25.25814-9.034478 44.991063-16.767651 59.209433-23.210183a366.221704 366.221704 0 0 0 29.151393-14.869024l7.359847-4.266578a10.666444 10.666444 0 0 1 14.623695 3.733256z" fill="#7D99C8" p-id="11232"></path></svg>
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
|
||||||
|
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
|
||||||
|
<svg width="800px" height="800px" viewBox="0 0 73 73" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" stroke="#000000">
|
||||||
|
|
||||||
|
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
|
||||||
|
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -20,7 +20,7 @@ endif()
|
|||||||
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||||
|
|
||||||
#设置版本号
|
#设置版本号
|
||||||
add_definitions(-DVERSION=1,3,0,0)
|
add_definitions(-DVERSION=1,3,1,0)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
||||||
|
|
||||||
@ -94,6 +94,8 @@ set_target_properties(example PROPERTIES
|
|||||||
target_link_libraries(example PRIVATE
|
target_link_libraries(example PRIVATE
|
||||||
Qt6::Quick
|
Qt6::Quick
|
||||||
fluentuiplugin
|
fluentuiplugin
|
||||||
|
FramelessHelper::Core
|
||||||
|
FramelessHelper::Quick
|
||||||
)
|
)
|
||||||
|
|
||||||
#安装
|
#安装
|
||||||
|
@ -1,14 +1,69 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Qt.labs.platform
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "qrc:///example/qml/global/"
|
||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
width: 400
|
title: "FluentUI"
|
||||||
height: 400
|
width: 1000
|
||||||
|
height: 640
|
||||||
|
closeDestory:false
|
||||||
|
minimumWidth: 520
|
||||||
|
minimumHeight: 460
|
||||||
|
launchMode: FluWindow.SingleTask
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
FluButton{
|
FluNavigationView2{
|
||||||
text:"123"
|
id:nav_view
|
||||||
|
anchors.fill: parent
|
||||||
|
items: ItemsOriginal
|
||||||
|
footerItems:ItemsFooter
|
||||||
|
z:11
|
||||||
|
displayMode:MainEvent.displayMode
|
||||||
|
logo: "qrc:/example/res/image/favicon.ico"
|
||||||
|
title:"FluentUI"
|
||||||
|
autoSuggestBox:FluAutoSuggestBox{
|
||||||
|
width: 280
|
||||||
|
anchors.centerIn: parent
|
||||||
|
iconSource: FluentIcons.Search
|
||||||
|
items: ItemsOriginal.getSearchData()
|
||||||
|
placeholderText: lang.search
|
||||||
|
onItemClicked:
|
||||||
|
(data)=>{
|
||||||
|
ItemsOriginal.startPageByItem(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
actionItem:Item{
|
||||||
|
height: 40
|
||||||
|
width: 148
|
||||||
|
RowLayout{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 5
|
||||||
|
FluText{
|
||||||
|
text:lang.dark_mode
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
selected: FluTheme.dark
|
||||||
|
clickFunc:function(){
|
||||||
|
if(FluTheme.dark){
|
||||||
|
FluTheme.darkMode = FluDarkMode.Light
|
||||||
|
}else{
|
||||||
|
FluTheme.darkMode = FluDarkMode.Dark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
ItemsOriginal.navigationView = nav_view
|
||||||
|
ItemsFooter.navigationView = nav_view
|
||||||
|
// nav_view.setCurrentIndex(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
64
example/qml/component/CustomWindow.qml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
import org.wangwenx190.FramelessHelper
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
id:window
|
||||||
|
|
||||||
|
property bool fixSize
|
||||||
|
property alias titleVisible: title_bar.titleVisible
|
||||||
|
property bool appBarVisible: true
|
||||||
|
default property alias content: container.data
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
console.debug(FramelessUtils.frameBorderVisible)
|
||||||
|
}
|
||||||
|
|
||||||
|
FluAppBar {
|
||||||
|
id: title_bar
|
||||||
|
title: window.title
|
||||||
|
visible: window.appBarVisible
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
darkText: lang.dark_mode
|
||||||
|
}
|
||||||
|
|
||||||
|
Item{
|
||||||
|
id:container
|
||||||
|
anchors{
|
||||||
|
top: title_bar.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
}
|
||||||
|
|
||||||
|
FramelessHelper{
|
||||||
|
id:framless_helper
|
||||||
|
onReady: {
|
||||||
|
setTitleBarItem(title_bar)
|
||||||
|
framless_helper.moveWindowToDesktopCenter()
|
||||||
|
setHitTestVisible(title_bar.minimizeButton())
|
||||||
|
setHitTestVisible(title_bar.maximizeButton())
|
||||||
|
setHitTestVisible(title_bar.closeButton())
|
||||||
|
framless_helper.setWindowFixedSize(fixSize)
|
||||||
|
title_bar.maximizeButton.visible = !fixSize
|
||||||
|
window.visible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setHitTestVisible(com){
|
||||||
|
framless_helper.setHitTestVisible(com)
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTitleBarItem(com){
|
||||||
|
framless_helper.setTitleBarItem(com)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -12,48 +12,52 @@ FluScrollablePage{
|
|||||||
FluArea{
|
FluArea{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 1439/5+20
|
height: 1200/5+20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
width: 1080/5
|
width: 1920/5
|
||||||
height: 1439/5
|
height: 1200/5
|
||||||
radius:[25,25,25,25]
|
radius:[15,15,15,15]
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: 20
|
|
||||||
Image {
|
Image {
|
||||||
|
id:image
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
source: "qrc:/example/res/image/image_huoyin.webp"
|
source: "qrc:/example/res/image/banner_3.jpg"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceSize: Qt.size(width,height)
|
sourceSize: Qt.size(2*width,2*height)
|
||||||
FluAcrylic {
|
}
|
||||||
|
FluAcrylic {
|
||||||
|
sourceItem:image
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
width: 100
|
||||||
|
height: 100
|
||||||
|
FluText {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 100
|
text: "Acrylic"
|
||||||
height: 100
|
color: "#FFFFFF"
|
||||||
FluText {
|
font.bold: true
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "Acrylic"
|
|
||||||
color: "#FFFFFF"
|
|
||||||
font.bold: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: -1
|
Layout.topMargin: -1
|
||||||
code:'Image{
|
code:'Image{
|
||||||
|
id:image
|
||||||
width: 800
|
width: 800
|
||||||
height: 600
|
height: 600
|
||||||
source: "qrc:/example/res/image/image_huoyin.webp"
|
source: "qrc:/example/res/image/image_huoyin.webp"
|
||||||
radius: 8
|
radius: 8
|
||||||
|
}
|
||||||
FluAcrylic{
|
FluAcrylic{
|
||||||
|
sourceItem:image
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
|
||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ FluScrollablePage{
|
|||||||
disabled:filled_button_switch.selected
|
disabled:filled_button_switch.selected
|
||||||
text:"Filled Button"
|
text:"Filled Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showWarning("点击FilledButton")
|
showWarning("点击FilledButton"+height)
|
||||||
}
|
}
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
|
@ -22,6 +22,7 @@ FluScrollablePage{
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 320
|
height: 320
|
||||||
Image {
|
Image {
|
||||||
|
id: bg
|
||||||
fillMode:Image.PreserveAspectCrop
|
fillMode:Image.PreserveAspectCrop
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
verticalAlignment: Qt.AlignTop
|
verticalAlignment: Qt.AlignTop
|
||||||
@ -46,6 +47,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
|
id: list
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
@ -61,6 +63,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
clip: false
|
clip: false
|
||||||
delegate:Item{
|
delegate:Item{
|
||||||
|
id: control
|
||||||
width: 220
|
width: 220
|
||||||
height: 240
|
height: 240
|
||||||
FluArea{
|
FluArea{
|
||||||
@ -68,6 +71,15 @@ FluScrollablePage{
|
|||||||
width: 200
|
width: 200
|
||||||
height: 220
|
height: 220
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
color: 'transparent'
|
||||||
|
FluAcrylic {
|
||||||
|
sourceItem:bg
|
||||||
|
anchors.fill: parent
|
||||||
|
color: FluTheme.dark ? 'black' : 'white'
|
||||||
|
rectX: list.x-list.contentX+10+(control.width)*index
|
||||||
|
rectY: list.y+10
|
||||||
|
acrylicOpacity:0.5
|
||||||
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: 8
|
radius: 8
|
||||||
|
@ -114,18 +114,17 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
width: 1080/5
|
width: 1920/5
|
||||||
height: 1439/5
|
height: 1200/5
|
||||||
radius:[25,25,25,25]
|
radius:[15,15,15,15]
|
||||||
Image {
|
Image {
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
source: "qrc:/example/res/image/image_huoyin.webp"
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceSize: Qt.size(width,height)
|
sourceSize: Qt.size(2*width,2*height)
|
||||||
}
|
}
|
||||||
Layout.topMargin: 10
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
|
@ -34,7 +34,7 @@ FluScrollablePage{
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width:100
|
width:120
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
table_view.columns = columns
|
table_view.columns = columns
|
||||||
@ -62,20 +62,14 @@ FluScrollablePage{
|
|||||||
spacing: 10
|
spacing: 10
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
text:"编辑"
|
text:"编辑"
|
||||||
topPadding:3
|
horizontalPadding: 6
|
||||||
bottomPadding:3
|
|
||||||
leftPadding:6
|
|
||||||
rightPadding:6
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
showSuccess(JSON.stringify(dataObject))
|
showSuccess(JSON.stringify(dataObject))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
text:"删除"
|
text:"删除"
|
||||||
topPadding:3
|
horizontalPadding: 6
|
||||||
bottomPadding:3
|
|
||||||
leftPadding:6
|
|
||||||
rightPadding:6
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
showError(JSON.stringify(dataObject))
|
showError(JSON.stringify(dataObject))
|
||||||
}
|
}
|
||||||
@ -84,20 +78,6 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadData(page,count){
|
|
||||||
const dataSource = []
|
|
||||||
for(var i=0;i<count;i++){
|
|
||||||
dataSource.push({
|
|
||||||
name: "孙悟空%1".arg(((page-1)*count+i)),
|
|
||||||
age: 500,
|
|
||||||
address: "钟灵毓秀的花果山,如神仙仙境的水帘洞",
|
|
||||||
nickname: "齐天大圣",
|
|
||||||
action:com_action
|
|
||||||
})
|
|
||||||
}
|
|
||||||
table_view.dataSource = dataSource
|
|
||||||
}
|
|
||||||
|
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 10
|
Layout.topMargin: 10
|
||||||
@ -149,6 +129,17 @@ FluScrollablePage{
|
|||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadData(page,count){
|
||||||
|
const dataSource = []
|
||||||
|
for(var i=0;i<count;i++){
|
||||||
|
dataSource.push({
|
||||||
|
name: "孙悟空%1".arg(((page-1)*count+i)),
|
||||||
|
age: 500,
|
||||||
|
address: "钟灵毓秀的花果山,如神仙仙境的水帘洞",
|
||||||
|
nickname: "齐天大圣",
|
||||||
|
action:com_action
|
||||||
|
})
|
||||||
|
}
|
||||||
|
table_view.dataSource = dataSource
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ FluContentPage {
|
|||||||
property real textScale: 1
|
property real textScale: 1
|
||||||
|
|
||||||
title: "Typography"
|
title: "Typography"
|
||||||
|
rightPadding: 10
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
slider.seek(0)
|
slider.seek(0)
|
||||||
|
@ -2,17 +2,15 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"关于"
|
title:"关于"
|
||||||
width: 600
|
width: 600
|
||||||
height: 600
|
height: 600
|
||||||
minimumWidth: 600
|
fixSize: true
|
||||||
minimumHeight: 600
|
|
||||||
maximumWidth: 600
|
|
||||||
maximumHeight: 600
|
|
||||||
launchMode: FluWindow.SingleTask
|
launchMode: FluWindow.SingleTask
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
|
@ -2,17 +2,15 @@
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"登录"
|
title:"登录"
|
||||||
width: 400
|
width: 400
|
||||||
height: 400
|
height: 400
|
||||||
minimumWidth: 400
|
fixSize: true
|
||||||
minimumHeight: 400
|
|
||||||
maximumWidth: 400
|
|
||||||
maximumHeight: 400
|
|
||||||
|
|
||||||
onInitArgument:
|
onInitArgument:
|
||||||
(argument)=>{
|
(argument)=>{
|
||||||
|
@ -4,9 +4,10 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Qt.labs.platform
|
import Qt.labs.platform
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
import "qrc:///example/qml/global/"
|
import "qrc:///example/qml/global/"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title: "FluentUI"
|
title: "FluentUI"
|
||||||
@ -15,6 +16,7 @@ FluWindow {
|
|||||||
closeDestory:false
|
closeDestory:false
|
||||||
minimumWidth: 520
|
minimumWidth: 520
|
||||||
minimumHeight: 460
|
minimumHeight: 460
|
||||||
|
appBarVisible: false
|
||||||
launchMode: FluWindow.SingleTask
|
launchMode: FluWindow.SingleTask
|
||||||
|
|
||||||
closeFunc:function(event){
|
closeFunc:function(event){
|
||||||
@ -71,15 +73,32 @@ FluWindow {
|
|||||||
window.deleteWindow()
|
window.deleteWindow()
|
||||||
FluApp.closeApp()
|
FluApp.closeApp()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluAppBar {
|
||||||
|
id: title_bar
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
darkText: lang.dark_mode
|
||||||
|
showDark: true
|
||||||
|
z:7
|
||||||
}
|
}
|
||||||
|
|
||||||
FluNavigationView{
|
FluNavigationView{
|
||||||
id:nav_view
|
id:nav_view
|
||||||
anchors.fill: parent
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
z:999
|
||||||
items: ItemsOriginal
|
items: ItemsOriginal
|
||||||
footerItems:ItemsFooter
|
footerItems:ItemsFooter
|
||||||
z:11
|
topPadding:FluTools.isMacos() ? 20 : 5
|
||||||
displayMode:MainEvent.displayMode
|
displayMode:MainEvent.displayMode
|
||||||
logo: "qrc:/example/res/image/favicon.ico"
|
logo: "qrc:/example/res/image/favicon.ico"
|
||||||
title:"FluentUI"
|
title:"FluentUI"
|
||||||
@ -94,32 +113,10 @@ FluWindow {
|
|||||||
ItemsOriginal.startPageByItem(data)
|
ItemsOriginal.startPageByItem(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actionItem:Item{
|
|
||||||
height: 40
|
|
||||||
width: 148
|
|
||||||
RowLayout{
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: 5
|
|
||||||
FluText{
|
|
||||||
text:lang.dark_mode
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
selected: FluTheme.dark
|
|
||||||
clickFunc:function(){
|
|
||||||
if(FluTheme.dark){
|
|
||||||
FluTheme.darkMode = FluDarkMode.Light
|
|
||||||
}else{
|
|
||||||
FluTheme.darkMode = FluDarkMode.Dark
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
ItemsOriginal.navigationView = nav_view
|
ItemsOriginal.navigationView = nav_view
|
||||||
ItemsFooter.navigationView = nav_view
|
ItemsFooter.navigationView = nav_view
|
||||||
nav_view.setCurrentIndex(0)
|
nav_view.setCurrentIndex(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
title:"视频播放器"
|
title:"视频播放器"
|
||||||
width: 640
|
width: 640
|
||||||
|
@ -2,17 +2,15 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"SingleInstance"
|
title:"SingleInstance"
|
||||||
width: 500
|
width: 500
|
||||||
height: 600
|
height: 600
|
||||||
minimumWidth: 500
|
fixSize: true
|
||||||
minimumHeight: 600
|
|
||||||
maximumWidth: 500
|
|
||||||
maximumHeight: 600
|
|
||||||
launchMode: FluWindow.SingleInstance
|
launchMode: FluWindow.SingleInstance
|
||||||
|
|
||||||
FluTextBox{
|
FluTextBox{
|
||||||
@ -34,5 +32,4 @@ FluWindow {
|
|||||||
}
|
}
|
||||||
text:"我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口"
|
text:"我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,15 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"SingleTask"
|
title:"SingleTask"
|
||||||
width: 500
|
width: 500
|
||||||
height: 600
|
height: 600
|
||||||
minimumWidth: 500
|
fixSize: true
|
||||||
minimumHeight: 600
|
|
||||||
maximumWidth: 500
|
|
||||||
maximumHeight: 600
|
|
||||||
launchMode: FluWindow.SingleTask
|
launchMode: FluWindow.SingleTask
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
|
@ -2,17 +2,15 @@
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluWindow {
|
CustomWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:"Standard"
|
title:"Standard"
|
||||||
width: 500
|
width: 500
|
||||||
height: 600
|
height: 600
|
||||||
minimumWidth: 500
|
fixSize: true
|
||||||
minimumHeight: 600
|
|
||||||
maximumWidth: 500
|
|
||||||
maximumHeight: 600
|
|
||||||
launchMode: FluWindow.Standard
|
launchMode: FluWindow.Standard
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
|
Before Width: | Height: | Size: 59 KiB |
@ -4,23 +4,24 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <FramelessHelper/Quick/framelessquickmodule.h>
|
||||||
|
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
||||||
#include "lang/Lang.h"
|
#include "lang/Lang.h"
|
||||||
#include "AppInfo.h"
|
#include "AppInfo.h"
|
||||||
#include "tool/IPC.h"
|
#include "tool/IPC.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
FRAMELESSHELPER_USE_NAMESPACE
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//将样式设置为Basic,不然会导致组件显示异常
|
//将样式设置为Basic,不然会导致组件显示异常
|
||||||
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
||||||
//6.4及以下监听系统深色模式变化
|
FramelessHelper::Quick::initialize();
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
qputenv("QT_QPA_PLATFORM","windows:darkmode=2");
|
|
||||||
#endif
|
|
||||||
QGuiApplication::setOrganizationName("ZhuZiChu");
|
QGuiApplication::setOrganizationName("ZhuZiChu");
|
||||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||||
QGuiApplication::setApplicationName("FluentUI");
|
QGuiApplication::setApplicationName("FluentUI");
|
||||||
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
|
||||||
AppInfo* appInfo = new AppInfo();
|
AppInfo* appInfo = new AppInfo();
|
||||||
IPC ipc(0);
|
IPC ipc(0);
|
||||||
QString activeWindowEvent = "activeWindow";
|
QString activeWindowEvent = "activeWindow";
|
||||||
@ -37,6 +38,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
app.setQuitOnLastWindowClosed(false);
|
app.setQuitOnLastWindowClosed(false);
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
|
FramelessHelper::Quick::registerTypes(&engine);
|
||||||
QQmlContext * context = engine.rootContext();
|
QQmlContext * context = engine.rootContext();
|
||||||
Lang* lang = appInfo->lang();
|
Lang* lang = appInfo->lang();
|
||||||
context->setContextProperty("lang",lang);
|
context->setContextProperty("lang",lang);
|
||||||
@ -45,7 +47,7 @@ int main(int argc, char *argv[])
|
|||||||
});
|
});
|
||||||
context->setContextProperty("appInfo",appInfo);
|
context->setContextProperty("appInfo",appInfo);
|
||||||
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
|
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
|
||||||
// const QUrl url(QStringLiteral("qrc:/example/qml/TestWindow.qml"));
|
// const QUrl url(QStringLiteral("qrc:/example/qml/TestWindow.qml"));
|
||||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||||
&app, [url](QObject *obj, const QUrl &objUrl) {
|
&app, [url](QObject *obj, const QUrl &objUrl) {
|
||||||
if (!obj && url == objUrl)
|
if (!obj && url == objUrl)
|
||||||
|
1
framelesshelper
Submodule
@ -13,7 +13,7 @@ endif()
|
|||||||
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
|
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
|
||||||
|
|
||||||
#设置版本号
|
#设置版本号
|
||||||
add_definitions(-DVERSION=1,3,0,0)
|
add_definitions(-DVERSION=1,3,1,0)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools)
|
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools)
|
||||||
|
|
||||||
@ -61,9 +61,9 @@ qt_add_qml_module(fluentuiplugin
|
|||||||
|
|
||||||
#链接库
|
#链接库
|
||||||
target_link_libraries(fluentuiplugin PUBLIC
|
target_link_libraries(fluentuiplugin PUBLIC
|
||||||
Qt::Core
|
Qt::CorePrivate
|
||||||
Qt::Quick
|
Qt::QuickPrivate
|
||||||
Qt::Qml
|
Qt::QmlPrivate
|
||||||
)
|
)
|
||||||
|
|
||||||
#链接库 win32库 不然mingw会编译错误
|
#链接库 win32库 不然mingw会编译错误
|
||||||
|
@ -78,7 +78,6 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
|
|||||||
fluRegister->to(view);
|
fluRegister->to(view);
|
||||||
}
|
}
|
||||||
view->setColor(QColor(Qt::transparent));
|
view->setColor(QColor(Qt::transparent));
|
||||||
view->show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray FluApp::awesomelist(const QString& keyword)
|
QJsonArray FluApp::awesomelist(const QString& keyword)
|
||||||
|
@ -8,9 +8,6 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include "FluTheme.h"
|
|
||||||
#include "FluTools.h"
|
|
||||||
#include "FluColors.h"
|
|
||||||
#include "FluRegister.h"
|
#include "FluRegister.h"
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#include "FluTheme.h"
|
#include "FluTheme.h"
|
||||||
|
|
||||||
#include "Def.h"
|
#include "Def.h"
|
||||||
|
#include "FluColors.h"
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#include "FluApp.h"
|
#include <QtGui/qpa/qplatformtheme.h>
|
||||||
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
FluTheme* FluTheme::m_instance = nullptr;
|
FluTheme* FluTheme::m_instance = nullptr;
|
||||||
@ -24,14 +26,16 @@ FluTheme::FluTheme(QObject *parent)
|
|||||||
primaryColor(FluColors::getInstance()->Blue());
|
primaryColor(FluColors::getInstance()->Blue());
|
||||||
nativeText(false);
|
nativeText(false);
|
||||||
darkMode(Fluent_DarkMode::Fluent_DarkModeType::Light);
|
darkMode(Fluent_DarkMode::Fluent_DarkModeType::Light);
|
||||||
|
_systemDark = systemDark();
|
||||||
qApp->installEventFilter(this);
|
qApp->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FluTheme::eventFilter(QObject *obj, QEvent *event)
|
bool FluTheme::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(obj);
|
Q_UNUSED(obj);
|
||||||
if (event->type() == QEvent::ApplicationPaletteChange)
|
if (event->type() == QEvent::ApplicationPaletteChange || event->type() == QEvent::ThemeChange)
|
||||||
{
|
{
|
||||||
|
_systemDark = systemDark();
|
||||||
Q_EMIT darkChanged();
|
Q_EMIT darkChanged();
|
||||||
event->accept();
|
event->accept();
|
||||||
return true;
|
return true;
|
||||||
@ -41,9 +45,10 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
|
|||||||
|
|
||||||
bool FluTheme::systemDark()
|
bool FluTheme::systemDark()
|
||||||
{
|
{
|
||||||
QPalette palette = qApp->palette();
|
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
||||||
QColor color = palette.color(QPalette::Window).rgb();
|
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
||||||
return !(color.red() * 0.2126 + color.green() * 0.7152 + color.blue() * 0.0722 > 255 / 2);
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FluTheme::dark(){
|
bool FluTheme::dark(){
|
||||||
@ -52,7 +57,7 @@ bool FluTheme::dark(){
|
|||||||
}else if(_darkMode == Fluent_DarkMode::Fluent_DarkModeType::Light){
|
}else if(_darkMode == Fluent_DarkMode::Fluent_DarkModeType::Light){
|
||||||
return false;
|
return false;
|
||||||
}else if(_darkMode == Fluent_DarkMode::Fluent_DarkModeType::System){
|
}else if(_darkMode == Fluent_DarkMode::Fluent_DarkModeType::System){
|
||||||
return systemDark();
|
return _systemDark;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
Q_SIGNAL void darkChanged();
|
Q_SIGNAL void darkChanged();
|
||||||
private:
|
private:
|
||||||
bool _dark;
|
bool _dark;
|
||||||
|
bool _systemDark;
|
||||||
bool eventFilter(QObject *obj, QEvent *event);
|
bool eventFilter(QObject *obj, QEvent *event);
|
||||||
bool systemDark();
|
bool systemDark();
|
||||||
};
|
};
|
||||||
|
@ -39,4 +39,28 @@ QString FluTools::readFile(const QString &fileName)
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FluTools::isMacos(){
|
||||||
|
#if defined(Q_OS_MACOS)
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FluTools::isLinux(){
|
||||||
|
#if defined(Q_OS_LINUX)
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FluTools::isWin(){
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,6 +42,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
Q_INVOKABLE QString readFile(const QString &fileName);
|
Q_INVOKABLE QString readFile(const QString &fileName);
|
||||||
|
|
||||||
|
Q_INVOKABLE bool isMacos();
|
||||||
|
|
||||||
|
Q_INVOKABLE bool isLinux();
|
||||||
|
|
||||||
|
Q_INVOKABLE bool isWin();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FLUTOOLS_H
|
#endif // FLUTOOLS_H
|
||||||
|
@ -4,29 +4,34 @@ import FluentUI
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
property alias color: rect.color
|
property alias color: rect.color
|
||||||
property alias acrylicOpacity: rect.opacity
|
property alias acrylicOpacity: rect.opacity
|
||||||
|
property alias radius:bg.radius
|
||||||
Rectangle {
|
property alias blurRadius: blur.radius
|
||||||
id: rect
|
property int rectX: control.x
|
||||||
|
property int rectY: control.y
|
||||||
|
property var sourceItem: control.parent
|
||||||
|
FluRectangle{
|
||||||
|
id:bg
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "white"
|
radius: [8,8,8,8]
|
||||||
opacity: 0.05
|
ShaderEffectSource {
|
||||||
|
id: effect_source
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceItem: control.sourceItem
|
||||||
|
sourceRect: Qt.rect(rectX, rectY, control.width, control.height)
|
||||||
|
Rectangle {
|
||||||
|
id: rect
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "white"
|
||||||
|
opacity: 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FastBlur {
|
||||||
|
id:blur
|
||||||
|
radius: 50
|
||||||
|
anchors.fill: effect_source
|
||||||
|
source: effect_source
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderEffectSource {
|
|
||||||
id: effect_source
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceItem: control.parent
|
|
||||||
sourceRect: Qt.rect(control.x, control.y, control.width, control.height)
|
|
||||||
}
|
|
||||||
|
|
||||||
GaussianBlur {
|
|
||||||
radius: 20
|
|
||||||
anchors.fill: effect_source
|
|
||||||
source: effect_source
|
|
||||||
samples: 1 + radius * 2
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
||||||
property string title: ""
|
property string title: ""
|
||||||
property string darkText : "夜间模式"
|
property string darkText : "夜间模式"
|
||||||
property string minimizeText : "最小化"
|
property string minimizeText : "最小化"
|
||||||
@ -20,48 +19,44 @@ Rectangle{
|
|||||||
property color closeNormalColor: Qt.rgba(0,0,0,0)
|
property color closeNormalColor: Qt.rgba(0,0,0,0)
|
||||||
property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1)
|
property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1)
|
||||||
property bool showDark: false
|
property bool showDark: false
|
||||||
|
property bool titleVisible: true
|
||||||
|
property bool isMac: FluTools.isMacos()
|
||||||
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
|
id:root
|
||||||
|
color: Qt.rgba(0,0,0,0)
|
||||||
|
height: visible ? 30 : 0
|
||||||
|
opacity: visible
|
||||||
|
z: 65535
|
||||||
Item{
|
Item{
|
||||||
id:d
|
id:d
|
||||||
property var win: Window.window
|
property var win: Window.window
|
||||||
property bool isRestore: win && Window.Maximized === win.visibility
|
property bool isRestore: win && Window.Maximized === win.visibility
|
||||||
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
|
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
|
||||||
}
|
}
|
||||||
|
|
||||||
id:root
|
|
||||||
color: Qt.rgba(0,0,0,0)
|
|
||||||
visible: false
|
|
||||||
height: visible ? 30 : 0
|
|
||||||
opacity: visible
|
|
||||||
z: 65535
|
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: if (tapCount === 2) toggleMaximized()
|
onTapped: if (tapCount === 2) btn_maximize.clicked()
|
||||||
gesturePolicy: TapHandler.DragThreshold
|
gesturePolicy: TapHandler.DragThreshold
|
||||||
}
|
}
|
||||||
|
|
||||||
DragHandler {
|
DragHandler {
|
||||||
target: null
|
target: null
|
||||||
grabPermissions: TapHandler.CanTakeOverFromAnything
|
grabPermissions: TapHandler.CanTakeOverFromAnything
|
||||||
onActiveChanged: if (active) { d.win.startSystemMove(); }
|
onActiveChanged: if (active) { d.win.startSystemMove(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText {
|
FluText {
|
||||||
text: title
|
text: title
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: isMac ? undefined : parent.left
|
||||||
leftMargin: 10
|
leftMargin: isMac ? undefined : 10
|
||||||
|
horizontalCenter: isMac ? parent.horizontalCenter : undefined
|
||||||
}
|
}
|
||||||
|
visible: root.titleVisible
|
||||||
color:root.textColor
|
color:root.textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
height: root.height
|
height: root.height
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.rightMargin: 5
|
Layout.rightMargin: 5
|
||||||
@ -82,8 +77,8 @@ Rectangle{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
|
id:btn_minimize
|
||||||
width: 40
|
width: 40
|
||||||
height: 30
|
height: 30
|
||||||
iconSource : FluentIcons.ChromeMinimize
|
iconSource : FluentIcons.ChromeMinimize
|
||||||
@ -91,33 +86,40 @@ Rectangle{
|
|||||||
iconSize: 11
|
iconSize: 11
|
||||||
text:minimizeText
|
text:minimizeText
|
||||||
radius: 0
|
radius: 0
|
||||||
|
visible: !isMac
|
||||||
iconColor: root.textColor
|
iconColor: root.textColor
|
||||||
color: hovered ? minimizeHoverColor : minimizeNormalColor
|
color: hovered ? minimizeHoverColor : minimizeNormalColor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
d.win.showMinimized()
|
d.win.visibility = Window.Minimized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
|
id:btn_maximize
|
||||||
width: 40
|
width: 40
|
||||||
height: 30
|
height: 30
|
||||||
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||||
color: hovered ? maximizeHoverColor : maximizeNormalColor
|
color: hovered ? maximizeHoverColor : maximizeNormalColor
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: d.resizable
|
visible: d.resizable && !isMac
|
||||||
radius: 0
|
radius: 0
|
||||||
iconColor: root.textColor
|
iconColor: root.textColor
|
||||||
text:d.isRestore?restoreText:maximizeText
|
text:d.isRestore?restoreText:maximizeText
|
||||||
iconSize: 11
|
iconSize: 11
|
||||||
onClicked: {
|
onClicked: {
|
||||||
toggleMaximized()
|
if (d.win.visibility === Window.Maximized)
|
||||||
|
d.win.visibility = Window.Windowed
|
||||||
|
else
|
||||||
|
d.win.visibility = Window.Maximized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
|
id:btn_close
|
||||||
iconSource : FluentIcons.ChromeClose
|
iconSource : FluentIcons.ChromeClose
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text:closeText
|
text:closeText
|
||||||
width: 40
|
width: 40
|
||||||
height: 30
|
height: 30
|
||||||
|
visible: !isMac
|
||||||
radius: 0
|
radius: 0
|
||||||
iconSize: 10
|
iconSize: 10
|
||||||
iconColor: hovered ? Qt.rgba(1,1,1,1) : root.textColor
|
iconColor: hovered ? Qt.rgba(1,1,1,1) : root.textColor
|
||||||
@ -128,14 +130,16 @@ Rectangle{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleMaximized() {
|
function minimizeButton(){
|
||||||
if(!d.resizable)
|
return btn_minimize
|
||||||
return
|
}
|
||||||
if (d.win.visibility === Window.Maximized) {
|
|
||||||
d.win.showNormal();
|
function maximizeButton(){
|
||||||
} else {
|
return btn_maximize
|
||||||
d.win.showMaximized();
|
}
|
||||||
}
|
|
||||||
|
function closeButton(){
|
||||||
|
return btn_close
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,33 +4,28 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
property int paddings : 0
|
property int paddings : 0
|
||||||
property int leftPadding : 0
|
property int leftPadding : 0
|
||||||
property int rightPadding : 0
|
property int rightPadding : 0
|
||||||
property int topPadding : 0
|
property int topPadding : 0
|
||||||
property int bottomPadding : 0
|
property int bottomPadding : 0
|
||||||
|
|
||||||
radius: 4
|
radius: 4
|
||||||
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
|
|
||||||
Behavior on color{
|
Behavior on color{
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.color{
|
Behavior on border.color{
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: container
|
id: container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -39,5 +34,4 @@ Rectangle {
|
|||||||
anchors.topMargin: Math.max(paddings,topPadding)
|
anchors.topMargin: Math.max(paddings,topPadding)
|
||||||
anchors.bottomMargin: Math.max(paddings,bottomPadding)
|
anchors.bottomMargin: Math.max(paddings,bottomPadding)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,25 +3,20 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
FluTextBox{
|
FluTextBox{
|
||||||
|
|
||||||
property var items:[]
|
property var items:[]
|
||||||
property string emptyText: "没有找到结果"
|
property string emptyText: "没有找到结果"
|
||||||
property int autoSuggestBoxReplacement: FluentIcons.Search
|
property int autoSuggestBoxReplacement: FluentIcons.Search
|
||||||
signal itemClicked(var data)
|
signal itemClicked(var data)
|
||||||
signal handleClicked
|
signal handleClicked
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 300
|
width: 300
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property bool flagVisible: true
|
property bool flagVisible: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Popup{
|
Popup{
|
||||||
id:control_popup
|
id:control_popup
|
||||||
y:control.height
|
y:control.height
|
||||||
@ -126,19 +121,16 @@ FluTextBox{
|
|||||||
control_popup.visible = true
|
control_popup.visible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClick(modelData){
|
function handleClick(modelData){
|
||||||
control_popup.visible = false
|
control_popup.visible = false
|
||||||
control.itemClicked(modelData)
|
control.itemClicked(modelData)
|
||||||
updateText(modelData.title)
|
updateText(modelData.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateText(text){
|
function updateText(text){
|
||||||
d.flagVisible = false
|
d.flagVisible = false
|
||||||
control.text = text
|
control.text = text
|
||||||
d.flagVisible = true
|
d.flagVisible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadData(){
|
function loadData(){
|
||||||
var result = []
|
var result = []
|
||||||
if(items==null){
|
if(items==null){
|
||||||
@ -152,5 +144,4 @@ FluTextBox{
|
|||||||
})
|
})
|
||||||
list_view.model = result
|
list_view.model = result
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,9 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
||||||
property bool isDot: false
|
property bool isDot: false
|
||||||
property bool showZero: true
|
property bool showZero: true
|
||||||
property int count: 0
|
property int count: 0
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
color:Qt.rgba(255/255,77/255,79/255,1)
|
color:Qt.rgba(255/255,77/255,79/255,1)
|
||||||
width: {
|
width: {
|
||||||
@ -61,7 +59,6 @@ Rectangle{
|
|||||||
return -10
|
return -10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: Qt.rgba(1,1,1,1)
|
color: Qt.rgba(1,1,1,1)
|
||||||
@ -72,7 +69,4 @@ Rectangle{
|
|||||||
return count+"+"
|
return count+"+"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,26 +4,21 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property int textSize: 15
|
property int textSize: 15
|
||||||
property string separator: "/"
|
property string separator: "/"
|
||||||
property var items: []
|
property var items: []
|
||||||
property int spacing: 5
|
property int spacing: 5
|
||||||
signal clickItem(var model)
|
signal clickItem(var model)
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
implicitWidth: 300
|
implicitWidth: 300
|
||||||
height: 30
|
height: 30
|
||||||
|
|
||||||
onItemsChanged: {
|
onItemsChanged: {
|
||||||
list_model.clear()
|
list_model.clear()
|
||||||
list_model.append(items)
|
list_model.append(items)
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id:list_model
|
id:list_model
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id:list_view
|
id:list_view
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -88,13 +83,10 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(index,count){
|
function remove(index,count){
|
||||||
list_model.remove(index,count)
|
list_model.remove(index,count)
|
||||||
}
|
}
|
||||||
|
|
||||||
function count(){
|
function count(){
|
||||||
return list_model.count
|
return list_model.count
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,23 +4,19 @@ import QtQuick.Controls.Basic
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
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 disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
topPadding:5
|
|
||||||
bottomPadding:5
|
|
||||||
leftPadding:15
|
|
||||||
rightPadding:15
|
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
focusPolicy:Qt.TabFocus
|
||||||
|
horizontalPadding:12
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
Keys.onSpacePressed: control.visualFocus&&clicked()
|
||||||
font:FluTextStyle.Body
|
font:FluTextStyle.Body
|
||||||
|
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
implicitWidth: 28
|
||||||
|
implicitHeight: 28
|
||||||
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 4
|
radius: 4
|
||||||
|
@ -5,13 +5,11 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
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 string text: "请选择日期"
|
||||||
property var window : Window.window
|
property var window : Window.window
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(mouse_area.containsMouse){
|
if(mouse_area.containsMouse){
|
||||||
@ -24,7 +22,6 @@ Rectangle {
|
|||||||
radius: 4
|
radius: 4
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: dividerColor
|
border.color: dividerColor
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:mouse_area
|
id:mouse_area
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@ -33,7 +30,6 @@ Rectangle {
|
|||||||
popup.showPopup()
|
popup.showPopup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_date
|
id:text_date
|
||||||
anchors{
|
anchors{
|
||||||
@ -47,7 +43,6 @@ Rectangle {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text:control.text
|
text:control.text
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIcon{
|
FluIcon{
|
||||||
iconSource: FluentIcons.Calendar
|
iconSource: FluentIcons.Calendar
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
@ -58,8 +53,6 @@ Rectangle {
|
|||||||
rightMargin: 12
|
rightMargin: 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Menu{
|
Menu{
|
||||||
id:popup
|
id:popup
|
||||||
height: container.height
|
height: container.height
|
||||||
@ -75,7 +68,6 @@ Rectangle {
|
|||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:Transition {
|
exit:Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
@ -84,7 +76,6 @@ Rectangle {
|
|||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: Item{
|
contentItem: Item{
|
||||||
clip: true
|
clip: true
|
||||||
FluCalendarView{
|
FluCalendarView{
|
||||||
|
@ -3,27 +3,22 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
enum DisplayMode {
|
enum DisplayMode {
|
||||||
Month,
|
Month,
|
||||||
Year,
|
Year,
|
||||||
Decade
|
Decade
|
||||||
}
|
}
|
||||||
|
|
||||||
property int displayMode: FluCalendarView.Month
|
property int displayMode: FluCalendarView.Month
|
||||||
property var date: new Date()
|
property var date: new Date()
|
||||||
property var currentDate : new Date()
|
property var currentDate : new Date()
|
||||||
property var toDay: new Date()
|
property var toDay: new Date()
|
||||||
signal dateClicked(var date)
|
signal dateClicked(var date)
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 280
|
width: 280
|
||||||
height: 325
|
height: 325
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
updateMouth(date)
|
updateMouth(date)
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_week
|
id:com_week
|
||||||
Item{
|
Item{
|
||||||
@ -35,7 +30,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_year
|
id:com_year
|
||||||
Button{
|
Button{
|
||||||
@ -94,7 +88,6 @@ Item {
|
|||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_month
|
id:com_month
|
||||||
Button{
|
Button{
|
||||||
@ -154,8 +147,6 @@ Item {
|
|||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_day
|
id:com_day
|
||||||
Button{
|
Button{
|
||||||
@ -189,7 +180,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:backgound_today
|
id:backgound_today
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@ -201,7 +191,6 @@ Item {
|
|||||||
border.color: FluTheme.primaryColor.dark
|
border.color: FluTheme.primaryColor.dark
|
||||||
border.width: 1
|
border.width: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:backgound_selected
|
id:backgound_selected
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@ -211,7 +200,6 @@ Item {
|
|||||||
visible: isToDay
|
visible: isToDay
|
||||||
color: FluTheme.primaryColor.dark
|
color: FluTheme.primaryColor.dark
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:date.getDate()
|
text:date.getDate()
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@ -229,15 +217,12 @@ Item {
|
|||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: 5
|
radius: 5
|
||||||
|
|
||||||
FluShadow{
|
FluShadow{
|
||||||
radius: 5
|
radius: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_divider
|
id:layout_divider
|
||||||
height: 1
|
height: 1
|
||||||
@ -248,7 +233,6 @@ Item {
|
|||||||
topMargin: 44
|
topMargin: 44
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:layout_top
|
id:layout_top
|
||||||
anchors{
|
anchors{
|
||||||
@ -257,7 +241,6 @@ Item {
|
|||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: layout_divider.top
|
bottom: layout_divider.top
|
||||||
}
|
}
|
||||||
|
|
||||||
FluTextButton{
|
FluTextButton{
|
||||||
id:title
|
id:title
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
@ -278,7 +261,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:icon_up
|
id:icon_up
|
||||||
iconSource: FluentIcons.CaretUpSolid8
|
iconSource: FluentIcons.CaretUpSolid8
|
||||||
@ -309,7 +291,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:icon_down
|
id:icon_down
|
||||||
iconSource: FluentIcons.CaretDownSolid8
|
iconSource: FluentIcons.CaretDownSolid8
|
||||||
@ -341,11 +322,9 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id:list_model
|
id:list_model
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:layout_bottom
|
id:layout_bottom
|
||||||
anchors{
|
anchors{
|
||||||
@ -354,7 +333,6 @@ Item {
|
|||||||
top: layout_divider.bottom
|
top: layout_divider.bottom
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
GridView{
|
GridView{
|
||||||
model: list_model
|
model: list_model
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -388,23 +366,18 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createItemWeek(name){
|
function createItemWeek(name){
|
||||||
return {type:0,date:new Date(),name:name,isDecade:false}
|
return {type:0,date:new Date(),name:name,isDecade:false}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createItemDay(date){
|
function createItemDay(date){
|
||||||
return {type:1,date:date,name:"",isDecade:false}
|
return {type:1,date:date,name:"",isDecade:false}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createItemMonth(date){
|
function createItemMonth(date){
|
||||||
return {type:2,date:date,name:"",isDecade:false}
|
return {type:2,date:date,name:"",isDecade:false}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createItemYear(date,isDecade){
|
function createItemYear(date,isDecade){
|
||||||
return {type:3,date:date,name:"",isDecade:isDecade}
|
return {type:3,date:date,name:"",isDecade:isDecade}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDecade(date){
|
function updateDecade(date){
|
||||||
list_model.clear()
|
list_model.clear()
|
||||||
var year = date.getFullYear()
|
var year = date.getFullYear()
|
||||||
@ -417,7 +390,6 @@ Item {
|
|||||||
}
|
}
|
||||||
title.text = decadeStart+"-"+(decadeStart+10)
|
title.text = decadeStart+"-"+(decadeStart+10)
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateYear(date){
|
function updateYear(date){
|
||||||
list_model.clear()
|
list_model.clear()
|
||||||
var year = date.getFullYear()
|
var year = date.getFullYear()
|
||||||
@ -429,7 +401,6 @@ Item {
|
|||||||
}
|
}
|
||||||
title.text = year+"年"
|
title.text = year+"年"
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateMouth(date){
|
function updateMouth(date){
|
||||||
list_model.clear()
|
list_model.clear()
|
||||||
list_model.append([createItemWeek("一"),createItemWeek("二"),createItemWeek("三"),createItemWeek("四"),createItemWeek("五"),createItemWeek("六"),createItemWeek("日")])
|
list_model.append([createItemWeek("一"),createItemWeek("二"),createItemWeek("三"),createItemWeek("四"),createItemWeek("五"),createItemWeek("六"),createItemWeek("日")])
|
||||||
@ -468,6 +439,4 @@ Item {
|
|||||||
}
|
}
|
||||||
title.text = year+"年"+(month+1)+"月"
|
title.text = year+"年"+(month+1)+"月"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,20 +3,16 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property bool flagXChanged: true
|
property bool flagXChanged: true
|
||||||
property int radius : 5
|
property int radius : 5
|
||||||
property int loopTime: 2000
|
property int loopTime: 2000
|
||||||
property bool showIndicator: true
|
property bool showIndicator: true
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 400
|
width: 400
|
||||||
height: 300
|
height: 300
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id:content_model
|
id:content_model
|
||||||
}
|
}
|
||||||
|
|
||||||
FluRectangle{
|
FluRectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: [control.radius,control.radius,control.radius,control.radius]
|
radius: [control.radius,control.radius,control.radius,control.radius]
|
||||||
@ -80,14 +76,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function setData(data){
|
|
||||||
content_model.clear()
|
|
||||||
content_model.append(data[data.length-1])
|
|
||||||
content_model.append(data)
|
|
||||||
content_model.append(data[0])
|
|
||||||
list_view.currentIndex = 1
|
|
||||||
timer_run.restart()
|
|
||||||
}
|
|
||||||
Row{
|
Row{
|
||||||
spacing: 10
|
spacing: 10
|
||||||
anchors{
|
anchors{
|
||||||
@ -133,4 +121,12 @@ Item {
|
|||||||
timer_anim.start()
|
timer_anim.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function setData(data){
|
||||||
|
content_model.clear()
|
||||||
|
content_model.append(data[data.length-1])
|
||||||
|
content_model.append(data)
|
||||||
|
content_model.append(data[0])
|
||||||
|
list_view.currentIndex = 1
|
||||||
|
timer_run.restart()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property var clickFunc
|
property var clickFunc
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
@ -14,7 +13,6 @@ Button {
|
|||||||
property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
|
property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
|
||||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
property color borderPressedColor: FluTheme.dark ? Qt.rgba(90/255,90/255,90/255,1) : Qt.rgba(191/255,191/255,191/255,1)
|
property color borderPressedColor: FluTheme.dark ? Qt.rgba(90/255,90/255,90/255,1) : Qt.rgba(191/255,191/255,191/255,1)
|
||||||
|
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
property color selectedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color selectedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(72/255,72/255,72/255,1) : Qt.rgba(236/255,236/255,236/255,1)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(72/255,72/255,72/255,1) : Qt.rgba(236/255,236/255,236/255,1)
|
||||||
@ -22,7 +20,6 @@ Button {
|
|||||||
property color selectedPreesedColor: FluTheme.dark ? Qt.darker(selectedColor,1.3) : Qt.lighter(selectedColor,1.3)
|
property color selectedPreesedColor: FluTheme.dark ? Qt.darker(selectedColor,1.3) : Qt.lighter(selectedColor,1.3)
|
||||||
property color selectedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
property color selectedDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
focusPolicy:Qt.TabFocus
|
||||||
|
@ -75,5 +75,4 @@ Button{
|
|||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,28 +4,21 @@ import FluentUI
|
|||||||
import "ColorPicker"
|
import "ColorPicker"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property alias colorValue: color_picker.colorValue
|
property alias colorValue: color_picker.colorValue
|
||||||
|
|
||||||
width: color_picker.width+10
|
width: color_picker.width+10
|
||||||
height: color_picker.height
|
height: color_picker.height
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: 5
|
radius: 5
|
||||||
|
|
||||||
FluShadow{
|
FluShadow{
|
||||||
radius: 5
|
radius: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorPicker{
|
ColorPicker{
|
||||||
id:color_picker
|
id:color_picker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setColor(color) {
|
function setColor(color) {
|
||||||
color_picker.setColor(color)
|
color_picker.setColor(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import FluentUI
|
|||||||
|
|
||||||
Popup {
|
Popup {
|
||||||
id: popup
|
id: popup
|
||||||
|
|
||||||
property string title: "Title"
|
property string title: "Title"
|
||||||
property string message: "Message"
|
property string message: "Message"
|
||||||
property string neutralText: "Neutral"
|
property string neutralText: "Neutral"
|
||||||
@ -30,7 +29,6 @@ Popup {
|
|||||||
anchors.centerIn: Overlay.overlay
|
anchors.centerIn: Overlay.overlay
|
||||||
closePolicy: Popup.CloseOnEscape
|
closePolicy: Popup.CloseOnEscape
|
||||||
background:Item{}
|
background:Item{}
|
||||||
|
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
reversible: true
|
reversible: true
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
@ -58,11 +56,9 @@ Popup {
|
|||||||
implicitHeight: text_title.height + text_message.height + layout_actions.height
|
implicitHeight: text_title.height + text_message.height + layout_actions.height
|
||||||
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
|
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
|
||||||
radius:5
|
radius:5
|
||||||
|
|
||||||
FluShadow{
|
FluShadow{
|
||||||
radius: 5
|
radius: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_title
|
id:text_title
|
||||||
font: FluTextStyle.TitleLarge
|
font: FluTextStyle.TitleLarge
|
||||||
@ -77,7 +73,6 @@ Popup {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_message
|
id:text_message
|
||||||
font: FluTextStyle.Body
|
font: FluTextStyle.Body
|
||||||
@ -93,7 +88,6 @@ Popup {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_actions
|
id:layout_actions
|
||||||
height: 68
|
height: 68
|
||||||
@ -104,7 +98,6 @@ Popup {
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
@ -124,7 +117,6 @@ Popup {
|
|||||||
neutralClicked()
|
neutralClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
id:negative_btn
|
id:negative_btn
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -136,7 +128,6 @@ Popup {
|
|||||||
negativeClicked()
|
negativeClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
id:positive_btn
|
id:positive_btn
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -5,16 +5,15 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property alias title: text_title.text
|
property alias title: text_title.text
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
property int leftPadding: 0
|
property int leftPadding: 10
|
||||||
property int topPadding: 0
|
property int topPadding: 0
|
||||||
property int rightPadding: 0
|
property int rightPadding: 10
|
||||||
property int bottomPadding: 0
|
property int bottomPadding: 10
|
||||||
|
property int pageMode: FluNavigationView.Standard
|
||||||
|
property string url: ''
|
||||||
id:control
|
id:control
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_title
|
id:text_title
|
||||||
font: FluTextStyle.TitleLarge
|
font: FluTextStyle.TitleLarge
|
||||||
@ -27,7 +26,6 @@ Item {
|
|||||||
rightMargin: control.rightPadding
|
rightMargin: control.rightPadding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
clip: true
|
clip: true
|
||||||
id:container
|
id:container
|
||||||
@ -41,5 +39,4 @@ Item {
|
|||||||
bottomMargin: control.bottomPadding
|
bottomMargin: control.bottomPadding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,7 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
|
|
||||||
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
|
property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
color: textColor
|
color: textColor
|
||||||
readOnly: true
|
readOnly: true
|
||||||
@ -34,5 +32,4 @@ TextField {
|
|||||||
id:menu
|
id:menu
|
||||||
inputItem: control
|
inputItem: control
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
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)
|
||||||
@ -13,7 +12,6 @@ Rectangle {
|
|||||||
property bool showYear: true
|
property bool showYear: true
|
||||||
property bool changeFlag: true
|
property bool changeFlag: true
|
||||||
readonly property var rowData: ["","",""]
|
readonly property var rowData: ["","",""]
|
||||||
|
|
||||||
id:root
|
id:root
|
||||||
color: {
|
color: {
|
||||||
if(mouse_area.containsMouse){
|
if(mouse_area.containsMouse){
|
||||||
@ -26,7 +24,6 @@ Rectangle {
|
|||||||
radius: 4
|
radius: 4
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: dividerColor
|
border.color: dividerColor
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:mouse_area
|
id:mouse_area
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@ -35,7 +32,6 @@ Rectangle {
|
|||||||
popup.showPopup()
|
popup.showPopup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:divider_1
|
id:divider_1
|
||||||
width: 1
|
width: 1
|
||||||
@ -44,8 +40,6 @@ Rectangle {
|
|||||||
color: dividerColor
|
color: dividerColor
|
||||||
visible: showYear
|
visible: showYear
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:divider_2
|
id:divider_2
|
||||||
width: 1
|
width: 1
|
||||||
@ -53,7 +47,6 @@ Rectangle {
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
color: dividerColor
|
color: dividerColor
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_year
|
id:text_year
|
||||||
anchors{
|
anchors{
|
||||||
@ -67,8 +60,6 @@ Rectangle {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text:"年"
|
text:"年"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_month
|
id:text_month
|
||||||
anchors{
|
anchors{
|
||||||
@ -81,8 +72,6 @@ Rectangle {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text:"月"
|
text:"月"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_day
|
id:text_day
|
||||||
anchors{
|
anchors{
|
||||||
@ -95,7 +84,6 @@ Rectangle {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text:"日"
|
text:"日"
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu{
|
Menu{
|
||||||
id:popup
|
id:popup
|
||||||
modal: true
|
modal: true
|
||||||
@ -111,7 +99,6 @@ Rectangle {
|
|||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:Transition {
|
exit:Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
@ -139,20 +126,16 @@ Rectangle {
|
|||||||
FluShadow{
|
FluShadow{
|
||||||
radius: 4
|
radius: 4
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
id:layout_content
|
id:layout_content
|
||||||
spacing: 0
|
spacing: 0
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 300
|
height: 300
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:list_delegate
|
id:list_delegate
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
height:38
|
height:38
|
||||||
width:getListView().width
|
width:getListView().width
|
||||||
|
|
||||||
function getListView(){
|
function getListView(){
|
||||||
if(type === 0)
|
if(type === 0)
|
||||||
return list_view_1
|
return list_view_1
|
||||||
@ -161,8 +144,6 @@ Rectangle {
|
|||||||
if(type === 2)
|
if(type === 2)
|
||||||
return list_view_3
|
return list_view_3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.topMargin: 2
|
anchors.topMargin: 2
|
||||||
@ -226,7 +207,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id:list_view_1
|
id:list_view_1
|
||||||
width: 100
|
width: 100
|
||||||
@ -292,14 +272,12 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 1
|
height: 1
|
||||||
anchors.top: layout_content.bottom
|
anchors.top: layout_content.bottom
|
||||||
color: dividerColor
|
color: dividerColor
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_actions
|
id:layout_actions
|
||||||
height: 40
|
height: 40
|
||||||
@ -310,14 +288,12 @@ Rectangle {
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id:divider
|
id:divider
|
||||||
width: 1
|
width: 1
|
||||||
height: parent.height
|
height: parent.height
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -331,7 +307,6 @@ Rectangle {
|
|||||||
popup.close()
|
popup.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
anchors{
|
anchors{
|
||||||
right: parent.right
|
right: parent.right
|
||||||
@ -355,23 +330,18 @@ Rectangle {
|
|||||||
rowData[0] = text_year.text
|
rowData[0] = text_year.text
|
||||||
rowData[1] = text_month.text
|
rowData[1] = text_month.text
|
||||||
rowData[2] = text_day.text
|
rowData[2] = text_day.text
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
var year = text_year.text === "年"? now.getFullYear() : Number(text_year.text);
|
var year = text_year.text === "年"? now.getFullYear() : Number(text_year.text);
|
||||||
var month = text_month.text === "月"? now.getMonth() + 1 : Number(text_month.text);
|
var month = text_month.text === "月"? now.getMonth() + 1 : Number(text_month.text);
|
||||||
var day = text_day.text === "日" ? now.getDate() : Number(text_day.text);
|
var day = text_day.text === "日" ? now.getDate() : Number(text_day.text);
|
||||||
|
|
||||||
list_view_1.currentIndex = list_view_1.model.indexOf(year)
|
list_view_1.currentIndex = list_view_1.model.indexOf(year)
|
||||||
text_year.text = year
|
text_year.text = year
|
||||||
|
|
||||||
list_view_2.model = generateMonthArray(1,12)
|
list_view_2.model = generateMonthArray(1,12)
|
||||||
list_view_2.currentIndex = list_view_2.model.indexOf(month)
|
list_view_2.currentIndex = list_view_2.model.indexOf(month)
|
||||||
text_month.text = month
|
text_month.text = month
|
||||||
|
|
||||||
list_view_3.model = generateMonthDaysArray(year,month)
|
list_view_3.model = generateMonthDaysArray(year,month)
|
||||||
list_view_3.currentIndex = list_view_3.model.indexOf(day)
|
list_view_3.currentIndex = list_view_3.model.indexOf(day)
|
||||||
text_day.text = day
|
text_day.text = day
|
||||||
|
|
||||||
var pos = root.mapToItem(null, 0, 0)
|
var pos = root.mapToItem(null, 0, 0)
|
||||||
if(window.height>pos.y+root.height+container.height){
|
if(window.height>pos.y+root.height+container.height){
|
||||||
popup.y = root.height
|
popup.y = root.height
|
||||||
@ -382,7 +352,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
onClosed: {
|
onClosed: {
|
||||||
if(changeFlag){
|
if(changeFlag){
|
||||||
text_year.text = rowData[0]
|
text_year.text = rowData[0]
|
||||||
@ -391,7 +360,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateYearArray(startYear, endYear) {
|
function generateYearArray(startYear, endYear) {
|
||||||
const yearArray = [];
|
const yearArray = [];
|
||||||
for (let year = startYear; year <= endYear; year++) {
|
for (let year = startYear; year <= endYear; year++) {
|
||||||
@ -399,7 +367,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
return yearArray;
|
return yearArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateMonthArray(startMonth, endMonth) {
|
function generateMonthArray(startMonth, endMonth) {
|
||||||
const monthArray = [];
|
const monthArray = [];
|
||||||
for (let month = startMonth; month <= endMonth; month++) {
|
for (let month = startMonth; month <= endMonth; month++) {
|
||||||
@ -407,7 +374,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
return monthArray;
|
return monthArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateMonthDaysArray(year, month) {
|
function generateMonthDaysArray(year, month) {
|
||||||
const monthDaysArray = [];
|
const monthDaysArray = [];
|
||||||
const lastDayOfMonth = new Date(year, month, 0).getDate();
|
const lastDayOfMonth = new Date(year, month, 0).getDate();
|
||||||
@ -416,6 +382,4 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
return monthDaysArray;
|
return monthDaysArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,10 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
||||||
|
|
||||||
Behavior on color{
|
Behavior on color{
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,25 +5,21 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
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 disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
property var window : Window.window
|
property var window : Window.window
|
||||||
property alias items: menu.content
|
property alias items: menu.content
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
topPadding:5
|
|
||||||
bottomPadding:5
|
|
||||||
leftPadding:15
|
|
||||||
rightPadding:35
|
rightPadding:35
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
focusPolicy:Qt.TabFocus
|
||||||
|
horizontalPadding:12
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
Keys.onSpacePressed: control.visualFocus&&clicked()
|
||||||
|
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
implicitWidth: 28
|
||||||
|
implicitHeight: 28
|
||||||
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 4
|
radius: 4
|
||||||
@ -47,7 +43,6 @@ Button {
|
|||||||
}
|
}
|
||||||
iconColor:title.color
|
iconColor:title.color
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
contentItem: FluText {
|
contentItem: FluText {
|
||||||
id:title
|
id:title
|
||||||
@ -74,23 +69,22 @@ Button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var pos = control.mapToItem(null, 0, 0)
|
if(items && menu.getContainerCount()!==0){
|
||||||
var containerHeight = menu.getContainerHeight()
|
var pos = control.mapToItem(null, 0, 0)
|
||||||
if(window.height>pos.y+control.height+containerHeight){
|
var containerHeight = menu.getContainerHeight()
|
||||||
menu.y = control.height
|
if(window.height>pos.y+control.height+containerHeight){
|
||||||
}else if(pos.y>containerHeight){
|
menu.y = control.height
|
||||||
menu.y = -containerHeight
|
}else if(pos.y>containerHeight){
|
||||||
}else{
|
menu.y = -containerHeight
|
||||||
menu.y = window.height-(pos.y+containerHeight)
|
}else{
|
||||||
|
menu.y = window.height-(pos.y+containerHeight)
|
||||||
|
}
|
||||||
|
menu.open()
|
||||||
}
|
}
|
||||||
menu.open()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluMenu{
|
FluMenu{
|
||||||
id:menu
|
id:menu
|
||||||
width: control.width
|
width: control.width
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,18 +4,15 @@ import QtQuick.Window
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property string headerText: "Titlte"
|
property string headerText: "Titlte"
|
||||||
property bool expand: false
|
property bool expand: false
|
||||||
property int contentHeight : 300
|
property int contentHeight : 300
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
|
id:control
|
||||||
id:root
|
|
||||||
height: layout_header.height + container.height
|
height: layout_header.height + container.height
|
||||||
width: 400
|
width: 400
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_header
|
id:layout_header
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -23,28 +20,24 @@ Item {
|
|||||||
radius: 4
|
radius: 4
|
||||||
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1) : Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1) : Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||||
|
|
||||||
Behavior on color{
|
Behavior on color{
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.color{
|
Behavior on border.color{
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:root_mouse
|
id:control_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
expand = !expand
|
expand = !expand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text: headerText
|
text: headerText
|
||||||
anchors{
|
anchors{
|
||||||
@ -53,7 +46,6 @@ Item {
|
|||||||
leftMargin: 15
|
leftMargin: 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
@ -61,7 +53,7 @@ Item {
|
|||||||
rightMargin: 15
|
rightMargin: 15
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
if(root_mouse.containsMouse || hovered){
|
if(control_mouse.containsMouse || hovered){
|
||||||
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(0,0,0,0) : Qt.rgba(0,0,0,0)
|
return FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||||
@ -81,8 +73,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:container
|
id:container
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -104,5 +94,4 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,23 +4,20 @@ import QtQuick.Controls.Basic
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
||||||
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2)
|
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2)
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
topPadding:5
|
|
||||||
bottomPadding:5
|
|
||||||
leftPadding:15
|
|
||||||
rightPadding:15
|
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
Keys.onSpacePressed: control.visualFocus&&clicked()
|
||||||
focusPolicy:Qt.TabFocus
|
focusPolicy:Qt.TabFocus
|
||||||
font:FluTextStyle.Body
|
font:FluTextStyle.Body
|
||||||
|
horizontalPadding:12
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
implicitWidth: 28
|
||||||
|
implicitHeight: 28
|
||||||
radius: 4
|
radius: 4
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.visualFocus
|
||||||
|
@ -4,22 +4,18 @@ import QtQuick.Controls.Basic
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
|
||||||
property bool vertical: false
|
property bool vertical: false
|
||||||
default property alias content : swipe.contentData
|
default property alias content : swipe.contentData
|
||||||
property alias currentIndex: swipe.currentIndex
|
property alias currentIndex: swipe.currentIndex
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 400
|
width: 400
|
||||||
height: 300
|
height: 300
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
|
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property bool flag: true
|
property bool flag: true
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
preventStealing: true
|
preventStealing: true
|
||||||
@ -36,7 +32,6 @@ Item{
|
|||||||
timer.restart()
|
timer.restart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer{
|
Timer{
|
||||||
id:timer
|
id:timer
|
||||||
interval: 250
|
interval: 250
|
||||||
@ -44,7 +39,6 @@ Item{
|
|||||||
d.flag = true
|
d.flag = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SwipeView {
|
SwipeView {
|
||||||
id:swipe
|
id:swipe
|
||||||
clip: true
|
clip: true
|
||||||
@ -52,7 +46,6 @@ Item{
|
|||||||
orientation:control.vertical ? Qt.Vertical : Qt.Horizontal
|
orientation:control.vertical ? Qt.Vertical : Qt.Horizontal
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Button{
|
Button{
|
||||||
id:btn_start
|
id:btn_start
|
||||||
height: vertical ? 20 : 40
|
height: vertical ? 20 : 40
|
||||||
@ -82,7 +75,6 @@ Item{
|
|||||||
swipe.currentIndex = Math.max(swipe.currentIndex - 1, 0)
|
swipe.currentIndex = Math.max(swipe.currentIndex - 1, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button{
|
Button{
|
||||||
id:btn_end
|
id:btn_end
|
||||||
height: vertical ? 20 : 40
|
height: vertical ? 20 : 40
|
||||||
@ -112,6 +104,4 @@ Item{
|
|||||||
swipe.currentIndex = Math.min(swipe.currentIndex + 1,swipe.count-1)
|
swipe.currentIndex = Math.min(swipe.currentIndex + 1,swipe.count-1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,7 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property int radius: 4
|
property int radius: 4
|
||||||
|
|
||||||
id:root
|
id:root
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -3
|
anchors.margins: -3
|
||||||
@ -19,5 +17,4 @@ Item {
|
|||||||
border.color: FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
border.color: FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
||||||
z: 65535
|
z: 65535
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,16 +3,14 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
|
||||||
property int iconSource
|
property int iconSource
|
||||||
property int iconSize: 20
|
property int iconSize: 20
|
||||||
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||||
|
|
||||||
id:text_icon
|
id:text_icon
|
||||||
font.family: "Segoe Fluent Icons"
|
font.family: "Segoe Fluent Icons"
|
||||||
font.pixelSize: iconSize
|
font.pixelSize: iconSize
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
color: iconColor
|
color: iconColor
|
||||||
text: (String.fromCharCode(iconSource).toString(16));
|
text: (String.fromCharCode(iconSource).toString(16))
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import QtQuick.Controls.Basic
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property int iconSize: 20
|
property int iconSize: 20
|
||||||
property int iconSource
|
property int iconSource
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
@ -35,7 +34,6 @@ Button {
|
|||||||
return Qt.rgba(0,0,0,1)
|
return Qt.rgba(0,0,0,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 30
|
width: 30
|
||||||
height: 30
|
height: 30
|
||||||
|
@ -3,21 +3,17 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
FluObject {
|
FluObject {
|
||||||
id:infoBar
|
|
||||||
|
|
||||||
property var root;
|
property var root;
|
||||||
property int layoutY: 75;
|
property int layoutY: 75
|
||||||
|
id:control
|
||||||
FluObject{
|
FluObject{
|
||||||
id:mcontrol
|
id:mcontrol
|
||||||
|
|
||||||
property string const_success: "success";
|
property string const_success: "success";
|
||||||
property string const_info: "info";
|
property string const_info: "info";
|
||||||
property string const_warning: "warning";
|
property string const_warning: "warning";
|
||||||
property string const_error: "error";
|
property string const_error: "error";
|
||||||
property int maxWidth: 300;
|
property int maxWidth: 300;
|
||||||
property var screenLayout: null;
|
property var screenLayout: null;
|
||||||
|
|
||||||
function create(type,text,duration,moremsg){
|
function create(type,text,duration,moremsg){
|
||||||
if(screenLayout){
|
if(screenLayout){
|
||||||
var last = screenLayout.getLastloader();
|
var last = screenLayout.getLastloader();
|
||||||
@ -26,7 +22,6 @@ FluObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initScreenLayout();
|
initScreenLayout();
|
||||||
contentComponent.createObject(screenLayout,{
|
contentComponent.createObject(screenLayout,{
|
||||||
type:type,
|
type:type,
|
||||||
@ -35,22 +30,19 @@ FluObject {
|
|||||||
moremsg:moremsg,
|
moremsg:moremsg,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCustom(itemcomponent,duration){
|
function createCustom(itemcomponent,duration){
|
||||||
initScreenLayout();
|
initScreenLayout();
|
||||||
if(itemcomponent){
|
if(itemcomponent){
|
||||||
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initScreenLayout(){
|
function initScreenLayout(){
|
||||||
if(screenLayout == null){
|
if(screenLayout == null){
|
||||||
screenLayout = screenlayoutComponent.createObject(root);
|
screenLayout = screenlayoutComponent.createObject(root);
|
||||||
screenLayout.y = infoBar.layoutY;
|
screenLayout.y = control.layoutY;
|
||||||
screenLayout.z = 100000;
|
screenLayout.z = 100000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:screenlayoutComponent
|
id:screenlayoutComponent
|
||||||
Column{
|
Column{
|
||||||
@ -59,9 +51,7 @@ FluObject {
|
|||||||
move: Transition {
|
move: Transition {
|
||||||
NumberAnimation { properties: "y"; easing.type: Easing.OutBack; duration: 300 }
|
NumberAnimation { properties: "y"; easing.type: Easing.OutBack; duration: 300 }
|
||||||
}
|
}
|
||||||
|
|
||||||
onChildrenChanged: if(children.length === 0) destroy();
|
onChildrenChanged: if(children.length === 0) destroy();
|
||||||
|
|
||||||
function getLastloader(){
|
function getLastloader(){
|
||||||
if(children.length > 0){
|
if(children.length > 0){
|
||||||
return children[children.length - 1];
|
return children[children.length - 1];
|
||||||
@ -70,7 +60,6 @@ FluObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:contentComponent
|
id:contentComponent
|
||||||
Item{
|
Item{
|
||||||
@ -80,45 +69,35 @@ FluObject {
|
|||||||
property string type
|
property string type
|
||||||
property string text
|
property string text
|
||||||
property string moremsg
|
property string moremsg
|
||||||
|
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
height: loader.height;
|
height: loader.height;
|
||||||
|
|
||||||
function close(){
|
function close(){
|
||||||
content.destroy();
|
content.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
function restart(){
|
function restart(){
|
||||||
delayTimer.restart();
|
delayTimer.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id:delayTimer
|
id:delayTimer
|
||||||
interval: duration; running: true; repeat: true
|
interval: duration; running: true; repeat: true
|
||||||
onTriggered: content.close();
|
onTriggered: content.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
id:loader;
|
id:loader;
|
||||||
x:(parent.width - width) / 2;
|
x:(parent.width - width) / 2;
|
||||||
property var _super: content;
|
property var _super: content;
|
||||||
|
|
||||||
scale: item ? 1 : 0;
|
scale: item ? 1 : 0;
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
easing.type: Easing.OutBack;
|
easing.type: Easing.OutBack;
|
||||||
duration: 100
|
duration: 100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle;
|
sourceComponent:itemcomponent ? itemcomponent : mcontrol.fluent_sytle;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property Component fluent_sytle: Rectangle{
|
property Component fluent_sytle: Rectangle{
|
||||||
width: rowlayout.width + (_super.moremsg ? 25 : 80);
|
width: rowlayout.width + (_super.moremsg ? 25 : 80);
|
||||||
height: rowlayout.height + 20;
|
height: rowlayout.height + 20;
|
||||||
@ -208,26 +187,19 @@ FluObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSuccess(text,duration=1000,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=1000,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=1000,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=1000,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=1000){
|
function showCustom(itemcomponent,duration=1000){
|
||||||
mcontrol.createCustom(itemcomponent,duration);
|
mcontrol.createCustom(itemcomponent,duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,29 +3,24 @@ import QtQuick.Controls
|
|||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:control
|
|
||||||
property var radius:[0,0,0,0]
|
property var radius:[0,0,0,0]
|
||||||
default property alias contentItem: container.data
|
default property alias contentItem: container.data
|
||||||
|
id:control
|
||||||
Item{
|
Item{
|
||||||
id:container
|
id:container
|
||||||
width: control.width
|
width: control.width
|
||||||
height: control.height
|
height: control.height
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
onWidthChanged: {
|
onWidthChanged: {
|
||||||
canvas.requestPaint()
|
canvas.requestPaint()
|
||||||
}
|
}
|
||||||
|
|
||||||
onHeightChanged: {
|
onHeightChanged: {
|
||||||
canvas.requestPaint()
|
canvas.requestPaint()
|
||||||
}
|
}
|
||||||
|
|
||||||
onRadiusChanged: {
|
onRadiusChanged: {
|
||||||
canvas.requestPaint()
|
canvas.requestPaint()
|
||||||
}
|
}
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
id: canvas
|
id: canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -55,11 +50,9 @@ Item{
|
|||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpacityMask {
|
OpacityMask {
|
||||||
anchors.fill: container
|
anchors.fill: container
|
||||||
source: container
|
source: container
|
||||||
maskSource: canvas
|
maskSource: canvas
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,14 @@ import QtMultimedia
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
property url source
|
property url source
|
||||||
property bool showControl: false
|
property bool showControl: false
|
||||||
property real volume: 30
|
property real volume: 30
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 480
|
width: 480
|
||||||
height: 270
|
height: 270
|
||||||
color: FluColors.Black
|
color: FluColors.Black
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
preventStealing: true
|
preventStealing: true
|
||||||
@ -22,7 +19,6 @@ Rectangle {
|
|||||||
showControl = !showControl
|
showControl = !showControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: mediaplayer
|
id: mediaplayer
|
||||||
property bool autoSeek:true
|
property bool autoSeek:true
|
||||||
@ -31,9 +27,9 @@ Rectangle {
|
|||||||
audioOutput: AudioOutput{
|
audioOutput: AudioOutput{
|
||||||
id:audio_output
|
id:audio_output
|
||||||
}
|
}
|
||||||
onErrorChanged:
|
onErrorStringChanged:
|
||||||
(error)=> {
|
(error)=> {
|
||||||
console.debug(error)
|
console.debug(errorString)
|
||||||
}
|
}
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
if(autoSeek){
|
if(autoSeek){
|
||||||
@ -49,16 +45,13 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
slider.seek(0)
|
slider.seek(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoOutput {
|
VideoOutput {
|
||||||
id:video_output
|
id:video_output
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
height: 100
|
height: 100
|
||||||
y:showControl ? control.height - 110 : control.height
|
y:showControl ? control.height - 110 : control.height
|
||||||
@ -110,7 +103,6 @@ Rectangle {
|
|||||||
mediaplayer.position = val*mediaplayer.duration/slider.maxValue
|
mediaplayer.position = val*mediaplayer.duration/slider.maxValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:start_time
|
id:start_time
|
||||||
anchors{
|
anchors{
|
||||||
@ -120,7 +112,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{
|
||||||
@ -130,7 +121,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
text: formatDuration(mediaplayer.duration)
|
text: formatDuration(mediaplayer.duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
spacing: 10
|
spacing: 10
|
||||||
anchors{
|
anchors{
|
||||||
@ -164,7 +154,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_volume
|
id:btn_volume
|
||||||
iconSize: 17
|
iconSize: 17
|
||||||
@ -179,7 +168,6 @@ Rectangle {
|
|||||||
audio_output.muted = !audio_output.muted
|
audio_output.muted = !audio_output.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluSlider{
|
FluSlider{
|
||||||
id:slider_volume
|
id:slider_volume
|
||||||
size: 80
|
size: 80
|
||||||
@ -195,7 +183,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDuration(duration) {
|
function formatDuration(duration) {
|
||||||
const seconds = Math.floor(duration / 1000);
|
const seconds = Math.floor(duration / 1000);
|
||||||
const hours = Math.floor(seconds / 3600);
|
const hours = Math.floor(seconds / 3600);
|
||||||
@ -203,18 +190,13 @@ Rectangle {
|
|||||||
const remainingSeconds = seconds % 60;
|
const remainingSeconds = seconds % 60;
|
||||||
return `${pad(hours)}:${pad(minutes)}:${pad(remainingSeconds)}`;
|
return `${pad(hours)}:${pad(minutes)}:${pad(remainingSeconds)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function pad(value) {
|
function pad(value) {
|
||||||
return value.toString().padStart(2, '0');
|
return value.toString().padStart(2, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
function pause(){
|
function pause(){
|
||||||
mediaplayer.pause()
|
mediaplayer.pause()
|
||||||
}
|
}
|
||||||
|
|
||||||
function play(){
|
function play(){
|
||||||
mediaplayer.play()
|
mediaplayer.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
|
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
property bool enableAnimation: true
|
property bool enableAnimation: true
|
||||||
id: popup
|
id: popup
|
||||||
@ -21,7 +20,6 @@ Menu {
|
|||||||
duration: enableAnimation ? 83 : 0
|
duration: enableAnimation ? 83 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:Transition {
|
exit:Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
@ -30,7 +28,6 @@ Menu {
|
|||||||
duration: enableAnimation ? 83 : 0
|
duration: enableAnimation ? 83 : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
background:Item{
|
background:Item{
|
||||||
FluShadow{
|
FluShadow{
|
||||||
radius: 5
|
radius: 5
|
||||||
@ -56,9 +53,10 @@ Menu {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContainerHeight(){
|
function getContainerHeight(){
|
||||||
return container.height
|
return container.height
|
||||||
}
|
}
|
||||||
|
function getContainerCount(){
|
||||||
|
return container.children.length
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,9 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property string text: "MenuItem"
|
property string text: "MenuItem"
|
||||||
property var onClickFunc
|
property var onClickFunc
|
||||||
signal clicked
|
signal clicked
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: {
|
width: {
|
||||||
if(control.parent){
|
if(control.parent){
|
||||||
@ -16,7 +14,6 @@ Item {
|
|||||||
return 140
|
return 140
|
||||||
}
|
}
|
||||||
height: 32
|
height: 32
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: control.width-40
|
width: control.width-40
|
||||||
@ -35,12 +32,10 @@ Item {
|
|||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text: control.text
|
text: control.text
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:mouse_area
|
id:mouse_area
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
@ -4,14 +4,12 @@ import QtQuick.Controls.Basic
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
TextArea{
|
TextArea{
|
||||||
|
|
||||||
property bool disabled: false
|
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 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 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 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 placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||||
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 300
|
width: 300
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
@ -44,5 +42,4 @@ TextArea{
|
|||||||
id:menu
|
id:menu
|
||||||
inputItem: control
|
inputItem: control
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,12 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
enum DisplayMode {
|
enum DisplayMode {
|
||||||
Open,
|
Open,
|
||||||
Compact,
|
Compact,
|
||||||
Minimal,
|
Minimal,
|
||||||
Auto
|
Auto
|
||||||
}
|
}
|
||||||
|
|
||||||
property url logo
|
property url logo
|
||||||
property string title: ""
|
property string title: ""
|
||||||
property FluObject items
|
property FluObject items
|
||||||
@ -21,9 +19,13 @@ Item {
|
|||||||
property int displayMode: FluNavigationView.Auto
|
property int displayMode: FluNavigationView.Auto
|
||||||
property Component autoSuggestBox
|
property Component autoSuggestBox
|
||||||
property Component actionItem
|
property Component actionItem
|
||||||
|
property int topPadding: 0
|
||||||
|
enum PageModeFlag{
|
||||||
|
Standard = 0,
|
||||||
|
SingleTop = 1,
|
||||||
|
SingleTask = 2
|
||||||
|
}
|
||||||
id:control
|
id:control
|
||||||
|
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property bool enableStack: true
|
property bool enableStack: true
|
||||||
@ -46,11 +48,9 @@ Item {
|
|||||||
property bool isCompactAndPanel: d.displayMode === FluNavigationView.Compact && d.enableNavigationPanel
|
property bool isCompactAndPanel: d.displayMode === FluNavigationView.Compact && d.enableNavigationPanel
|
||||||
property bool isCompactAndNotPanel:d.displayMode === FluNavigationView.Compact && !d.enableNavigationPanel
|
property bool isCompactAndNotPanel:d.displayMode === FluNavigationView.Compact && !d.enableNavigationPanel
|
||||||
property bool isMinimalAndPanel: d.displayMode === FluNavigationView.Minimal && d.enableNavigationPanel
|
property bool isMinimalAndPanel: d.displayMode === FluNavigationView.Minimal && d.enableNavigationPanel
|
||||||
|
|
||||||
onIsCompactAndNotPanelChanged: {
|
onIsCompactAndNotPanelChanged: {
|
||||||
collapseAll()
|
collapseAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
onDisplayModeChanged: {
|
onDisplayModeChanged: {
|
||||||
if(d.displayMode === FluNavigationView.Compact){
|
if(d.displayMode === FluNavigationView.Compact){
|
||||||
collapseAll()
|
collapseAll()
|
||||||
@ -61,7 +61,6 @@ Item {
|
|||||||
timer_anim_x_enable.restart()
|
timer_anim_x_enable.restart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleItems(){
|
function handleItems(){
|
||||||
var idx = 0
|
var idx = 0
|
||||||
var data = []
|
var data = []
|
||||||
@ -97,14 +96,12 @@ Item {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_empty
|
id:com_panel_item_empty
|
||||||
Item{
|
Item{
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_separatorr
|
id:com_panel_item_separatorr
|
||||||
FluDivider{
|
FluDivider{
|
||||||
@ -124,7 +121,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_header
|
id:com_panel_item_header
|
||||||
Item{
|
Item{
|
||||||
@ -153,7 +149,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_expander
|
id:com_panel_item_expander
|
||||||
Item{
|
Item{
|
||||||
@ -259,7 +254,6 @@ Item {
|
|||||||
iconSize: 15
|
iconSize: 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:item_icon
|
id:item_icon
|
||||||
width: 30
|
width: 30
|
||||||
@ -308,7 +302,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item
|
id:com_panel_item
|
||||||
Item{
|
Item{
|
||||||
@ -412,7 +405,6 @@ Item {
|
|||||||
iconSize: 15
|
iconSize: 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:item_icon
|
id:item_icon
|
||||||
width: 30
|
width: 30
|
||||||
@ -432,7 +424,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_title
|
id:item_title
|
||||||
text:model.title
|
text:model.title
|
||||||
@ -462,17 +453,20 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id:nav_app_bar
|
id:nav_app_bar
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 40
|
height: 40
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
topMargin: control.topPadding
|
||||||
|
}
|
||||||
z:999
|
z:999
|
||||||
RowLayout{
|
RowLayout{
|
||||||
height:parent.height
|
height:parent.height
|
||||||
spacing: 0
|
spacing: 0
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
|
id:btn_back
|
||||||
iconSource: FluentIcons.ChromeBack
|
iconSource: FluentIcons.ChromeBack
|
||||||
Layout.leftMargin: 5
|
Layout.leftMargin: 5
|
||||||
Layout.preferredWidth: 30
|
Layout.preferredWidth: 30
|
||||||
@ -535,7 +529,6 @@ Item {
|
|||||||
font: FluTextStyle.Body
|
font: FluTextStyle.Body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
height: parent.height
|
height: parent.height
|
||||||
@ -552,7 +545,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
anchors{
|
anchors{
|
||||||
left: d.isMinimal || d.isCompactAndPanel ? parent.left : layout_list.right
|
left: d.isMinimal || d.isCompactAndPanel ? parent.left : layout_list.right
|
||||||
@ -591,7 +583,6 @@ Item {
|
|||||||
replaceExit : Transition{}
|
replaceExit : Transition{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: d.isMinimalAndPanel||d.isCompactAndPanel
|
visible: d.isMinimalAndPanel||d.isCompactAndPanel
|
||||||
@ -599,7 +590,6 @@ Item {
|
|||||||
d.enableNavigationPanel = false
|
d.enableNavigationPanel = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_list
|
id:layout_list
|
||||||
width: {
|
width: {
|
||||||
@ -633,16 +623,9 @@ Item {
|
|||||||
if(d.isMinimal || d.isCompactAndPanel){
|
if(d.isMinimal || d.isCompactAndPanel){
|
||||||
return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(243/255,243/255,243/255,1)
|
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 "#00000000"
|
||||||
return FluTheme.dark ? Qt.rgba(26/255,34/255,41/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{
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 300
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
x: {
|
x: {
|
||||||
if(d.displayMode !== FluNavigationView.Minimal)
|
if(d.displayMode !== FluNavigationView.Minimal)
|
||||||
return 0
|
return 0
|
||||||
@ -652,7 +635,7 @@ Item {
|
|||||||
id:layout_header
|
id:layout_header
|
||||||
width: layout_list.width
|
width: layout_list.width
|
||||||
clip: true
|
clip: true
|
||||||
y:nav_app_bar.height
|
y:nav_app_bar.height+control.topPadding
|
||||||
height: autoSuggestBox ? 38 : 0
|
height: autoSuggestBox ? 38 : 0
|
||||||
Loader{
|
Loader{
|
||||||
id:loader_auto_suggest_box
|
id:loader_auto_suggest_box
|
||||||
@ -671,7 +654,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
visible:opacity
|
visible:opacity
|
||||||
opacity:d.isCompactAndNotPanel
|
opacity:d.isCompactAndNotPanel
|
||||||
@ -699,7 +681,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id:nav_list
|
id:nav_list
|
||||||
clip: true
|
clip: true
|
||||||
@ -806,7 +787,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Popup{
|
Popup{
|
||||||
property var childModel
|
property var childModel
|
||||||
id:control_popup
|
id:control_popup
|
||||||
@ -872,7 +852,6 @@ Item {
|
|||||||
control_popup.open()
|
control_popup.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer{
|
Timer{
|
||||||
id:timer_anim_x_enable
|
id:timer_anim_x_enable
|
||||||
interval: 150
|
interval: 150
|
||||||
@ -880,7 +859,6 @@ Item {
|
|||||||
anim_layout_list_x.enabled = true
|
anim_layout_list_x.enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function collapseAll(){
|
function collapseAll(){
|
||||||
for(var i=0;i<nav_list.model.length;i++){
|
for(var i=0;i<nav_list.model.length;i++){
|
||||||
var item = nav_list.model[i]
|
var item = nav_list.model[i]
|
||||||
@ -889,24 +867,44 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCurrentIndex(index){
|
function setCurrentIndex(index){
|
||||||
nav_list.currentIndex = index
|
nav_list.currentIndex = index
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getItems(){
|
function getItems(){
|
||||||
return nav_list.model
|
return nav_list.model
|
||||||
}
|
}
|
||||||
|
|
||||||
function push(url){
|
function push(url){
|
||||||
nav_swipe.push(url)
|
if (nav_swipe.depth>0)
|
||||||
|
{
|
||||||
|
let page = nav_swipe.find(function(item) {
|
||||||
|
return item.url === url;
|
||||||
|
})
|
||||||
|
if (page)
|
||||||
|
{
|
||||||
|
switch(page.pageMode)
|
||||||
|
{
|
||||||
|
case FluNavigationView.SingleTask:
|
||||||
|
while(nav_swipe.currentItem !== page)
|
||||||
|
{
|
||||||
|
nav_swipe.pop()
|
||||||
|
d.stackItems.pop()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
case FluNavigationView.SingleTop:
|
||||||
|
if (nav_swipe.currentItem.url === url)
|
||||||
|
return
|
||||||
|
break
|
||||||
|
case FluNavigationView.Standard:
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nav_swipe.push(url,{url:url})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentIndex(){
|
function getCurrentIndex(){
|
||||||
return nav_list.currentIndex
|
return nav_list.currentIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPageByItem(data){
|
function startPageByItem(data){
|
||||||
var items = getItems();
|
var items = getItems();
|
||||||
for(var i=0;i<items.length;i++){
|
for(var i=0;i<items.length;i++){
|
||||||
@ -923,5 +921,10 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function backButton(){
|
||||||
|
return btn_back
|
||||||
|
}
|
||||||
|
function navButton(){
|
||||||
|
return btn_nav
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
57
src/imports/FluentUI/Controls/FluNavigationView2.qml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Controls.Basic
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
Item {
|
||||||
|
|
||||||
|
property url logo
|
||||||
|
property string title: ""
|
||||||
|
property FluObject items
|
||||||
|
property FluObject footerItems
|
||||||
|
property int displayMode: FluNavigationView.Auto
|
||||||
|
property Component autoSuggestBox
|
||||||
|
property Component actionItem
|
||||||
|
id:control
|
||||||
|
Item {
|
||||||
|
id:nav_app_bar
|
||||||
|
width: parent.width
|
||||||
|
height: 40
|
||||||
|
RowLayout{
|
||||||
|
height:parent.height
|
||||||
|
spacing: 0
|
||||||
|
FluIconButton{
|
||||||
|
iconSource: FluentIcons.ChromeBack
|
||||||
|
Layout.leftMargin: 5
|
||||||
|
Layout.preferredWidth: 30
|
||||||
|
Layout.preferredHeight: 30
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
iconSize: 15
|
||||||
|
}
|
||||||
|
FluIconButton{
|
||||||
|
id:btn_nav
|
||||||
|
iconSource: FluentIcons.GlobalNavButton
|
||||||
|
iconSize: 15
|
||||||
|
Layout.preferredWidth: 30
|
||||||
|
Layout.preferredHeight: 30
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
Layout.preferredHeight: 20
|
||||||
|
Layout.preferredWidth: 20
|
||||||
|
source: control.logo
|
||||||
|
Layout.leftMargin: 12
|
||||||
|
sourceSize: Qt.size(40,40)
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
text:control.title
|
||||||
|
Layout.leftMargin: 12
|
||||||
|
font: FluTextStyle.Body
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,6 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id:flu_object;
|
|
||||||
|
|
||||||
default property list<QtObject> children;
|
default property list<QtObject> children;
|
||||||
|
id:flu_object;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: control
|
|
||||||
signal requestPage(int page,int count)
|
signal requestPage(int page,int count)
|
||||||
property string previousText: "<上一页"
|
property string previousText: "<上一页"
|
||||||
property string nextText: "下一页>"
|
property string nextText: "下一页>"
|
||||||
@ -14,18 +13,14 @@ Item {
|
|||||||
property int __itemPerPage: 10
|
property int __itemPerPage: 10
|
||||||
property int pageButtonCount: 5
|
property int pageButtonCount: 5
|
||||||
property int __pageButtonHalf: Math.floor(pageButtonCount/2)+1
|
property int __pageButtonHalf: Math.floor(pageButtonCount/2)+1
|
||||||
|
id: control
|
||||||
|
|
||||||
implicitHeight: 40
|
implicitHeight: 40
|
||||||
implicitWidth: content.width
|
implicitWidth: content.width
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
id: content
|
id: content
|
||||||
height: control.height
|
height: control.height
|
||||||
spacing: 25
|
spacing: 10
|
||||||
padding: 10
|
padding: 10
|
||||||
|
|
||||||
|
|
||||||
FluToggleButton{
|
FluToggleButton{
|
||||||
visible: control.pageCount>1
|
visible: control.pageCount>1
|
||||||
disabled: control.pageCurrent<=1
|
disabled: control.pageCurrent<=1
|
||||||
@ -34,7 +29,6 @@ Item {
|
|||||||
control.calcNewPage(control.pageCurrent-1);
|
control.calcNewPage(control.pageCurrent-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
spacing: 5
|
spacing: 5
|
||||||
FluToggleButton{
|
FluToggleButton{
|
||||||
@ -94,7 +88,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function calcNewPage(page)
|
function calcNewPage(page)
|
||||||
{
|
{
|
||||||
if(!page)
|
if(!page)
|
||||||
@ -105,6 +98,4 @@ Item {
|
|||||||
control.pageCurrent=page_num
|
control.pageCurrent=page_num
|
||||||
control.requestPage(page_num,control.__itemPerPage)
|
control.requestPage(page_num,control.__itemPerPage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import QtQuick.Controls.Basic
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
TextField{
|
TextField{
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property int iconSource: 0
|
property int iconSource: 0
|
||||||
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 normalColor: FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
|
||||||
@ -12,7 +11,6 @@ TextField{
|
|||||||
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 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 placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||||
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 300
|
width: 300
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
@ -74,6 +72,4 @@ TextField{
|
|||||||
id:menu
|
id:menu
|
||||||
inputItem: control
|
inputItem: control
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,27 +3,22 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
default property alias content: d.children
|
default property alias content: d.children
|
||||||
property alias currentIndex: nav_list.currentIndex
|
property alias currentIndex: nav_list.currentIndex
|
||||||
property color normalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
|
property color normalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120
|
||||||
property color hoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
|
property color hoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
width: 400
|
width: 400
|
||||||
height: 300
|
height: 300
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
preventStealing: true
|
preventStealing: true
|
||||||
}
|
}
|
||||||
|
|
||||||
FluObject{
|
FluObject{
|
||||||
id:d
|
id:d
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id:nav_list
|
id:nav_list
|
||||||
height: 40
|
height: 40
|
||||||
@ -77,7 +72,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:container
|
id:container
|
||||||
anchors{
|
anchors{
|
||||||
@ -87,7 +81,6 @@ Item {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater{
|
Repeater{
|
||||||
model:d.children
|
model:d.children
|
||||||
Loader{
|
Loader{
|
||||||
@ -98,6 +91,4 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,14 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
FluRectangle {
|
FluRectangle {
|
||||||
|
|
||||||
property real progress: 0.5
|
property real progress: 0.5
|
||||||
property bool indeterminate: true
|
property bool indeterminate: true
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
width: 150
|
width: 150
|
||||||
height: 5
|
height: 5
|
||||||
radius: [3,3,3,3]
|
radius: [3,3,3,3]
|
||||||
clip: true
|
clip: true
|
||||||
color: FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
|
color: FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if(indeterminate){
|
if(indeterminate){
|
||||||
bar.x = -control.width*0.5
|
bar.x = -control.width*0.5
|
||||||
@ -23,14 +20,12 @@ FluRectangle {
|
|||||||
bar.x = 0
|
bar.x = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:bar
|
id:bar
|
||||||
radius: 3
|
radius: 3
|
||||||
width: control.width*progress
|
width: control.width*progress
|
||||||
height: control.height
|
height: control.height
|
||||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
color:FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
|
|
||||||
Behavior on x{
|
Behavior on x{
|
||||||
id:behavior
|
id:behavior
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@ -3,13 +3,11 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
property real linWidth : width/8
|
property real linWidth : width/8
|
||||||
property real progress: 0.25
|
property real progress: 0.25
|
||||||
property bool indeterminate: true
|
property bool indeterminate: true
|
||||||
readonly property real radius2 : radius - linWidth/2
|
readonly property real radius2 : radius - linWidth/2
|
||||||
property color primaryColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color primaryColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
width: 44
|
width: 44
|
||||||
height: 44
|
height: 44
|
||||||
@ -17,25 +15,21 @@ Rectangle {
|
|||||||
border.width: linWidth
|
border.width: linWidth
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
border.color: FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
|
border.color: FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1)
|
||||||
|
|
||||||
onProgressChanged: {
|
onProgressChanged: {
|
||||||
canvas.requestPaint()
|
canvas.requestPaint()
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections{
|
|
||||||
target: FluTheme
|
|
||||||
function onDarkChanged(){
|
|
||||||
canvas.requestPaint()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if(indeterminate){
|
if(indeterminate){
|
||||||
behavior.enabled = true
|
behavior.enabled = true
|
||||||
control.rotation = 360
|
control.rotation = 360
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Connections{
|
||||||
|
target: FluTheme
|
||||||
|
function onDarkChanged(){
|
||||||
|
canvas.requestPaint()
|
||||||
|
}
|
||||||
|
}
|
||||||
Behavior on rotation{
|
Behavior on rotation{
|
||||||
id:behavior
|
id:behavior
|
||||||
enabled: false
|
enabled: false
|
||||||
@ -53,7 +47,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
id:canvas
|
id:canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -74,6 +67,4 @@ Rectangle {
|
|||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,8 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
focusPolicy:Qt.TabFocus
|
||||||
@ -102,4 +100,3 @@ Button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,22 +3,18 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property int number: 5
|
property int number: 5
|
||||||
property int spacing: 4
|
property int spacing: 4
|
||||||
property int size: 18
|
property int size: 18
|
||||||
property int value:0
|
property int value:0
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
implicitWidth: container.width
|
implicitWidth: container.width
|
||||||
implicitHeight: container.height
|
implicitHeight: container.height
|
||||||
|
|
||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property int mouseValue: 0
|
property int mouseValue: 0
|
||||||
property int itemSize: control.size+spacing*2
|
property int itemSize: control.size+spacing*2
|
||||||
}
|
}
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
id:container
|
id:container
|
||||||
spacing: 0
|
spacing: 0
|
||||||
@ -42,7 +38,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: container
|
anchors.fill: container
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@ -56,5 +51,4 @@ Item {
|
|||||||
control.value = Number(mouse.x / d.itemSize)+1
|
control.value = Number(mouse.x / d.itemSize)+1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,10 @@ import Qt5Compat.GraphicalEffects
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
|
||||||
property var radius:[0,0,0,0]
|
property var radius:[0,0,0,0]
|
||||||
property color color : "#FFFFFF"
|
property color color : "#FFFFFF"
|
||||||
property bool shadow: true
|
property bool shadow: true
|
||||||
default property alias contentItem: container.data
|
default property alias contentItem: container.data
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
FluShadow{
|
FluShadow{
|
||||||
anchors.fill: container
|
anchors.fill: container
|
||||||
@ -21,7 +19,6 @@ Item{
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:container
|
id:container
|
||||||
width: control.width
|
width: control.width
|
||||||
@ -29,7 +26,6 @@ Item{
|
|||||||
opacity: 0
|
opacity: 0
|
||||||
color:control.color
|
color:control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
id: canvas
|
id: canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -59,11 +55,9 @@ Item{
|
|||||||
ctx.restore();
|
ctx.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpacityMask {
|
OpacityMask {
|
||||||
anchors.fill: container
|
anchors.fill: container
|
||||||
source: container
|
source: container
|
||||||
maskSource: canvas
|
maskSource: canvas
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,17 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls.Basic
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
ScrollBar {
|
ScrollBar {
|
||||||
|
|
||||||
property color handleNormalColor: Qt.rgba(134/255,134/255,134/255,1)
|
property color handleNormalColor: Qt.rgba(134/255,134/255,134/255,1)
|
||||||
property color handleHoverColor: Qt.lighter(handleNormalColor)
|
property color handleHoverColor: Qt.lighter(handleNormalColor)
|
||||||
property color handlePressColor: Qt.darker(handleNormalColor)
|
property color handlePressColor: Qt.darker(handleNormalColor)
|
||||||
property bool expand: false
|
property bool expand: false
|
||||||
|
|
||||||
id: control
|
id: control
|
||||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||||
implicitContentWidth + leftPadding + rightPadding)
|
implicitContentWidth + leftPadding + rightPadding)
|
||||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||||
implicitContentHeight + topPadding + bottomPadding)
|
implicitContentHeight + topPadding + bottomPadding)
|
||||||
|
|
||||||
visible: control.policy !== ScrollBar.AlwaysOff
|
visible: control.policy !== ScrollBar.AlwaysOff
|
||||||
minimumSize: 0.3
|
minimumSize: 0.3
|
||||||
topPadding:{
|
topPadding:{
|
||||||
@ -128,7 +125,6 @@ ScrollBar {
|
|||||||
duration: 150
|
duration: 150
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_top
|
id:btn_top
|
||||||
iconSource: FluentIcons.CaretSolidUp
|
iconSource: FluentIcons.CaretSolidUp
|
||||||
@ -190,5 +186,4 @@ ScrollBar {
|
|||||||
increase()
|
increase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import QtQuick.Controls
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
property alias title: text_title.text
|
property alias title: text_title.text
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
property int spacing : 0
|
property int spacing : 0
|
||||||
@ -13,9 +12,9 @@ Item {
|
|||||||
property int topPadding: 0
|
property int topPadding: 0
|
||||||
property int rightPadding: 10
|
property int rightPadding: 10
|
||||||
property int bottomPadding: 10
|
property int bottomPadding: 10
|
||||||
|
property int pageMode: FluNavigationView.Standard
|
||||||
|
property string url: ''
|
||||||
id:control
|
id:control
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_title
|
id:text_title
|
||||||
font: FluTextStyle.Title
|
font: FluTextStyle.Title
|
||||||
@ -31,7 +30,6 @@ Item {
|
|||||||
rightMargin: control.rightPadding
|
rightMargin: control.rightPadding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Flickable{
|
Flickable{
|
||||||
id:flickview
|
id:flickview
|
||||||
clip: true
|
clip: true
|
||||||
|
@ -6,63 +6,61 @@ Item {
|
|||||||
|
|
||||||
property color color: FluTheme.dark ? "#FFFFFF" : "#999999"
|
property color color: FluTheme.dark ? "#FFFFFF" : "#999999"
|
||||||
property int radius: 4
|
property int radius: 4
|
||||||
|
id:control
|
||||||
id:root
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -4
|
anchors.margins: -4
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: root.width
|
width: control.width
|
||||||
height: root.height
|
height: control.height
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
opacity: 0.02
|
opacity: 0.02
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: root.radius
|
radius: control.radius
|
||||||
border.color: root.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: root.width - 2
|
width: control.width - 2
|
||||||
height: root.height - 2
|
height: control.height - 2
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
opacity: 0.04
|
opacity: 0.04
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: root.radius
|
radius: control.radius
|
||||||
border.color: root.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: root.width - 4
|
width: control.width - 4
|
||||||
height: root.height - 4
|
height: control.height - 4
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
opacity: 0.06
|
opacity: 0.06
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: root.radius
|
radius: control.radius
|
||||||
border.color: root.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: root.width - 6
|
width: control.width - 6
|
||||||
height: root.height - 6
|
height: control.height - 6
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
opacity: 0.08
|
opacity: 0.08
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: root.radius
|
radius: control.radius
|
||||||
border.color: root.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: root.width - 8
|
width: control.width - 8
|
||||||
height: root.height - 8
|
height: control.height - 8
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
opacity: 0.1
|
opacity: 0.1
|
||||||
radius: root.radius
|
radius: control.radius
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: root.color
|
border.color: control.color
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import Qt5Compat.GraphicalEffects
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
|
||||||
property int size: 180
|
property int size: 180
|
||||||
property int dotSize: 24
|
property int dotSize: 24
|
||||||
property int value: 50
|
property int value: 50
|
||||||
@ -14,16 +13,13 @@ Item{
|
|||||||
property var onLineClickFunc
|
property var onLineClickFunc
|
||||||
signal pressed
|
signal pressed
|
||||||
signal released
|
signal released
|
||||||
|
|
||||||
id:root
|
id:root
|
||||||
height: control.height
|
height: control.height
|
||||||
width: control.width
|
width: control.width
|
||||||
rotation: vertical ? 180 : 0
|
rotation: vertical ? 180 : 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
seek(value)
|
seek(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:mouse_line
|
id:mouse_line
|
||||||
anchors.centerIn: control
|
anchors.centerIn: control
|
||||||
@ -45,7 +41,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: control
|
id: control
|
||||||
width: vertical ? 4 :size
|
width: vertical ? 4 :size
|
||||||
@ -61,7 +56,6 @@ Item{
|
|||||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:dot
|
id:dot
|
||||||
width: dotSize
|
width: dotSize
|
||||||
@ -109,20 +103,17 @@ Item{
|
|||||||
}
|
}
|
||||||
root.pressed()
|
root.pressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
tool_tip.visible = false
|
tool_tip.visible = false
|
||||||
root.released()
|
root.released()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluTooltip{
|
FluTooltip{
|
||||||
id:tool_tip
|
id:tool_tip
|
||||||
text:String(root.value)
|
text:String(root.value)
|
||||||
y: vertical ? 32 : -40
|
y: vertical ? 32 : -40
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function seek(val){
|
function seek(val){
|
||||||
if(vertical){
|
if(vertical){
|
||||||
dot.y =val/maxValue*control.height - dotSize/2
|
dot.y =val/maxValue*control.height - dotSize/2
|
||||||
|
@ -4,7 +4,6 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
|
||||||
enum StatusMode {
|
enum StatusMode {
|
||||||
Loading,
|
Loading,
|
||||||
Empty,
|
Empty,
|
||||||
@ -14,13 +13,11 @@ Item{
|
|||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
property int statusMode: FluStatusView.Loading
|
property int statusMode: FluStatusView.Loading
|
||||||
signal errorClicked
|
signal errorClicked
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:container
|
id:container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: statusMode === FluStatusView.Success
|
visible: statusMode === FluStatusView.Success
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
paddings: 0
|
paddings: 0
|
||||||
border.width: 0
|
border.width: 0
|
||||||
@ -43,7 +40,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
paddings: 0
|
paddings: 0
|
||||||
border.width: 0
|
border.width: 0
|
||||||
@ -63,7 +59,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
paddings: 0
|
paddings: 0
|
||||||
border.width: 0
|
border.width: 0
|
||||||
@ -90,8 +85,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function showSuccessView(){
|
function showSuccessView(){
|
||||||
statusMode = FluStatusView.Success
|
statusMode = FluStatusView.Success
|
||||||
}
|
}
|
||||||
@ -104,5 +97,4 @@ Item{
|
|||||||
function showErrorView(){
|
function showErrorView(){
|
||||||
statusMode = FluStatusView.Error
|
statusMode = FluStatusView.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,25 +4,21 @@ import QtQuick.Layouts
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
enum TabWidthBehavior {
|
enum TabWidthBehavior {
|
||||||
Equal,
|
Equal,
|
||||||
SizeToContent,
|
SizeToContent,
|
||||||
Compact
|
Compact
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CloseButtonVisibility{
|
enum CloseButtonVisibility{
|
||||||
Nerver,
|
Nerver,
|
||||||
Always,
|
Always,
|
||||||
OnHover
|
OnHover
|
||||||
}
|
}
|
||||||
|
|
||||||
property int tabWidthBehavior : FluTabView.Equal
|
property int tabWidthBehavior : FluTabView.Equal
|
||||||
property int closeButtonVisibility : FluTabView.Always
|
property int closeButtonVisibility : FluTabView.Always
|
||||||
property int itemWidth: 146
|
property int itemWidth: 146
|
||||||
property bool addButtonVisibility: true
|
property bool addButtonVisibility: true
|
||||||
signal newPressed
|
signal newPressed
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
@ -31,7 +27,6 @@ Item {
|
|||||||
return parent
|
return parent
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
property int dragIndex: -1
|
property int dragIndex: -1
|
||||||
@ -39,16 +34,13 @@ Item {
|
|||||||
property bool itemPress: false
|
property bool itemPress: false
|
||||||
property int maxEqualWidth: 240
|
property int maxEqualWidth: 240
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
preventStealing: true
|
preventStealing: true
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id:tab_model
|
id:tab_model
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_new
|
id:btn_new
|
||||||
visible: addButtonVisibility
|
visible: addButtonVisibility
|
||||||
@ -61,7 +53,6 @@ Item {
|
|||||||
newPressed()
|
newPressed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView{
|
ListView{
|
||||||
id:tab_nav
|
id:tab_nav
|
||||||
height: 34
|
height: 34
|
||||||
@ -88,21 +79,16 @@ Item {
|
|||||||
policy: ScrollBar.AlwaysOff
|
policy: ScrollBar.AlwaysOff
|
||||||
}
|
}
|
||||||
delegate: Item{
|
delegate: Item{
|
||||||
|
|
||||||
width: item_layout.width
|
width: item_layout.width
|
||||||
height: item_container.height
|
height: item_container.height
|
||||||
z: item_mouse_drag.pressed ? 1000 : 1
|
z: item_mouse_drag.pressed ? 1000 : 1
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:item_layout
|
id:item_layout
|
||||||
width: item_container.width
|
width: item_container.width
|
||||||
height: item_container.height
|
height: item_container.height
|
||||||
|
|
||||||
FluItem{
|
FluItem{
|
||||||
id:item_container
|
id:item_container
|
||||||
|
|
||||||
property real timestamp: new Date().getTime()
|
property real timestamp: new Date().getTime()
|
||||||
|
|
||||||
height: tab_nav.height
|
height: tab_nav.height
|
||||||
width: {
|
width: {
|
||||||
if(tabWidthBehavior === FluTabView.Equal){
|
if(tabWidthBehavior === FluTabView.Equal){
|
||||||
@ -119,24 +105,20 @@ Item {
|
|||||||
radius: [6,6,0,0]
|
radius: [6,6,0,0]
|
||||||
Behavior on x { enabled: d.dragBehavior; NumberAnimation { duration: 200 } }
|
Behavior on x { enabled: d.dragBehavior; NumberAnimation { duration: 200 } }
|
||||||
Behavior on y { enabled: d.dragBehavior; NumberAnimation { duration: 200 } }
|
Behavior on y { enabled: d.dragBehavior; NumberAnimation { duration: 200 } }
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:item_mouse_hove
|
id:item_mouse_hove
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:item_mouse_drag
|
id:item_mouse_drag
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
drag.target: item_container
|
drag.target: item_container
|
||||||
drag.axis: Drag.XAxis
|
drag.axis: Drag.XAxis
|
||||||
|
|
||||||
onWheel: (wheel)=>{
|
onWheel: (wheel)=>{
|
||||||
if (wheel.angleDelta.y > 0) scroll_nav.decrease()
|
if (wheel.angleDelta.y > 0) scroll_nav.decrease()
|
||||||
else scroll_nav.increase()
|
else scroll_nav.increase()
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
d.itemPress = true
|
d.itemPress = true
|
||||||
item_container.timestamp = new Date().getTime();
|
item_container.timestamp = new Date().getTime();
|
||||||
@ -147,7 +129,6 @@ Item {
|
|||||||
item_container.x = pos.x
|
item_container.x = pos.x
|
||||||
item_container.y = pos.y
|
item_container.y = pos.y
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
d.itemPress = false
|
d.itemPress = false
|
||||||
timer.stop()
|
timer.stop()
|
||||||
@ -164,7 +145,6 @@ Item {
|
|||||||
item_container.x = 0;
|
item_container.x = 0;
|
||||||
item_container.y = 0;
|
item_container.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
var pos = tab_nav.mapFromItem(item_container, 0, 0)
|
var pos = tab_nav.mapFromItem(item_container, 0, 0)
|
||||||
updatePosition(pos)
|
updatePosition(pos)
|
||||||
@ -211,7 +191,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: {
|
color: {
|
||||||
@ -234,7 +213,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
spacing: 0
|
spacing: 0
|
||||||
height: parent.height
|
height: parent.height
|
||||||
@ -271,7 +249,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:item_btn_close
|
id:item_btn_close
|
||||||
iconSource: FluentIcons.ChromeClose
|
iconSource: FluentIcons.ChromeClose
|
||||||
@ -294,7 +271,6 @@ Item {
|
|||||||
tab_model.remove(index)
|
tab_model.remove(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluDivider{
|
FluDivider{
|
||||||
width: 1
|
width: 1
|
||||||
height: 16
|
height: 16
|
||||||
@ -307,8 +283,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:container
|
id:container
|
||||||
anchors{
|
anchors{
|
||||||
@ -317,7 +291,6 @@ Item {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater{
|
Repeater{
|
||||||
model:tab_model
|
model:tab_model
|
||||||
Loader{
|
Loader{
|
||||||
@ -328,23 +301,17 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function createTab(icon,text,page,argument={}){
|
function createTab(icon,text,page,argument={}){
|
||||||
return {icon:icon,text:text,page:page,argument:argument}
|
return {icon:icon,text:text,page:page,argument:argument}
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendTab(icon,text,page,argument){
|
function appendTab(icon,text,page,argument){
|
||||||
tab_model.append(createTab(icon,text,page,argument))
|
tab_model.append(createTab(icon,text,page,argument))
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTabList(list){
|
function setTabList(list){
|
||||||
tab_model.clear()
|
tab_model.clear()
|
||||||
tab_model.append(list)
|
tab_model.append(list)
|
||||||
}
|
}
|
||||||
|
|
||||||
function count(){
|
function count(){
|
||||||
return tab_nav.count
|
return tab_nav.count
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|