mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 01:25:25 +08:00
Compare commits
65 Commits
Author | SHA1 | Date | |
---|---|---|---|
6da4a2e10e | |||
021745c366 | |||
2cfd5b3ab2 | |||
2c7d556042 | |||
609df92f8c | |||
ca57b16521 | |||
c25e2362c4 | |||
a37e4e3b9f | |||
e4f02f50ca | |||
6d7366f74c | |||
154670f744 | |||
11206c1d18 | |||
3fa54b37c1 | |||
ca7292e168 | |||
2becb17d52 | |||
7c1b03b22f | |||
ebed19b130 | |||
d55874f01e | |||
b4f9f32195 | |||
cf9ffbe0ca | |||
b2328ba82c | |||
1073efe423 | |||
5af755dd95 | |||
5f2f127623 | |||
52174b7e24 | |||
e69604f5a9 | |||
c23981b81d | |||
fc9e764c4c | |||
591e6bdeff | |||
4878c92595 | |||
64f40451ec | |||
5c0befb6c2 | |||
33b916a172 | |||
183e29dfaa | |||
f1589e9d1a | |||
e3abd96b8e | |||
8b2b01beac | |||
3007f8f3df | |||
0dbbba56da | |||
a123dfbccf | |||
4fdbb47bec | |||
24305a3137 | |||
22d5dfbbc3 | |||
3b42b30518 | |||
1b41bd1bcd | |||
75e850750c | |||
22de749c74 | |||
1565e2a3eb | |||
b02695c012 | |||
b7fdcca506 | |||
f802838847 | |||
038a2dd598 | |||
27d1b3f57f | |||
1ca784c28f | |||
e7c185e723 | |||
87d9e45791 | |||
0ca1de2f1a | |||
1897408528 | |||
7b922a4380 | |||
f998b58d88 | |||
a44d2cfe64 | |||
91e7cc8a60 | |||
ae6ef539ff | |||
4187fb52dd | |||
db41a7a1ee |
4
.github/workflows/macos.yml
vendored
4
.github/workflows/macos.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-12]
|
os: [macos-12]
|
||||||
qt_ver: [6.4.3]
|
qt_ver: [6.5.0]
|
||||||
qt_arch: [clang_64]
|
qt_arch: [clang_64]
|
||||||
env:
|
env:
|
||||||
targetName: example
|
targetName: example
|
||||||
@ -50,7 +50,7 @@ jobs:
|
|||||||
cmake --version
|
cmake --version
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.4.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/FluentUI/Qt/6.5.0/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
|
6
.github/workflows/ubuntu.yml
vendored
6
.github/workflows/ubuntu.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04]
|
os: [ubuntu-20.04]
|
||||||
qt_ver: [6.4.3]
|
qt_ver: [6.5.0]
|
||||||
qt_arch: [gcc_64]
|
qt_arch: [gcc_64]
|
||||||
env:
|
env:
|
||||||
targetName: example
|
targetName: example
|
||||||
@ -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 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
|
run: sudo apt-get install -y libxcb-cursor0 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: |
|
||||||
@ -55,7 +55,7 @@ jobs:
|
|||||||
cmake --version
|
cmake --version
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.4.3/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.5.0/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: install QT linux deploy
|
- name: install QT linux deploy
|
||||||
|
4
.github/workflows/windows-mingw.yml
vendored
4
.github/workflows/windows-mingw.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- qt_arch: win64_mingw
|
- qt_arch: win64_mingw
|
||||||
qt_ver: 6.4.3
|
qt_ver: 6.5.0
|
||||||
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||||||
qt_tools_mingw_install: mingw900_64
|
qt_tools_mingw_install: mingw900_64
|
||||||
env:
|
env:
|
||||||
@ -62,7 +62,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.4.3\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
|
6
.github/workflows/windows.yml
vendored
6
.github/workflows/windows.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [windows-2019]
|
os: [windows-2019]
|
||||||
include:
|
include:
|
||||||
- qt_ver: 6.4.3
|
- qt_ver: 6.5.0
|
||||||
qt_arch: win64_msvc2019_64
|
qt_arch: win64_msvc2019_64
|
||||||
msvc_arch: x64
|
msvc_arch: x64
|
||||||
qt_arch_install: msvc2019_64
|
qt_arch_install: msvc2019_64
|
||||||
@ -42,7 +42,7 @@ jobs:
|
|||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats qtspeech'
|
||||||
|
|
||||||
- name: msvc-build
|
- name: msvc-build
|
||||||
id: build
|
id: build
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.4.3\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\6.5.0\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
||||||
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(FluentUI VERSION 0.1 LANGUAGES CXX)
|
project(FluentUI VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
QML FluentUI
|
QML FluentUI
|
||||||
</h1>
|
</h1>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
A fluent design component library for Qt QML
|
A fluent design component library for Qt QML。 <a href="https://zhuzichu520.github.io">official wasm app.</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
![win-badge] ![ubuntu-badge] ![macos-badge] ![release-badge] ![download-badge] ![download-latest]
|
![win-badge] ![ubuntu-badge] ![macos-badge] ![release-badge] ![download-badge] ![download-latest]
|
||||||
@ -42,7 +42,7 @@ This is a beautiful FluentUI component library based on Qt QML. Currently the ma
|
|||||||
+ Qt LinguistTool (optional,for translations)
|
+ Qt LinguistTool (optional,for translations)
|
||||||
+ Qt Svg (optional, however essential for Qt 5)
|
+ 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.
|
Use [Qt Online Installers](https://download.qt.io/archive/online_installers/) to acquire the modules (**Recommended**) or compile them first before using the library.
|
||||||
|
|
||||||
## ⚽ Get started
|
## ⚽ Get started
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(example VERSION 0.1 LANGUAGES CXX)
|
project(example VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ endif()
|
|||||||
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||||
|
|
||||||
#设置版本号
|
#设置版本号
|
||||||
add_definitions(-DVERSION=1,3,1,0)
|
add_definitions(-DVERSION=1,3,2,1)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
||||||
|
|
||||||
|
@ -39,4 +39,4 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x409, 1200
|
VALUE "Translation", 0x409, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
@ -1,69 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Qt.labs.platform
|
|
||||||
import FluentUI
|
|
||||||
import "qrc:///example/qml/global/"
|
|
||||||
|
|
||||||
FluWindow {
|
|
||||||
|
|
||||||
id:window
|
|
||||||
title: "FluentUI"
|
|
||||||
width: 1000
|
|
||||||
height: 640
|
|
||||||
closeDestory:false
|
|
||||||
minimumWidth: 520
|
|
||||||
minimumHeight: 460
|
|
||||||
launchMode: FluWindow.SingleTask
|
|
||||||
visible: true
|
|
||||||
|
|
||||||
FluNavigationView2{
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -6,17 +6,19 @@ import FluentUI
|
|||||||
|
|
||||||
FluExpander{
|
FluExpander{
|
||||||
|
|
||||||
|
id:control
|
||||||
property string code: ""
|
property string code: ""
|
||||||
|
|
||||||
headerText: "Source"
|
headerText: "Source"
|
||||||
contentHeight:content.height
|
contentHeight:content.height
|
||||||
|
focus: false
|
||||||
|
|
||||||
FluMultilineTextBox{
|
FluMultilineTextBox{
|
||||||
id:content
|
id:content
|
||||||
width:parent.width
|
width:parent.width
|
||||||
readOnly:true
|
activeFocusOnTab: false
|
||||||
|
activeFocusOnPress: false
|
||||||
|
readOnly: true
|
||||||
text:highlightQmlCode(code)
|
text:highlightQmlCode(code)
|
||||||
focus:false
|
|
||||||
textFormat: FluMultilineTextBox.RichText
|
textFormat: FluMultilineTextBox.RichText
|
||||||
KeyNavigation.priority: KeyNavigation.BeforeItem
|
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||||
background:Rectangle{
|
background:Rectangle{
|
||||||
@ -24,6 +26,11 @@ FluExpander{
|
|||||||
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
Behavior on color{
|
||||||
|
ColorAnimation {
|
||||||
|
duration: 300
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +42,11 @@ FluExpander{
|
|||||||
rightMargin: 5
|
rightMargin: 5
|
||||||
topMargin: 5
|
topMargin: 5
|
||||||
}
|
}
|
||||||
|
onActiveFocusChanged: {
|
||||||
|
if(activeFocus){
|
||||||
|
control.expand = true
|
||||||
|
}
|
||||||
|
}
|
||||||
onClicked:{
|
onClicked:{
|
||||||
FluTools.clipText(content.text)
|
FluTools.clipText(content.text)
|
||||||
showSuccess("复制成功")
|
showSuccess("复制成功")
|
||||||
@ -42,91 +54,91 @@ FluExpander{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function htmlEncode(e){
|
function htmlEncode(e){
|
||||||
var i,s;
|
var i,s;
|
||||||
for(i in s={
|
for(i in s={
|
||||||
"&":/&/g,//""//":/"/g,"'":/'/g,
|
"&":/&/g,//""//":/"/g,"'":/'/g,
|
||||||
"<":/</g,">":/>/g,"<br/>":/\n/g,
|
"<":/</g,">":/>/g,"<br/>":/\n/g,
|
||||||
" ":/ /g," ":/\t/g
|
" ":/ /g," ":/\t/g
|
||||||
})e=e.replace(s[i],i);
|
})e=e.replace(s[i],i);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
function highlightQmlCode(code) {
|
function highlightQmlCode(code) {
|
||||||
// 定义 QML 关键字列表
|
// 定义 QML 关键字列表
|
||||||
var qmlKeywords = [
|
var qmlKeywords = [
|
||||||
"FluTextButton",
|
"FluTextButton",
|
||||||
"FluAppBar",
|
"FluAppBar",
|
||||||
"FluAutoSuggestBox",
|
"FluAutoSuggestBox",
|
||||||
"FluBadge",
|
"FluBadge",
|
||||||
"FluButton",
|
"FluButton",
|
||||||
"FluCalendarPicker",
|
"FluCalendarPicker",
|
||||||
"FluCalendarView",
|
"FluCalendarView",
|
||||||
"FluCarousel",
|
"FluCarousel",
|
||||||
"FluCheckBox",
|
"FluCheckBox",
|
||||||
"FluColorPicker",
|
"FluColorPicker",
|
||||||
"FluColorView",
|
"FluColorView",
|
||||||
"FluComboBox",
|
"FluComboBox",
|
||||||
"FluContentDialog",
|
"FluContentDialog",
|
||||||
"FluContentPage",
|
"FluContentPage",
|
||||||
"FluDatePicker",
|
"FluDatePicker",
|
||||||
"FluDivider",
|
"FluDivider",
|
||||||
"FluDropDownButton",
|
"FluDropDownButton",
|
||||||
"FluExpander",
|
"FluExpander",
|
||||||
"FluFilledButton",
|
"FluFilledButton",
|
||||||
"FluFlipView",
|
"FluFlipView",
|
||||||
"FluFocusRectangle",
|
"FluFocusRectangle",
|
||||||
"FluIcon",
|
"FluIcon",
|
||||||
"FluIconButton",
|
"FluIconButton",
|
||||||
"FluInfoBar",
|
"FluInfoBar",
|
||||||
"FluItem",
|
"FluItem",
|
||||||
"FluMediaPlayer",
|
"FluMediaPlayer",
|
||||||
"FluMenu",
|
"FluMenu",
|
||||||
"FluMenuItem",
|
"FluMenuItem",
|
||||||
"FluMultilineTextBox",
|
"FluMultilineTextBox",
|
||||||
"FluNavigationView",
|
"FluNavigationView",
|
||||||
"FluObject",
|
"FluObject",
|
||||||
"FluPaneItem",
|
"FluPaneItem",
|
||||||
"FluPaneItemExpander",
|
"FluPaneItemExpander",
|
||||||
"FluPaneItemHeader",
|
"FluPaneItemHeader",
|
||||||
"FluPaneItemSeparator",
|
"FluPaneItemSeparator",
|
||||||
"FluPivot",
|
"FluPivot",
|
||||||
"FluPivotItem",
|
"FluPivotItem",
|
||||||
"FluProgressBar",
|
"FluProgressBar",
|
||||||
"FluProgressRing",
|
"FluProgressRing",
|
||||||
"FluRadioButton",
|
"FluRadioButton",
|
||||||
"FluRectangle",
|
"FluRectangle",
|
||||||
"FluScrollablePage",
|
"FluScrollablePage",
|
||||||
"FluScrollBar",
|
"FluScrollBar",
|
||||||
"FluShadow",
|
"FluShadow",
|
||||||
"FluSlider",
|
"FluSlider",
|
||||||
"FluTabView",
|
"FluTabView",
|
||||||
"FluText",
|
"FluText",
|
||||||
"FluTextArea",
|
"FluTextArea",
|
||||||
"FluTextBox",
|
"FluTextBox",
|
||||||
"FluTextBoxBackground",
|
"FluTextBoxBackground",
|
||||||
"FluTextBoxMenu",
|
"FluTextBoxMenu",
|
||||||
"FluTextButton",
|
"FluTextButton",
|
||||||
"FluTextFiled",
|
"FluTextFiled",
|
||||||
"FluTimePicker",
|
"FluTimePicker",
|
||||||
"FluToggleSwitch",
|
"FluToggleSwitch",
|
||||||
"FluTooltip",
|
"FluTooltip",
|
||||||
"FluTreeView",
|
"FluTreeView",
|
||||||
"FluWindow",
|
"FluWindow",
|
||||||
"FluWindowResize",
|
"FluWindowResize",
|
||||||
"FluToggleButton",
|
"FluToggleButton",
|
||||||
"FluTableView",
|
"FluTableView",
|
||||||
"FluColors",
|
"FluColors",
|
||||||
"FluTheme",
|
"FluTheme",
|
||||||
"FluStatusView",
|
"FluStatusView",
|
||||||
"FluRatingControl",
|
"FluRatingControl",
|
||||||
"FluPasswordBox",
|
"FluPasswordBox",
|
||||||
"FluBreadcrumbBar",
|
"FluBreadcrumbBar",
|
||||||
"FluCopyableText",
|
"FluCopyableText",
|
||||||
"FluAcrylic"
|
"FluAcrylic"
|
||||||
];
|
];
|
||||||
code = code.replace(/\n/g, "<br>");
|
code = code.replace(/\n/g, "<br>");
|
||||||
code = code.replace(/ /g, " ");
|
code = code.replace(/ /g, " ");
|
||||||
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
|
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
import org.wangwenx190.FramelessHelper
|
import org.wangwenx190.FramelessHelper
|
||||||
@ -12,10 +12,6 @@ FluWindow {
|
|||||||
property bool appBarVisible: true
|
property bool appBarVisible: true
|
||||||
default property alias content: container.data
|
default property alias content: container.data
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
console.debug(FramelessUtils.frameBorderVisible)
|
|
||||||
}
|
|
||||||
|
|
||||||
FluAppBar {
|
FluAppBar {
|
||||||
id: title_bar
|
id: title_bar
|
||||||
title: window.title
|
title: window.title
|
||||||
@ -49,9 +45,20 @@ FluWindow {
|
|||||||
setHitTestVisible(title_bar.closeButton())
|
setHitTestVisible(title_bar.closeButton())
|
||||||
framless_helper.setWindowFixedSize(fixSize)
|
framless_helper.setWindowFixedSize(fixSize)
|
||||||
title_bar.maximizeButton.visible = !fixSize
|
title_bar.maximizeButton.visible = !fixSize
|
||||||
|
if (blurBehindWindowEnabled)
|
||||||
|
window.backgroundVisible = false
|
||||||
window.visible = true
|
window.visible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Connections{
|
||||||
|
target: FluTheme
|
||||||
|
function onDarkChanged(){
|
||||||
|
if (FluTheme.dark)
|
||||||
|
FramelessUtils.systemTheme = FramelessHelperConstants.Dark
|
||||||
|
else
|
||||||
|
FramelessUtils.systemTheme = FramelessHelperConstants.Light
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setHitTestVisible(com){
|
function setHitTestVisible(com){
|
||||||
framless_helper.setHitTestVisible(com)
|
framless_helper.setHitTestVisible(com)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import FluentUI
|
import FluentUI
|
||||||
@ -166,6 +166,12 @@ FluObject{
|
|||||||
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
|
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ComboBox"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Tooltip"
|
title:"Tooltip"
|
||||||
onTap:{
|
onTap:{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -22,7 +22,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
|
||||||
FluTextButton{
|
FluTextButton{
|
||||||
disabled:text_button_switch.selected
|
disabled:text_button_switch.checked
|
||||||
text:"Text Button"
|
text:"Text Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showInfo("点击Text Button")
|
showInfo("点击Text Button")
|
||||||
@ -32,18 +32,13 @@ FluScrollablePage{
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
Row{
|
id:text_button_switch
|
||||||
spacing: 5
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:text_button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
@ -64,7 +59,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
disabled:button_switch.selected
|
disabled:button_switch.checked
|
||||||
text:"Standard Button"
|
text:"Standard Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showInfo("点击StandardButton")
|
showInfo("点击StandardButton")
|
||||||
@ -74,18 +69,13 @@ FluScrollablePage{
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
Row{
|
id:button_switch
|
||||||
spacing: 5
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
@ -106,7 +96,7 @@ FluScrollablePage{
|
|||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
disabled:filled_button_switch.selected
|
disabled:filled_button_switch.checked
|
||||||
text:"Filled Button"
|
text:"Filled Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showWarning("点击FilledButton"+height)
|
showWarning("点击FilledButton"+height)
|
||||||
@ -116,18 +106,13 @@ FluScrollablePage{
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
Row{
|
id:filled_button_switch
|
||||||
spacing: 5
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:filled_button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
@ -148,28 +133,20 @@ FluScrollablePage{
|
|||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
FluToggleButton{
|
FluToggleButton{
|
||||||
disabled:toggle_button_switch.selected
|
disabled:toggle_button_switch.checked
|
||||||
text:"Toggle Button"
|
text:"Toggle Button"
|
||||||
onClicked: {
|
|
||||||
selected = !selected
|
|
||||||
}
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
Row{
|
id:toggle_button_switch
|
||||||
spacing: 5
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:toggle_button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
@ -178,7 +155,7 @@ FluScrollablePage{
|
|||||||
code:'FluToggleButton{
|
code:'FluToggleButton{
|
||||||
text:"Toggle Button"
|
text:"Toggle Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
selected = !selected
|
checked = !checked
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
@ -191,7 +168,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
iconSource:FluentIcons.ChromeCloseContrast
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
disabled:icon_button_switch.selected
|
disabled:icon_button_switch.checked
|
||||||
iconSize: 15
|
iconSize: 15
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
@ -201,18 +178,13 @@ FluScrollablePage{
|
|||||||
showSuccess("点击IconButton")
|
showSuccess("点击IconButton")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
Row{
|
id:icon_button_switch
|
||||||
spacing: 5
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:icon_button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
@ -232,7 +204,7 @@ FluScrollablePage{
|
|||||||
paddings: 10
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
FluDropDownButton{
|
FluDropDownButton{
|
||||||
disabled:drop_down_button_switch.selected
|
disabled:drop_down_button_switch.checked
|
||||||
text:"DropDownButton"
|
text:"DropDownButton"
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
@ -253,17 +225,13 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Row{
|
FluToggleSwitch{
|
||||||
spacing: 5
|
id:drop_down_button_switch
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:drop_down_button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
@ -304,35 +272,29 @@ FluScrollablePage{
|
|||||||
property int selecIndex : 0
|
property int selecIndex : 0
|
||||||
model: 3
|
model: 3
|
||||||
delegate: FluRadioButton{
|
delegate: FluRadioButton{
|
||||||
selected : repeater.selecIndex===index
|
checked : repeater.selecIndex===index
|
||||||
disabled:radio_button_switch.selected
|
disabled:radio_button_switch.checked
|
||||||
text:"Radio Button_"+index
|
text:"Radio Button_"+index
|
||||||
onClicked:{
|
clickListener:function(){
|
||||||
repeater.selecIndex = index
|
repeater.selecIndex = index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:radio_button_switch
|
||||||
Row{
|
|
||||||
spacing: 5
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
text:"Disabled"
|
||||||
id:radio_button_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: -1
|
Layout.topMargin: -1
|
||||||
code:'FluRadioButton{
|
code:'FluRadioButton{
|
||||||
selected:true
|
checked:true
|
||||||
text:"Text Button"
|
text:"Text Button"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
||||||
@ -340,38 +302,4 @@ FluScrollablePage{
|
|||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: 68
|
|
||||||
paddings: 10
|
|
||||||
Layout.topMargin: 20
|
|
||||||
FluCheckBox{
|
|
||||||
disabled:check_box_switch.selected
|
|
||||||
text:"Check Box"
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row{
|
|
||||||
spacing: 5
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
id:check_box_switch
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text:"Disabled"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CodeExpander{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: -1
|
|
||||||
code:'FluCheckBox{
|
|
||||||
text:"Check Box"
|
|
||||||
}'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -18,11 +18,21 @@ FluScrollablePage{
|
|||||||
spacing: 30
|
spacing: 30
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
FluCheckBox{
|
FluCheckBox{
|
||||||
|
disabled: check_box_switch.checked
|
||||||
}
|
}
|
||||||
FluCheckBox{
|
FluCheckBox{
|
||||||
|
disabled: check_box_switch.checked
|
||||||
text:"Text"
|
text:"Text"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:check_box_switch
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
84
example/qml/page/T_ComboBox.qml
Normal file
84
example/qml/page/T_ComboBox.qml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"ComboBox"
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 80
|
||||||
|
paddings: 5
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Column{
|
||||||
|
spacing: 5
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluText{
|
||||||
|
text: "editable=false"
|
||||||
|
x:10
|
||||||
|
}
|
||||||
|
FluComboBox {
|
||||||
|
model: ListModel {
|
||||||
|
id: model_1
|
||||||
|
ListElement { text: "Banana" }
|
||||||
|
ListElement { text: "Apple" }
|
||||||
|
ListElement { text: "Coconut" }
|
||||||
|
}
|
||||||
|
onAccepted: {
|
||||||
|
if (find(editText) === -1)
|
||||||
|
model_1.append({text: editText})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 80
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Column{
|
||||||
|
spacing: 5
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluText{
|
||||||
|
text: "editable=true"
|
||||||
|
x:5
|
||||||
|
}
|
||||||
|
FluComboBox {
|
||||||
|
editable: true
|
||||||
|
model: ListModel {
|
||||||
|
id: model_2
|
||||||
|
ListElement { text: "Banana" }
|
||||||
|
ListElement { text: "Apple" }
|
||||||
|
ListElement { text: "Coconut" }
|
||||||
|
}
|
||||||
|
onAccepted: {
|
||||||
|
if (find(editText) === -1)
|
||||||
|
model_2.append({text: editText})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluComboBox{
|
||||||
|
editable: true
|
||||||
|
model: ListModel {
|
||||||
|
id: model
|
||||||
|
ListElement { text: "Banana" }
|
||||||
|
ListElement { text: "Apple" }
|
||||||
|
ListElement { text: "Coconut" }
|
||||||
|
}
|
||||||
|
onAccepted: {
|
||||||
|
if (find(editText) === -1)
|
||||||
|
model.append({text: editText})
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
@ -40,9 +40,9 @@ FluScrollablePage{
|
|||||||
property int selecIndex : 0
|
property int selecIndex : 0
|
||||||
model: 3
|
model: 3
|
||||||
delegate: FluRadioButton{
|
delegate: FluRadioButton{
|
||||||
selected : repeater.selecIndex===index
|
checked : repeater.selecIndex===index
|
||||||
text:"Radio Button_"+index
|
text:"Radio Button_"+index
|
||||||
onClicked:{
|
clickListener:function() {
|
||||||
repeater.selecIndex = index
|
repeater.selecIndex = index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -7,6 +7,8 @@ import FluentUI
|
|||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
|
pageMode: FluNavigationView.SingleTask
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
id:model_header
|
id:model_header
|
||||||
ListElement{
|
ListElement{
|
||||||
@ -75,10 +77,10 @@ FluScrollablePage{
|
|||||||
FluAcrylic {
|
FluAcrylic {
|
||||||
sourceItem:bg
|
sourceItem:bg
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: FluTheme.dark ? 'black' : 'white'
|
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)
|
||||||
rectX: list.x-list.contentX+10+(control.width)*index
|
rectX: list.x-list.contentX+10+(control.width)*index
|
||||||
rectY: list.y+10
|
rectY: list.y+10
|
||||||
acrylicOpacity:0.5
|
acrylicOpacity:0.8
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -61,7 +61,7 @@ FluScrollablePage{
|
|||||||
FluMenuItem:{
|
FluMenuItem:{
|
||||||
text:"修改"
|
text:"修改"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showInfo"修改")
|
showInfo("修改")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -30,17 +30,14 @@ FluScrollablePage{
|
|||||||
Repeater{
|
Repeater{
|
||||||
model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
|
model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
|
||||||
delegate: FluRadioButton{
|
delegate: FluRadioButton{
|
||||||
selected : FluTheme.darkMode === modelData.mode
|
checked : FluTheme.darkMode === modelData.mode
|
||||||
text:modelData.title
|
text:modelData.title
|
||||||
onClicked:{
|
clickListener:function(){
|
||||||
FluTheme.darkMode = modelData.mode
|
FluTheme.darkMode = modelData.mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
@ -63,10 +60,10 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
Repeater{
|
Repeater{
|
||||||
model: [{title:"Open",mode:FluNavigationView.Open},{title:"Compact",mode:FluNavigationView.Compact},{title:"Minimal",mode:FluNavigationView.Minimal},{title:"Auto",mode:FluNavigationView.Auto}]
|
model: [{title:"Open",mode:FluNavigationView.Open},{title:"Compact",mode:FluNavigationView.Compact},{title:"Minimal",mode:FluNavigationView.Minimal},{title:"Auto",mode:FluNavigationView.Auto}]
|
||||||
delegate: FluRadioButton{
|
delegate: FluRadioButton{
|
||||||
selected : MainEvent.displayMode===modelData.mode
|
checked : MainEvent.displayMode===modelData.mode
|
||||||
text:modelData.title
|
text:modelData.title
|
||||||
onClicked:{
|
clickListener:function(){
|
||||||
MainEvent.displayMode = modelData.mode
|
MainEvent.displayMode = modelData.mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,11 +94,10 @@ FluScrollablePage{
|
|||||||
spacing: 5
|
spacing: 5
|
||||||
Repeater{
|
Repeater{
|
||||||
model: ["Zh","En"]
|
model: ["Zh","En"]
|
||||||
delegate: FluRadioButton{
|
delegate: FluRadioButton{
|
||||||
selected : appInfo.lang.objectName === modelData
|
checked: appInfo.lang.objectName === modelData
|
||||||
text:modelData
|
text:modelData
|
||||||
onClicked:{
|
clickListener:function(){
|
||||||
console.debug(modelData)
|
|
||||||
appInfo.changeLang(modelData)
|
appInfo.changeLang(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
@ -19,7 +19,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
placeholderText: "单行输入框"
|
placeholderText: "单行输入框"
|
||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
disabled:text_box_switch.selected
|
disabled:text_box_switch.checked
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -57,7 +57,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
placeholderText: "请输入密码"
|
placeholderText: "请输入密码"
|
||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
disabled:password_box_switch.selected
|
disabled:password_box_switch.checked
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -97,7 +97,7 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
placeholderText: "多行输入框"
|
placeholderText: "多行输入框"
|
||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
disabled:text_box_multi_switch.selected
|
disabled:text_box_multi_switch.checked
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -137,7 +137,7 @@ FluScrollablePage{
|
|||||||
placeholderText: "AutoSuggestBox"
|
placeholderText: "AutoSuggestBox"
|
||||||
Layout.preferredWidth: 300
|
Layout.preferredWidth: 300
|
||||||
items:generateRandomNames(100)
|
items:generateRandomNames(100)
|
||||||
disabled:text_box_suggest_switch.selected
|
disabled:text_box_suggest_switch.checked
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -52,8 +52,8 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
Layout.topMargin: 5
|
Layout.topMargin: 5
|
||||||
selected: FluTheme.dark
|
checked: FluTheme.dark
|
||||||
clickFunc:function(){
|
onClicked: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
FluTheme.darkMode = FluDarkMode.Light
|
FluTheme.darkMode = FluDarkMode.Light
|
||||||
}else{
|
}else{
|
||||||
@ -67,8 +67,8 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
Layout.topMargin: 5
|
Layout.topMargin: 5
|
||||||
selected: FluTheme.nativeText
|
checked: FluTheme.nativeText
|
||||||
clickFunc:function(){
|
onClicked: {
|
||||||
FluTheme.nativeText = !FluTheme.nativeText
|
FluTheme.nativeText = !FluTheme.nativeText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
@ -18,11 +18,20 @@ FluScrollablePage{
|
|||||||
spacing: 30
|
spacing: 30
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
|
disabled: toggle_switch.checked
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
text:"Text"
|
disabled: toggle_switch.checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:toggle_switch
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@ -64,11 +64,12 @@ CustomWindow {
|
|||||||
negativeText:"最小化"
|
negativeText:"最小化"
|
||||||
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||||
onNegativeClicked:{
|
onNegativeClicked:{
|
||||||
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
|
|
||||||
window.hide()
|
window.hide()
|
||||||
|
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
|
||||||
}
|
}
|
||||||
positiveText:"退出"
|
positiveText:"退出"
|
||||||
neutralText:"取消"
|
neutralText:"取消"
|
||||||
|
blurSource: nav_view
|
||||||
onPositiveClicked:{
|
onPositiveClicked:{
|
||||||
window.deleteWindow()
|
window.deleteWindow()
|
||||||
FluApp.closeApp()
|
FluApp.closeApp()
|
||||||
@ -116,7 +117,7 @@ CustomWindow {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
ItemsOriginal.navigationView = nav_view
|
ItemsOriginal.navigationView = nav_view
|
||||||
ItemsFooter.navigationView = nav_view
|
ItemsFooter.navigationView = nav_view
|
||||||
nav_view.setCurrentIndex(0)
|
setCurrentIndex(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#include "AppInfo.h"
|
#include "AppInfo.h"
|
||||||
|
|
||||||
|
#include <QQmlContext>
|
||||||
|
#include <QDebug>
|
||||||
#include "lang/En.h"
|
#include "lang/En.h"
|
||||||
#include "lang/Zh.h"
|
#include "lang/Zh.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#define STR(x) #x
|
#define STR(x) #x
|
||||||
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
|
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
|
||||||
@ -15,6 +17,16 @@ AppInfo::AppInfo(QObject *parent)
|
|||||||
lang(new En());
|
lang(new En());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppInfo::init(QQmlApplicationEngine *engine){
|
||||||
|
QQmlContext * context = engine->rootContext();
|
||||||
|
Lang* lang = this->lang();
|
||||||
|
context->setContextProperty("lang",lang);
|
||||||
|
QObject::connect(this,&AppInfo::langChanged,this,[=]{
|
||||||
|
context->setContextProperty("lang",this->lang());
|
||||||
|
});
|
||||||
|
context->setContextProperty("appInfo",this);
|
||||||
|
}
|
||||||
|
|
||||||
void AppInfo::changeLang(const QString& locale){
|
void AppInfo::changeLang(const QString& locale){
|
||||||
if(_lang){
|
if(_lang){
|
||||||
_lang->deleteLater();
|
_lang->deleteLater();
|
||||||
@ -26,5 +38,19 @@ void AppInfo::changeLang(const QString& locale){
|
|||||||
}else {
|
}else {
|
||||||
lang(new En());
|
lang(new En());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AppInfo::isOwnerProcess(IPC *ipc){
|
||||||
|
QString activeWindowEvent = "activeWindow";
|
||||||
|
if(!ipc->isCurrentOwner()){
|
||||||
|
ipc->postEvent(activeWindowEvent,QString().toUtf8(),0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(ipc->isAttached()){
|
||||||
|
ipc->registerEventHandler(activeWindowEvent,[=](const QByteArray&){
|
||||||
|
Q_EMIT this->activeWindow();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#ifndef APPINFO_H
|
#ifndef APPINFO_H
|
||||||
#define APPINFO_H
|
#define APPINFO_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QQmlApplicationEngine>
|
||||||
|
#include "tool/IPC.h"
|
||||||
#include "lang/Lang.h"
|
#include "lang/Lang.h"
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
@ -12,6 +14,8 @@ class AppInfo : public QObject
|
|||||||
Q_PROPERTY_AUTO(Lang*,lang)
|
Q_PROPERTY_AUTO(Lang*,lang)
|
||||||
public:
|
public:
|
||||||
explicit AppInfo(QObject *parent = nullptr);
|
explicit AppInfo(QObject *parent = nullptr);
|
||||||
|
void init(QQmlApplicationEngine *engine);
|
||||||
|
bool isOwnerProcess(IPC *ipc);
|
||||||
Q_INVOKABLE void changeLang(const QString& locale);
|
Q_INVOKABLE void changeLang(const QString& locale);
|
||||||
Q_SIGNAL void activeWindow();
|
Q_SIGNAL void activeWindow();
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "En.h"
|
#include "En.h"
|
||||||
|
|
||||||
En::En(QObject *parent)
|
En::En(QObject *parent)
|
||||||
: Lang{parent}
|
: Lang{parent}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef EN_H
|
#ifndef EN_H
|
||||||
#define EN_H
|
#define EN_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef LANG_H
|
#ifndef LANG_H
|
||||||
#define LANG_H
|
#define LANG_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "Zh.h"
|
#include "Zh.h"
|
||||||
|
|
||||||
Zh::Zh(QObject *parent)
|
Zh::Zh(QObject *parent)
|
||||||
: Lang{parent}
|
: Lang{parent}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef ZH_H
|
#ifndef ZH_H
|
||||||
#define ZH_H
|
#define ZH_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@ -6,13 +6,11 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <FramelessHelper/Quick/framelessquickmodule.h>
|
#include <FramelessHelper/Quick/framelessquickmodule.h>
|
||||||
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
||||||
#include "lang/Lang.h"
|
|
||||||
#include "AppInfo.h"
|
#include "AppInfo.h"
|
||||||
#include "tool/IPC.h"
|
|
||||||
|
|
||||||
FRAMELESSHELPER_USE_NAMESPACE
|
FRAMELESSHELPER_USE_NAMESPACE
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//将样式设置为Basic,不然会导致组件显示异常
|
//将样式设置为Basic,不然会导致组件显示异常
|
||||||
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
||||||
@ -21,33 +19,26 @@ FRAMELESSHELPER_USE_NAMESPACE
|
|||||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||||
QGuiApplication::setApplicationName("FluentUI");
|
QGuiApplication::setApplicationName("FluentUI");
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
#ifdef Q_OS_WIN // 此设置仅在Windows下生效
|
||||||
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
|
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
|
||||||
|
#endif
|
||||||
|
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||||
|
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
||||||
|
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
||||||
|
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur,false);
|
||||||
|
#endif
|
||||||
AppInfo* appInfo = new AppInfo();
|
AppInfo* appInfo = new AppInfo();
|
||||||
IPC ipc(0);
|
IPC ipc(0);
|
||||||
QString activeWindowEvent = "activeWindow";
|
if(!appInfo->isOwnerProcess(&ipc)){
|
||||||
if(!ipc.isCurrentOwner()){
|
|
||||||
ipc.postEvent(activeWindowEvent,QString().toUtf8(),0);
|
|
||||||
delete appInfo;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(ipc.isAttached()){
|
|
||||||
ipc.registerEventHandler(activeWindowEvent,[&appInfo](const QByteArray&){
|
|
||||||
Q_EMIT appInfo->activeWindow();
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
app.setQuitOnLastWindowClosed(false);
|
app.setQuitOnLastWindowClosed(false);
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
FramelessHelper::Quick::registerTypes(&engine);
|
FramelessHelper::Quick::registerTypes(&engine);
|
||||||
QQmlContext * context = engine.rootContext();
|
appInfo->init(&engine);
|
||||||
Lang* lang = appInfo->lang();
|
|
||||||
context->setContextProperty("lang",lang);
|
|
||||||
QObject::connect(appInfo,&AppInfo::langChanged,&app,[context,appInfo]{
|
|
||||||
context->setContextProperty("lang",appInfo->lang());
|
|
||||||
});
|
|
||||||
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"));
|
|
||||||
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,4 +1,4 @@
|
|||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "IPC.h"
|
#include "IPC.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef IPC_H
|
#ifndef IPC_H
|
||||||
#define IPC_H
|
#define IPC_H
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
Submodule framelesshelper updated: 675a1f7d6e...20e12e5ec0
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(fluentuiplugin LANGUAGES CXX)
|
project(fluentuiplugin LANGUAGES CXX)
|
||||||
|
|
||||||
@ -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,1,0)
|
add_definitions(-DVERSION=1,3,2,1)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools)
|
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools)
|
||||||
|
|
||||||
@ -72,4 +72,9 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
#如果是debug,则生成的库文件名后面拼接d
|
#如果是debug,则生成的库文件名后面拼接d
|
||||||
set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d")
|
# 在MinGW和GCC/Clang中, 默认不会链接带`d`后缀的动态库
|
||||||
|
if(MSVC)
|
||||||
|
set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d")
|
||||||
|
endif(MSVC)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1 @@
|
|||||||
#include "Def.h"
|
#include "Def.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef DEF_H
|
#ifndef DEF_H
|
||||||
#define DEF_H
|
#define DEF_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "FluApp.h"
|
#include "FluApp.h"
|
||||||
|
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
@ -23,11 +23,9 @@ FluApp *FluApp::getInstance()
|
|||||||
FluApp::FluApp(QObject *parent)
|
FluApp::FluApp(QObject *parent)
|
||||||
: QObject{parent}
|
: QObject{parent}
|
||||||
{
|
{
|
||||||
QFontDatabase::addApplicationFont(":/FluentUI/Font/Segoe_Fluent_Icons.ttf");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluApp::~FluApp(){
|
FluApp::~FluApp(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluApp::init(QQuickWindow *window){
|
void FluApp::init(QQuickWindow *window){
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUAPP_H
|
#ifndef FLUAPP_H
|
||||||
#define FLUAPP_H
|
#define FLUAPP_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUCOLORSET_H
|
#ifndef FLUCOLORSET_H
|
||||||
#define FLUCOLORSET_H
|
#define FLUCOLORSET_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "FluColors.h"
|
#include "FluColors.h"
|
||||||
|
|
||||||
FluColors* FluColors::m_instance = nullptr;
|
FluColors* FluColors::m_instance = nullptr;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUCOLORS_H
|
#ifndef FLUCOLORS_H
|
||||||
#define FLUCOLORS_H
|
#define FLUCOLORS_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "FluRegister.h"
|
#include "FluRegister.h"
|
||||||
|
|
||||||
#include "FluApp.h"
|
#include "FluApp.h"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUREGISTER_H
|
#ifndef FLUREGISTER_H
|
||||||
#define FLUREGISTER_H
|
#define FLUREGISTER_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "FluTextStyle.h"
|
#include "FluTextStyle.h"
|
||||||
|
|
||||||
FluTextStyle::FluTextStyle(QObject *parent)
|
FluTextStyle::FluTextStyle(QObject *parent)
|
||||||
: QObject{parent}
|
: QObject{parent}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUTEXTSTYLE_H
|
#ifndef FLUTEXTSTYLE_H
|
||||||
#define FLUTEXTSTYLE_H
|
#define FLUTEXTSTYLE_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -2,9 +2,15 @@
|
|||||||
|
|
||||||
#include "Def.h"
|
#include "Def.h"
|
||||||
#include "FluColors.h"
|
#include "FluColors.h"
|
||||||
#include <QPalette>
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||||
|
#include <QStyleHints>
|
||||||
|
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
|
||||||
#include <QtGui/qpa/qplatformtheme.h>
|
#include <QtGui/qpa/qplatformtheme.h>
|
||||||
#include <QtGui/private/qguiapplication_p.h>
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
#else
|
||||||
|
#include <QPalette>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
FluTheme* FluTheme::m_instance = nullptr;
|
FluTheme* FluTheme::m_instance = nullptr;
|
||||||
@ -45,10 +51,18 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
|
|||||||
|
|
||||||
bool FluTheme::systemDark()
|
bool FluTheme::systemDark()
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||||
|
return (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
|
||||||
|
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
|
||||||
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
||||||
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
#else
|
||||||
|
QPalette palette = qApp->palette();
|
||||||
|
QColor color = palette.color(QPalette::Window).rgb();
|
||||||
|
return !(color.red() * 0.2126 + color.green() * 0.7152 + color.blue() * 0.0722 > 255 / 2);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FluTheme::dark(){
|
bool FluTheme::dark(){
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUTHEME_H
|
#ifndef FLUTHEME_H
|
||||||
#define FLUTHEME_H
|
#define FLUTHEME_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "FluTools.h"
|
#include "FluTools.h"
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
@ -63,4 +63,6 @@ bool FluTools::isWin(){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FluTools::setQuitOnLastWindowClosed(bool val){
|
||||||
|
qApp->setQuitOnLastWindowClosed(val);
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef FLUTOOLS_H
|
#ifndef FLUTOOLS_H
|
||||||
#define FLUTOOLS_H
|
#define FLUTOOLS_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -48,6 +48,8 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE bool isWin();
|
Q_INVOKABLE bool isWin();
|
||||||
|
|
||||||
|
Q_INVOKABLE void setQuitOnLastWindowClosed(bool val);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FLUTOOLS_H
|
#endif // FLUTOOLS_H
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "WindowHelper.h"
|
#include "WindowHelper.h"
|
||||||
|
|
||||||
#include "FluRegister.h"
|
#include "FluRegister.h"
|
||||||
#include "FluApp.h"
|
#include "FluApp.h"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef WINDOWHELPER_H
|
#ifndef WINDOWHELPER_H
|
||||||
#define WINDOWHELPER_H
|
#define WINDOWHELPER_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -37,4 +37,4 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x409, 1200
|
VALUE "Translation", 0x409, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import "Content"
|
import "Content"
|
||||||
@ -21,7 +21,6 @@ Rectangle {
|
|||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: picker
|
id: picker
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
Grid {
|
Grid {
|
||||||
id: root
|
id: root
|
||||||
property int cellSide: 5
|
property int cellSide: 5
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property int cursorHeight: 7
|
property int cursorHeight: 7
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
property alias caption: captionBox.text
|
property alias caption: captionBox.text
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width : 40; height : 15; radius: 2
|
width : 40; height : 15; radius: 2
|
||||||
@ -14,5 +14,3 @@ Rectangle {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@ -67,8 +67,8 @@ Rectangle{
|
|||||||
color:root.textColor
|
color:root.textColor
|
||||||
}
|
}
|
||||||
FluToggleSwitch{
|
FluToggleSwitch{
|
||||||
selected: FluTheme.dark
|
checked: FluTheme.dark
|
||||||
clickFunc:function(){
|
clickListener: function(){
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
FluTheme.darkMode = FluDarkMode.Light
|
FluTheme.darkMode = FluDarkMode.Light
|
||||||
}else{
|
}else{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
@ -6,6 +6,7 @@ FluTextBox{
|
|||||||
property var items:[]
|
property var items:[]
|
||||||
property string emptyText: "没有找到结果"
|
property string emptyText: "没有找到结果"
|
||||||
property int autoSuggestBoxReplacement: FluentIcons.Search
|
property int autoSuggestBoxReplacement: FluentIcons.Search
|
||||||
|
property var window : Window.window
|
||||||
signal itemClicked(var data)
|
signal itemClicked(var data)
|
||||||
signal handleClicked
|
signal handleClicked
|
||||||
id:control
|
id:control
|
||||||
@ -22,17 +23,11 @@ FluTextBox{
|
|||||||
y:control.height
|
y:control.height
|
||||||
focus: false
|
focus: false
|
||||||
enter: Transition {
|
enter: Transition {
|
||||||
NumberAnimation {
|
|
||||||
property: "y"
|
|
||||||
from:0
|
|
||||||
to:control_popup.y
|
|
||||||
duration: 150
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
from:0
|
from:0
|
||||||
to:1
|
to:1
|
||||||
duration: 150
|
duration: 83
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
@ -41,6 +36,7 @@ FluTextBox{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
id:container
|
||||||
width: control.width
|
width: control.width
|
||||||
radius: 4
|
radius: 4
|
||||||
FluShadow{
|
FluShadow{
|
||||||
@ -118,6 +114,14 @@ FluTextBox{
|
|||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
loadData()
|
loadData()
|
||||||
if(d.flagVisible){
|
if(d.flagVisible){
|
||||||
|
var pos = control.mapToItem(null, 0, 0)
|
||||||
|
if(window.height>pos.y+control.height+container.height){
|
||||||
|
control_popup.y = control.height
|
||||||
|
} else if(pos.y>container.height){
|
||||||
|
control_popup.y = -container.height
|
||||||
|
} else {
|
||||||
|
popup.y = window.height-(pos.y+container.height)
|
||||||
|
}
|
||||||
control_popup.visible = true
|
control_popup.visible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user