mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-01 15:42:20 +08:00
Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
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:
|
||||
matrix:
|
||||
os: [macos-12]
|
||||
qt_ver: [6.4.3]
|
||||
qt_ver: [6.5.0]
|
||||
qt_arch: [clang_64]
|
||||
env:
|
||||
targetName: example
|
||||
@ -50,7 +50,7 @@ jobs:
|
||||
cmake --version
|
||||
mkdir 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
|
||||
|
||||
- name: package
|
||||
|
6
.github/workflows/ubuntu.yml
vendored
6
.github/workflows/ubuntu.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
qt_ver: [6.4.3]
|
||||
qt_ver: [6.5.0]
|
||||
qt_arch: [gcc_64]
|
||||
env:
|
||||
targetName: example
|
||||
@ -47,7 +47,7 @@ jobs:
|
||||
version: 1.10.2
|
||||
|
||||
- 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
|
||||
run: |
|
||||
@ -55,7 +55,7 @@ jobs:
|
||||
cmake --version
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.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
|
||||
|
||||
- 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:
|
||||
include:
|
||||
- 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_mingw_install: mingw900_64
|
||||
env:
|
||||
@ -62,7 +62,7 @@ jobs:
|
||||
run: |
|
||||
mkdir 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
|
||||
|
||||
- name: package
|
||||
|
6
.github/workflows/windows.yml
vendored
6
.github/workflows/windows.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
matrix:
|
||||
os: [windows-2019]
|
||||
include:
|
||||
- qt_ver: 6.4.3
|
||||
- qt_ver: 6.5.0
|
||||
qt_arch: win64_msvc2019_64
|
||||
msvc_arch: x64
|
||||
qt_arch_install: msvc2019_64
|
||||
@ -42,7 +42,7 @@ jobs:
|
||||
version: ${{ matrix.qt_ver }}
|
||||
arch: ${{ matrix.qt_arch }}
|
||||
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats qtspeech'
|
||||
|
||||
- name: msvc-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 }}
|
||||
mkdir 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
|
||||
echo winSdkDir=%WindowsSdkDir% >> %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)
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
QML FluentUI
|
||||
</h1>
|
||||
<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>
|
||||
|
||||
![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 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
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(example VERSION 0.1 LANGUAGES CXX)
|
||||
|
||||
@ -20,7 +20,7 @@ endif()
|
||||
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||
|
||||
#设置版本号
|
||||
add_definitions(-DVERSION=1,3,1,0)
|
||||
add_definitions(-DVERSION=1,3,2,0)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
||||
|
||||
|
@ -39,4 +39,4 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
END
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
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.Window
|
||||
import QtQuick.Controls
|
||||
@ -6,17 +6,19 @@ import FluentUI
|
||||
|
||||
FluExpander{
|
||||
|
||||
id:control
|
||||
property string code: ""
|
||||
|
||||
headerText: "Source"
|
||||
contentHeight:content.height
|
||||
focus: false
|
||||
|
||||
FluMultilineTextBox{
|
||||
id:content
|
||||
width:parent.width
|
||||
readOnly:true
|
||||
activeFocusOnTab: false
|
||||
activeFocusOnPress: false
|
||||
readOnly: true
|
||||
text:highlightQmlCode(code)
|
||||
focus:false
|
||||
textFormat: FluMultilineTextBox.RichText
|
||||
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||
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)
|
||||
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
|
||||
Behavior on color{
|
||||
ColorAnimation {
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +42,11 @@ FluExpander{
|
||||
rightMargin: 5
|
||||
topMargin: 5
|
||||
}
|
||||
onActiveFocusChanged: {
|
||||
if(activeFocus){
|
||||
control.expand = true
|
||||
}
|
||||
}
|
||||
onClicked:{
|
||||
FluTools.clipText(content.text)
|
||||
showSuccess("复制成功")
|
||||
@ -42,91 +54,91 @@ FluExpander{
|
||||
}
|
||||
|
||||
function htmlEncode(e){
|
||||
var i,s;
|
||||
for(i in s={
|
||||
"&":/&/g,//""//":/"/g,"'":/'/g,
|
||||
"<":/</g,">":/>/g,"<br/>":/\n/g,
|
||||
" ":/ /g," ":/\t/g
|
||||
})e=e.replace(s[i],i);
|
||||
return e;
|
||||
var i,s;
|
||||
for(i in s={
|
||||
"&":/&/g,//""//":/"/g,"'":/'/g,
|
||||
"<":/</g,">":/>/g,"<br/>":/\n/g,
|
||||
" ":/ /g," ":/\t/g
|
||||
})e=e.replace(s[i],i);
|
||||
return e;
|
||||
}
|
||||
|
||||
function highlightQmlCode(code) {
|
||||
// 定义 QML 关键字列表
|
||||
var qmlKeywords = [
|
||||
"FluTextButton",
|
||||
"FluAppBar",
|
||||
"FluAutoSuggestBox",
|
||||
"FluBadge",
|
||||
"FluButton",
|
||||
"FluCalendarPicker",
|
||||
"FluCalendarView",
|
||||
"FluCarousel",
|
||||
"FluCheckBox",
|
||||
"FluColorPicker",
|
||||
"FluColorView",
|
||||
"FluComboBox",
|
||||
"FluContentDialog",
|
||||
"FluContentPage",
|
||||
"FluDatePicker",
|
||||
"FluDivider",
|
||||
"FluDropDownButton",
|
||||
"FluExpander",
|
||||
"FluFilledButton",
|
||||
"FluFlipView",
|
||||
"FluFocusRectangle",
|
||||
"FluIcon",
|
||||
"FluIconButton",
|
||||
"FluInfoBar",
|
||||
"FluItem",
|
||||
"FluMediaPlayer",
|
||||
"FluMenu",
|
||||
"FluMenuItem",
|
||||
"FluMultilineTextBox",
|
||||
"FluNavigationView",
|
||||
"FluObject",
|
||||
"FluPaneItem",
|
||||
"FluPaneItemExpander",
|
||||
"FluPaneItemHeader",
|
||||
"FluPaneItemSeparator",
|
||||
"FluPivot",
|
||||
"FluPivotItem",
|
||||
"FluProgressBar",
|
||||
"FluProgressRing",
|
||||
"FluRadioButton",
|
||||
"FluRectangle",
|
||||
"FluScrollablePage",
|
||||
"FluScrollBar",
|
||||
"FluShadow",
|
||||
"FluSlider",
|
||||
"FluTabView",
|
||||
"FluText",
|
||||
"FluTextArea",
|
||||
"FluTextBox",
|
||||
"FluTextBoxBackground",
|
||||
"FluTextBoxMenu",
|
||||
"FluTextButton",
|
||||
"FluTextFiled",
|
||||
"FluTimePicker",
|
||||
"FluToggleSwitch",
|
||||
"FluTooltip",
|
||||
"FluTreeView",
|
||||
"FluWindow",
|
||||
"FluWindowResize",
|
||||
"FluToggleButton",
|
||||
"FluTableView",
|
||||
"FluColors",
|
||||
"FluTheme",
|
||||
"FluStatusView",
|
||||
"FluRatingControl",
|
||||
"FluPasswordBox",
|
||||
"FluBreadcrumbBar",
|
||||
"FluCopyableText",
|
||||
"FluAcrylic"
|
||||
];
|
||||
code = code.replace(/\n/g, "<br>");
|
||||
code = code.replace(/ /g, " ");
|
||||
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
|
||||
// 定义 QML 关键字列表
|
||||
var qmlKeywords = [
|
||||
"FluTextButton",
|
||||
"FluAppBar",
|
||||
"FluAutoSuggestBox",
|
||||
"FluBadge",
|
||||
"FluButton",
|
||||
"FluCalendarPicker",
|
||||
"FluCalendarView",
|
||||
"FluCarousel",
|
||||
"FluCheckBox",
|
||||
"FluColorPicker",
|
||||
"FluColorView",
|
||||
"FluComboBox",
|
||||
"FluContentDialog",
|
||||
"FluContentPage",
|
||||
"FluDatePicker",
|
||||
"FluDivider",
|
||||
"FluDropDownButton",
|
||||
"FluExpander",
|
||||
"FluFilledButton",
|
||||
"FluFlipView",
|
||||
"FluFocusRectangle",
|
||||
"FluIcon",
|
||||
"FluIconButton",
|
||||
"FluInfoBar",
|
||||
"FluItem",
|
||||
"FluMediaPlayer",
|
||||
"FluMenu",
|
||||
"FluMenuItem",
|
||||
"FluMultilineTextBox",
|
||||
"FluNavigationView",
|
||||
"FluObject",
|
||||
"FluPaneItem",
|
||||
"FluPaneItemExpander",
|
||||
"FluPaneItemHeader",
|
||||
"FluPaneItemSeparator",
|
||||
"FluPivot",
|
||||
"FluPivotItem",
|
||||
"FluProgressBar",
|
||||
"FluProgressRing",
|
||||
"FluRadioButton",
|
||||
"FluRectangle",
|
||||
"FluScrollablePage",
|
||||
"FluScrollBar",
|
||||
"FluShadow",
|
||||
"FluSlider",
|
||||
"FluTabView",
|
||||
"FluText",
|
||||
"FluTextArea",
|
||||
"FluTextBox",
|
||||
"FluTextBoxBackground",
|
||||
"FluTextBoxMenu",
|
||||
"FluTextButton",
|
||||
"FluTextFiled",
|
||||
"FluTimePicker",
|
||||
"FluToggleSwitch",
|
||||
"FluTooltip",
|
||||
"FluTreeView",
|
||||
"FluWindow",
|
||||
"FluWindowResize",
|
||||
"FluToggleButton",
|
||||
"FluTableView",
|
||||
"FluColors",
|
||||
"FluTheme",
|
||||
"FluStatusView",
|
||||
"FluRatingControl",
|
||||
"FluPasswordBox",
|
||||
"FluBreadcrumbBar",
|
||||
"FluCopyableText",
|
||||
"FluAcrylic"
|
||||
];
|
||||
code = code.replace(/\n/g, "<br>");
|
||||
code = code.replace(/ /g, " ");
|
||||
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
import org.wangwenx190.FramelessHelper
|
||||
@ -12,10 +12,6 @@ FluWindow {
|
||||
property bool appBarVisible: true
|
||||
default property alias content: container.data
|
||||
|
||||
Component.onCompleted: {
|
||||
console.debug(FramelessUtils.frameBorderVisible)
|
||||
}
|
||||
|
||||
FluAppBar {
|
||||
id: title_bar
|
||||
title: window.title
|
||||
@ -49,9 +45,20 @@ FluWindow {
|
||||
setHitTestVisible(title_bar.closeButton())
|
||||
framless_helper.setWindowFixedSize(fixSize)
|
||||
title_bar.maximizeButton.visible = !fixSize
|
||||
if (blurBehindWindowEnabled)
|
||||
window.backgroundVisible = false
|
||||
window.visible = true
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
target: FluTheme
|
||||
function onDarkChanged(){
|
||||
if (FluTheme.dark)
|
||||
FramelessUtils.systemTheme = FramelessHelperConstants.Dark
|
||||
else
|
||||
FramelessUtils.systemTheme = FramelessHelperConstants.Light
|
||||
}
|
||||
}
|
||||
|
||||
function setHitTestVisible(com){
|
||||
framless_helper.setHitTestVisible(com)
|
||||
|
@ -1,4 +1,4 @@
|
||||
pragma Singleton
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
pragma Singleton
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import FluentUI
|
||||
@ -166,6 +166,12 @@ FluObject{
|
||||
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
|
||||
}
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"ComboBox"
|
||||
onTap:{
|
||||
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
|
||||
}
|
||||
}
|
||||
FluPaneItem{
|
||||
title:"Tooltip"
|
||||
onTap:{
|
||||
|
@ -1,4 +1,4 @@
|
||||
pragma Singleton
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -22,7 +22,7 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
|
||||
FluTextButton{
|
||||
disabled:text_button_switch.selected
|
||||
disabled:text_button_switch.checked
|
||||
text:"Text Button"
|
||||
onClicked: {
|
||||
showInfo("点击Text Button")
|
||||
@ -32,18 +32,13 @@ FluScrollablePage{
|
||||
left: parent.left
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:text_button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:text_button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -64,7 +59,7 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
|
||||
FluButton{
|
||||
disabled:button_switch.selected
|
||||
disabled:button_switch.checked
|
||||
text:"Standard Button"
|
||||
onClicked: {
|
||||
showInfo("点击StandardButton")
|
||||
@ -74,18 +69,13 @@ FluScrollablePage{
|
||||
left: parent.left
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -106,7 +96,7 @@ FluScrollablePage{
|
||||
paddings: 10
|
||||
|
||||
FluFilledButton{
|
||||
disabled:filled_button_switch.selected
|
||||
disabled:filled_button_switch.checked
|
||||
text:"Filled Button"
|
||||
onClicked: {
|
||||
showWarning("点击FilledButton"+height)
|
||||
@ -116,18 +106,13 @@ FluScrollablePage{
|
||||
left: parent.left
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:filled_button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:filled_button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -148,28 +133,20 @@ FluScrollablePage{
|
||||
paddings: 10
|
||||
|
||||
FluToggleButton{
|
||||
disabled:toggle_button_switch.selected
|
||||
disabled:toggle_button_switch.checked
|
||||
text:"Toggle Button"
|
||||
onClicked: {
|
||||
selected = !selected
|
||||
}
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:toggle_button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:toggle_button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -178,7 +155,7 @@ FluScrollablePage{
|
||||
code:'FluToggleButton{
|
||||
text:"Toggle Button"
|
||||
onClicked: {
|
||||
selected = !selected
|
||||
checked = !checked
|
||||
}
|
||||
}'
|
||||
}
|
||||
@ -191,7 +168,7 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
FluIconButton{
|
||||
iconSource:FluentIcons.ChromeCloseContrast
|
||||
disabled:icon_button_switch.selected
|
||||
disabled:icon_button_switch.checked
|
||||
iconSize: 15
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -201,18 +178,13 @@ FluScrollablePage{
|
||||
showSuccess("点击IconButton")
|
||||
}
|
||||
}
|
||||
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:icon_button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:icon_button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -232,7 +204,7 @@ FluScrollablePage{
|
||||
paddings: 10
|
||||
Layout.topMargin: 20
|
||||
FluDropDownButton{
|
||||
disabled:drop_down_button_switch.selected
|
||||
disabled:drop_down_button_switch.checked
|
||||
text:"DropDownButton"
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -253,17 +225,13 @@ FluScrollablePage{
|
||||
}
|
||||
]
|
||||
}
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:drop_down_button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:drop_down_button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
@ -304,35 +272,29 @@ FluScrollablePage{
|
||||
property int selecIndex : 0
|
||||
model: 3
|
||||
delegate: FluRadioButton{
|
||||
selected : repeater.selecIndex===index
|
||||
disabled:radio_button_switch.selected
|
||||
checked : repeater.selecIndex===index
|
||||
disabled:radio_button_switch.checked
|
||||
text:"Radio Button_"+index
|
||||
onClicked:{
|
||||
clickListener:function(){
|
||||
repeater.selecIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Row{
|
||||
spacing: 5
|
||||
FluToggleSwitch{
|
||||
id:radio_button_switch
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:radio_button_switch
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text:"Disabled"
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -1
|
||||
code:'FluRadioButton{
|
||||
selected:true
|
||||
checked:true
|
||||
text:"Text Button"
|
||||
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.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -18,11 +18,21 @@ FluScrollablePage{
|
||||
spacing: 30
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluCheckBox{
|
||||
disabled: check_box_switch.checked
|
||||
}
|
||||
FluCheckBox{
|
||||
disabled: check_box_switch.checked
|
||||
text:"Text"
|
||||
}
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:check_box_switch
|
||||
anchors{
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
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.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
@ -40,9 +40,9 @@ FluScrollablePage{
|
||||
property int selecIndex : 0
|
||||
model: 3
|
||||
delegate: FluRadioButton{
|
||||
selected : repeater.selecIndex===index
|
||||
checked : repeater.selecIndex===index
|
||||
text:"Radio Button_"+index
|
||||
onClicked:{
|
||||
clickListener:function() {
|
||||
repeater.selecIndex = index
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -75,10 +75,10 @@ FluScrollablePage{
|
||||
FluAcrylic {
|
||||
sourceItem:bg
|
||||
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
|
||||
rectY: list.y+10
|
||||
acrylicOpacity:0.5
|
||||
acrylicOpacity:0.8
|
||||
}
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -61,7 +61,7 @@ FluScrollablePage{
|
||||
FluMenuItem:{
|
||||
text:"修改"
|
||||
onClicked: {
|
||||
showInfo"修改")
|
||||
showInfo("修改")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -30,17 +30,14 @@ FluScrollablePage{
|
||||
Repeater{
|
||||
model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
|
||||
delegate: FluRadioButton{
|
||||
selected : FluTheme.darkMode === modelData.mode
|
||||
checked : FluTheme.darkMode === modelData.mode
|
||||
text:modelData.title
|
||||
onClicked:{
|
||||
clickListener:function(){
|
||||
FluTheme.darkMode = modelData.mode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FluArea{
|
||||
@ -63,10 +60,10 @@ FluScrollablePage{
|
||||
}
|
||||
Repeater{
|
||||
model: [{title:"Open",mode:FluNavigationView.Open},{title:"Compact",mode:FluNavigationView.Compact},{title:"Minimal",mode:FluNavigationView.Minimal},{title:"Auto",mode:FluNavigationView.Auto}]
|
||||
delegate: FluRadioButton{
|
||||
selected : MainEvent.displayMode===modelData.mode
|
||||
delegate: FluRadioButton{
|
||||
checked : MainEvent.displayMode===modelData.mode
|
||||
text:modelData.title
|
||||
onClicked:{
|
||||
clickListener:function(){
|
||||
MainEvent.displayMode = modelData.mode
|
||||
}
|
||||
}
|
||||
@ -97,11 +94,10 @@ FluScrollablePage{
|
||||
spacing: 5
|
||||
Repeater{
|
||||
model: ["Zh","En"]
|
||||
delegate: FluRadioButton{
|
||||
selected : appInfo.lang.objectName === modelData
|
||||
delegate: FluRadioButton{
|
||||
checked: appInfo.lang.objectName === modelData
|
||||
text:modelData
|
||||
onClicked:{
|
||||
console.debug(modelData)
|
||||
clickListener:function(){
|
||||
appInfo.changeLang(modelData)
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
@ -19,7 +19,7 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
placeholderText: "单行输入框"
|
||||
Layout.preferredWidth: 300
|
||||
disabled:text_box_switch.selected
|
||||
disabled:text_box_switch.checked
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
@ -57,7 +57,7 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
placeholderText: "请输入密码"
|
||||
Layout.preferredWidth: 300
|
||||
disabled:password_box_switch.selected
|
||||
disabled:password_box_switch.checked
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
@ -97,7 +97,7 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
placeholderText: "多行输入框"
|
||||
Layout.preferredWidth: 300
|
||||
disabled:text_box_multi_switch.selected
|
||||
disabled:text_box_multi_switch.checked
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
@ -137,7 +137,7 @@ FluScrollablePage{
|
||||
placeholderText: "AutoSuggestBox"
|
||||
Layout.preferredWidth: 300
|
||||
items:generateRandomNames(100)
|
||||
disabled:text_box_suggest_switch.selected
|
||||
disabled:text_box_suggest_switch.checked
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -52,8 +52,8 @@ FluScrollablePage{
|
||||
}
|
||||
FluToggleSwitch{
|
||||
Layout.topMargin: 5
|
||||
selected: FluTheme.dark
|
||||
clickFunc:function(){
|
||||
checked: FluTheme.dark
|
||||
onClicked: {
|
||||
if(FluTheme.dark){
|
||||
FluTheme.darkMode = FluDarkMode.Light
|
||||
}else{
|
||||
@ -67,8 +67,8 @@ FluScrollablePage{
|
||||
}
|
||||
FluToggleSwitch{
|
||||
Layout.topMargin: 5
|
||||
selected: FluTheme.nativeText
|
||||
clickFunc:function(){
|
||||
checked: FluTheme.nativeText
|
||||
onClicked: {
|
||||
FluTheme.nativeText = !FluTheme.nativeText
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
@ -18,11 +18,20 @@ FluScrollablePage{
|
||||
spacing: 30
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluToggleSwitch{
|
||||
disabled: toggle_switch.checked
|
||||
}
|
||||
FluToggleSwitch{
|
||||
text:"Text"
|
||||
disabled: toggle_switch.checked
|
||||
}
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:toggle_switch
|
||||
anchors{
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
text:"Disabled"
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
@ -64,11 +64,12 @@ CustomWindow {
|
||||
negativeText:"最小化"
|
||||
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||
onNegativeClicked:{
|
||||
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
|
||||
window.hide()
|
||||
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
|
||||
}
|
||||
positiveText:"退出"
|
||||
neutralText:"取消"
|
||||
blurSource: nav_view
|
||||
onPositiveClicked:{
|
||||
window.deleteWindow()
|
||||
FluApp.closeApp()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
@ -1,7 +1,9 @@
|
||||
#include "AppInfo.h"
|
||||
#include "AppInfo.h"
|
||||
|
||||
#include <QQmlContext>
|
||||
#include <QDebug>
|
||||
#include "lang/En.h"
|
||||
#include "lang/Zh.h"
|
||||
#include <QDebug>
|
||||
|
||||
#define STR(x) #x
|
||||
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
|
||||
@ -15,6 +17,16 @@ AppInfo::AppInfo(QObject *parent)
|
||||
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){
|
||||
if(_lang){
|
||||
_lang->deleteLater();
|
||||
@ -26,5 +38,19 @@ void AppInfo::changeLang(const QString& locale){
|
||||
}else {
|
||||
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
|
||||
|
||||
#include <QObject>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include "tool/IPC.h"
|
||||
#include "lang/Lang.h"
|
||||
#include "stdafx.h"
|
||||
|
||||
@ -12,6 +14,8 @@ class AppInfo : public QObject
|
||||
Q_PROPERTY_AUTO(Lang*,lang)
|
||||
public:
|
||||
explicit AppInfo(QObject *parent = nullptr);
|
||||
void init(QQmlApplicationEngine *engine);
|
||||
bool isOwnerProcess(IPC *ipc);
|
||||
Q_INVOKABLE void changeLang(const QString& locale);
|
||||
Q_SIGNAL void activeWindow();
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "En.h"
|
||||
#include "En.h"
|
||||
|
||||
En::En(QObject *parent)
|
||||
: Lang{parent}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef EN_H
|
||||
#ifndef EN_H
|
||||
#define EN_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef LANG_H
|
||||
#ifndef LANG_H
|
||||
#define LANG_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "Zh.h"
|
||||
#include "Zh.h"
|
||||
|
||||
Zh::Zh(QObject *parent)
|
||||
: Lang{parent}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef ZH_H
|
||||
#ifndef ZH_H
|
||||
#define ZH_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QDir>
|
||||
@ -6,13 +6,11 @@
|
||||
#include <QProcess>
|
||||
#include <FramelessHelper/Quick/framelessquickmodule.h>
|
||||
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
||||
#include "lang/Lang.h"
|
||||
#include "AppInfo.h"
|
||||
#include "tool/IPC.h"
|
||||
|
||||
FRAMELESSHELPER_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//将样式设置为Basic,不然会导致组件显示异常
|
||||
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
||||
@ -21,33 +19,26 @@ FRAMELESSHELPER_USE_NAMESPACE
|
||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||
QGuiApplication::setApplicationName("FluentUI");
|
||||
QGuiApplication app(argc, argv);
|
||||
#ifdef Q_OS_WIN // 此设置仅在Windows下生效
|
||||
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();
|
||||
IPC ipc(0);
|
||||
QString activeWindowEvent = "activeWindow";
|
||||
if(!ipc.isCurrentOwner()){
|
||||
ipc.postEvent(activeWindowEvent,QString().toUtf8(),0);
|
||||
delete appInfo;
|
||||
if(!appInfo->isOwnerProcess(&ipc)){
|
||||
return 0;
|
||||
}
|
||||
if(ipc.isAttached()){
|
||||
ipc.registerEventHandler(activeWindowEvent,[&appInfo](const QByteArray&){
|
||||
Q_EMIT appInfo->activeWindow();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
QQmlApplicationEngine engine;
|
||||
FramelessHelper::Quick::registerTypes(&engine);
|
||||
QQmlContext * context = engine.rootContext();
|
||||
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);
|
||||
appInfo->init(&engine);
|
||||
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
|
||||
// const QUrl url(QStringLiteral("qrc:/example/qml/TestWindow.qml"));
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
&app, [url](QObject *obj, const QUrl &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")
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "IPC.h"
|
||||
#include "IPC.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef IPC_H
|
||||
#ifndef IPC_H
|
||||
#define IPC_H
|
||||
|
||||
#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)
|
||||
|
||||
@ -13,7 +13,7 @@ endif()
|
||||
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
|
||||
|
||||
#设置版本号
|
||||
add_definitions(-DVERSION=1,3,1,0)
|
||||
add_definitions(-DVERSION=1,3,2,0)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools)
|
||||
|
||||
@ -72,4 +72,9 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
#如果是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 @@
|
||||
#include "FluApp.h"
|
||||
#include "FluApp.h"
|
||||
|
||||
#include <QQmlEngine>
|
||||
#include <QGuiApplication>
|
||||
@ -23,11 +23,9 @@ FluApp *FluApp::getInstance()
|
||||
FluApp::FluApp(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
QFontDatabase::addApplicationFont(":/FluentUI/Font/Segoe_Fluent_Icons.ttf");
|
||||
}
|
||||
|
||||
FluApp::~FluApp(){
|
||||
|
||||
}
|
||||
|
||||
void FluApp::init(QQuickWindow *window){
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUAPP_H
|
||||
#ifndef FLUAPP_H
|
||||
#define FLUAPP_H
|
||||
|
||||
#include <QObject>
|
||||
@ -27,6 +27,7 @@ class FluApp : public QObject
|
||||
*/
|
||||
Q_PROPERTY_AUTO(QJsonObject,routes);
|
||||
|
||||
QML_FOREIGN(FluApp)
|
||||
QML_NAMED_ELEMENT(FluApp)
|
||||
QML_SINGLETON
|
||||
private:
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUCOLORSET_H
|
||||
#ifndef FLUCOLORSET_H
|
||||
#define FLUCOLORSET_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FluColors.h"
|
||||
#include "FluColors.h"
|
||||
|
||||
FluColors* FluColors::m_instance = nullptr;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUCOLORS_H
|
||||
#ifndef FLUCOLORS_H
|
||||
#define FLUCOLORS_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FluRegister.h"
|
||||
#include "FluRegister.h"
|
||||
|
||||
#include "FluApp.h"
|
||||
#include <QCoreApplication>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUREGISTER_H
|
||||
#ifndef FLUREGISTER_H
|
||||
#define FLUREGISTER_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FluTextStyle.h"
|
||||
#include "FluTextStyle.h"
|
||||
|
||||
FluTextStyle::FluTextStyle(QObject *parent)
|
||||
: QObject{parent}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUTEXTSTYLE_H
|
||||
#ifndef FLUTEXTSTYLE_H
|
||||
#define FLUTEXTSTYLE_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -2,9 +2,15 @@
|
||||
|
||||
#include "Def.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/private/qguiapplication_p.h>
|
||||
#else
|
||||
#include <QPalette>
|
||||
#endif
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
||||
FluTheme* FluTheme::m_instance = nullptr;
|
||||
@ -45,10 +51,18 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
|
||||
|
||||
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()) {
|
||||
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
||||
}
|
||||
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(){
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUTHEME_H
|
||||
#ifndef FLUTHEME_H
|
||||
#define FLUTHEME_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FluTools.h"
|
||||
#include "FluTools.h"
|
||||
#include <QGuiApplication>
|
||||
#include <QClipboard>
|
||||
#include <QUuid>
|
||||
@ -63,4 +63,6 @@ bool FluTools::isWin(){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void FluTools::setQuitOnLastWindowClosed(bool val){
|
||||
qApp->setQuitOnLastWindowClosed(val);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef FLUTOOLS_H
|
||||
#ifndef FLUTOOLS_H
|
||||
#define FLUTOOLS_H
|
||||
|
||||
#include <QObject>
|
||||
@ -48,6 +48,8 @@ public:
|
||||
|
||||
Q_INVOKABLE bool isWin();
|
||||
|
||||
Q_INVOKABLE void setQuitOnLastWindowClosed(bool val);
|
||||
|
||||
};
|
||||
|
||||
#endif // FLUTOOLS_H
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "WindowHelper.h"
|
||||
#include "WindowHelper.h"
|
||||
|
||||
#include "FluRegister.h"
|
||||
#include "FluApp.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifndef WINDOWHELPER_H
|
||||
#ifndef WINDOWHELPER_H
|
||||
#define WINDOWHELPER_H
|
||||
|
||||
#include <QObject>
|
||||
|
@ -37,4 +37,4 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
END
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import "Content"
|
||||
@ -21,7 +21,6 @@ Rectangle {
|
||||
color: "#00000000"
|
||||
clip: true
|
||||
|
||||
|
||||
RowLayout {
|
||||
id: picker
|
||||
anchors.top: parent.top
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
Grid {
|
||||
id: root
|
||||
property int cellSide: 5
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
property int cursorHeight: 7
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
|
||||
Row {
|
||||
property alias caption: captionBox.text
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
|
||||
Rectangle {
|
||||
width : 40; height : 15; radius: 2
|
||||
@ -14,5 +14,3 @@ Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import FluentUI
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import QtQuick.Layouts
|
||||
@ -67,8 +67,8 @@ Rectangle{
|
||||
color:root.textColor
|
||||
}
|
||||
FluToggleSwitch{
|
||||
selected: FluTheme.dark
|
||||
clickFunc:function(){
|
||||
checked: FluTheme.dark
|
||||
clickListener: function(){
|
||||
if(FluTheme.dark){
|
||||
FluTheme.darkMode = FluDarkMode.Light
|
||||
}else{
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
@ -6,6 +6,7 @@ FluTextBox{
|
||||
property var items:[]
|
||||
property string emptyText: "没有找到结果"
|
||||
property int autoSuggestBoxReplacement: FluentIcons.Search
|
||||
property var window : Window.window
|
||||
signal itemClicked(var data)
|
||||
signal handleClicked
|
||||
id:control
|
||||
@ -22,17 +23,11 @@ FluTextBox{
|
||||
y:control.height
|
||||
focus: false
|
||||
enter: Transition {
|
||||
NumberAnimation {
|
||||
property: "y"
|
||||
from:0
|
||||
to:control_popup.y
|
||||
duration: 150
|
||||
}
|
||||
NumberAnimation {
|
||||
property: "opacity"
|
||||
from:0
|
||||
to:1
|
||||
duration: 150
|
||||
duration: 83
|
||||
}
|
||||
}
|
||||
onVisibleChanged: {
|
||||
@ -41,6 +36,7 @@ FluTextBox{
|
||||
}
|
||||
}
|
||||
background: Rectangle{
|
||||
id:container
|
||||
width: control.width
|
||||
radius: 4
|
||||
FluShadow{
|
||||
@ -118,6 +114,14 @@ FluTextBox{
|
||||
onTextChanged: {
|
||||
loadData()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
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