Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
4efb91084a | |||
103dbe9d56 | |||
b829fa572f | |||
d2c5cc779b | |||
5acf664492 | |||
75d226947f | |||
752ff3c4f2 | |||
e591c483d5 | |||
fdff068752 | |||
24f28d8945 | |||
ed51143e9b | |||
9d94bc65d5 | |||
7bfa9f0191 | |||
6db144c751 |
@ -2,9 +2,21 @@ cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(FluentUI VERSION 0.1 LANGUAGES CXX)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(example)
|
||||
option(FLUENTUI_BUILD_EXAMPLES "Build FluentUI demo applications." ON)
|
||||
option(FLUENTUI_BUILD_FRAMELESSHEPLER "Build FramelessHelper." ON)
|
||||
|
||||
add_definitions(-DFRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT)
|
||||
add_definitions(-DFRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT)
|
||||
add_subdirectory(framelesshelper)
|
||||
add_subdirectory(src)
|
||||
|
||||
if (FLUENTUI_BUILD_EXAMPLES)
|
||||
add_subdirectory(example)
|
||||
endif ()
|
||||
|
||||
if (FLUENTUI_BUILD_FRAMELESSHEPLER)
|
||||
add_definitions(-DFRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT)
|
||||
add_definitions(-DFRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT)
|
||||
add_subdirectory(framelesshelper)
|
||||
endif ()
|
||||
|
||||
message("------------------------ FluentUI ------------------------")
|
||||
message("Build FluentUI demo applications.: ${FLUENTUI_BUILD_EXAMPLES}")
|
||||
message("Build FramelessHelper.: ${FLUENTUI_BUILD_FRAMELESSHEPLER}")
|
||||
|
@ -115,5 +115,9 @@ View more [`here`](doc/md/all_components.md)!
|
||||
|
||||
This FluentUI library currently licensed under [MIT License](./License)
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#zhuzichu520/FluentUI&Date)
|
||||
|
||||
## ⚡ Visitor count
|
||||

|
||||
|
@ -20,9 +20,10 @@ endif()
|
||||
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||
|
||||
#设置版本号
|
||||
add_definitions(-DVERSION=1,3,4,0)
|
||||
add_definitions(-DVERSION=1,3,5,1)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
||||
find_package(Qt6 REQUIRED COMPONENTS Quick)
|
||||
qt_standard_project_setup()
|
||||
|
||||
#遍历所有Cpp文件
|
||||
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
|
||||
@ -101,4 +102,13 @@ target_link_libraries(example PRIVATE
|
||||
#安装
|
||||
install(TARGETS example
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
qt_generate_deploy_app_script(
|
||||
TARGET example
|
||||
OUTPUT_SCRIPT deploy_script
|
||||
NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
)
|
||||
install(SCRIPT ${deploy_script})
|
||||
|
@ -130,7 +130,8 @@ FluExpander{
|
||||
"FluBreadcrumbBar",
|
||||
"FluCopyableText",
|
||||
"FluAcrylic",
|
||||
"FluRemoteLoader"
|
||||
"FluRemoteLoader",
|
||||
"FluMenuBar"
|
||||
];
|
||||
code = code.replace(/\n/g, "<br>");
|
||||
code = code.replace(/ /g, " ");
|
||||
|
@ -210,20 +210,18 @@ FluScrollablePage{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
items:[
|
||||
FluMenuItem{
|
||||
text:"Menu_1"
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Menu_2"
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Menu_3"
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Menu_4"
|
||||
}
|
||||
]
|
||||
FluMenuItem{
|
||||
text:"Menu_1"
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Menu_2"
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Menu_3"
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Menu_4"
|
||||
}
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id:drop_down_button_switch
|
||||
|
@ -9,6 +9,24 @@ FluScrollablePage{
|
||||
|
||||
title:"Menu"
|
||||
|
||||
FluMenu {
|
||||
id:menu
|
||||
title: qsTr("File")
|
||||
Action { text: qsTr("New...")}
|
||||
Action { text: qsTr("Open...") }
|
||||
Action { text: qsTr("Save") }
|
||||
FluMenuSeparator { }
|
||||
Action { text: qsTr("Quit") }
|
||||
FluMenuSeparator { }
|
||||
Action { text: qsTr("Check");checkable: true;checked: true}
|
||||
FluMenu{
|
||||
title: "Save As..."
|
||||
Action { text: qsTr("Doc") }
|
||||
Action { text: qsTr("PDF") }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
height: 100
|
||||
@ -22,28 +40,19 @@ FluScrollablePage{
|
||||
left:parent.left
|
||||
}
|
||||
|
||||
FluText{
|
||||
text:"Menu"
|
||||
}
|
||||
|
||||
FluButton{
|
||||
text:"左击菜单"
|
||||
text:"Show Menu Popup"
|
||||
Layout.topMargin: 20
|
||||
onClicked:{
|
||||
menu.popup()
|
||||
}
|
||||
}
|
||||
|
||||
FluButton{
|
||||
text:"右击菜单"
|
||||
Layout.topMargin: 20
|
||||
onClicked: {
|
||||
showSuccess("请按鼠标右击")
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: {
|
||||
menu.popup()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,20 +78,74 @@ menu.popup()
|
||||
'
|
||||
}
|
||||
|
||||
FluMenu{
|
||||
id:menu
|
||||
FluMenuItem{
|
||||
text:"删除"
|
||||
onClicked: {
|
||||
showError("删除")
|
||||
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
height: 100
|
||||
paddings: 10
|
||||
Layout.topMargin: 20
|
||||
Column{
|
||||
spacing: 15
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left:parent.left
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"修改"
|
||||
onClicked: {
|
||||
showInfo("修改")
|
||||
|
||||
FluText{
|
||||
text:"MenuBar"
|
||||
}
|
||||
|
||||
FluMenuBar {
|
||||
id:menu_bar
|
||||
FluMenu {
|
||||
title: qsTr("File")
|
||||
Action { text: qsTr("New...") }
|
||||
Action { text: qsTr("Open...") }
|
||||
Action { text: qsTr("Save") }
|
||||
FluMenuSeparator { }
|
||||
Action { text: qsTr("Quit") }
|
||||
FluMenu{
|
||||
title: "Save As..."
|
||||
Action { text: qsTr("Doc") }
|
||||
Action { text: qsTr("PDF") }
|
||||
}
|
||||
}
|
||||
FluMenu {
|
||||
title: qsTr("Edit")
|
||||
Action { text: qsTr("Cut") }
|
||||
Action { text: qsTr("Copy") }
|
||||
Action { text: qsTr("Paste") }
|
||||
}
|
||||
FluMenu {
|
||||
title: qsTr("Help")
|
||||
Action { text: qsTr("About") }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -1
|
||||
code:'FluMenuBar{
|
||||
id:menu
|
||||
FluMenu:{
|
||||
title:"File"
|
||||
Action { text: qsTr("New...") }
|
||||
}
|
||||
FluMenu:{
|
||||
title:"Edit"
|
||||
Action { text: qsTr("Cut") }
|
||||
Action { text: qsTr("Copy") }
|
||||
Action { text: qsTr("Paste") }
|
||||
}
|
||||
}
|
||||
menu.popup()
|
||||
'
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -33,10 +33,13 @@ FluScrollablePage{
|
||||
indeterminate: false
|
||||
}
|
||||
FluSlider{
|
||||
value:50
|
||||
onValueChanged:{
|
||||
progress_bar.progress = value/100
|
||||
progress_ring.progress = value/100
|
||||
var progress = value/100
|
||||
progress_bar.progress = progress
|
||||
progress_ring.progress = progress
|
||||
}
|
||||
Component.onCompleted: {
|
||||
value = 50
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ FluScrollablePage{
|
||||
paddings: 10
|
||||
Layout.topMargin: 20
|
||||
FluSlider{
|
||||
value: 50
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
@ -34,10 +33,8 @@ FluScrollablePage{
|
||||
paddings: 10
|
||||
Layout.topMargin: 20
|
||||
FluSlider{
|
||||
value: 50
|
||||
vertical:true
|
||||
orientation: Qt.Vertical
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
@ -45,7 +42,7 @@ FluScrollablePage{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -1
|
||||
code:'FluSlider{
|
||||
vertical:true
|
||||
orientation: Qt.Vertical
|
||||
value:50
|
||||
}'
|
||||
}
|
||||
|
@ -21,36 +21,34 @@ FluScrollablePage{
|
||||
id:btn_status_mode
|
||||
Layout.preferredWidth: 140
|
||||
text:"Loading"
|
||||
items:[
|
||||
FluMenuItem{
|
||||
text:"Loading"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Loading
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Empty"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Empty
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Error"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Error
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Success"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Success
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Loading"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Loading
|
||||
}
|
||||
]
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Empty"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Empty
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Error"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Error
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Success"
|
||||
onClicked: {
|
||||
btn_status_mode.text = text
|
||||
status_view.statusMode = FluStatusView.Success
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,57 +40,53 @@ FluScrollablePage{
|
||||
id:btn_tab_width_behavior
|
||||
Layout.preferredWidth: 140
|
||||
text:"Equal"
|
||||
items:[
|
||||
FluMenuItem{
|
||||
text:"Equal"
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabView.Equal
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"SizeToContent"
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabView.SizeToContent
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Compact"
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabView.Compact
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Equal"
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabView.Equal
|
||||
}
|
||||
]
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"SizeToContent"
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabView.SizeToContent
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Compact"
|
||||
onClicked: {
|
||||
btn_tab_width_behavior.text = text
|
||||
tab_view.tabWidthBehavior = FluTabView.Compact
|
||||
}
|
||||
}
|
||||
}
|
||||
FluDropDownButton{
|
||||
id:btn_close_button_visibility
|
||||
text:"Always"
|
||||
Layout.preferredWidth: 120
|
||||
items:[
|
||||
FluMenuItem{
|
||||
text:"Nerver"
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabView.Nerver
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Always"
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabView.Always
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"OnHover"
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabView.OnHover
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Nerver"
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabView.Nerver
|
||||
}
|
||||
]
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Always"
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabView.Always
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"OnHover"
|
||||
onClicked: {
|
||||
btn_close_button_visibility.text = text
|
||||
tab_view.closeButtonVisibility = FluTabView.OnHover
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ FluScrollablePage{
|
||||
text:"删除"
|
||||
horizontalPadding: 6
|
||||
onClicked:{
|
||||
table_view.remove(dataModel.index)
|
||||
tableView.remove(dataModel.index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ FluContentPage{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
width:100,
|
||||
minimumWidth:50
|
||||
|
||||
},
|
||||
{
|
||||
@ -85,7 +86,8 @@ FluContentPage{
|
||||
dataIndex: 'age',
|
||||
editDelegate:com_combobox,
|
||||
width:100,
|
||||
minimumWidth:100
|
||||
minimumWidth:100,
|
||||
maximumWidth: 100
|
||||
},
|
||||
{
|
||||
title: '住址',
|
||||
@ -95,7 +97,8 @@ FluContentPage{
|
||||
{
|
||||
title: '别名',
|
||||
dataIndex: 'nickname',
|
||||
width:100
|
||||
width:100,
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -60,29 +60,27 @@ FluScrollablePage {
|
||||
id:btn_selection_model
|
||||
Layout.preferredWidth: 140
|
||||
text:"None"
|
||||
items:[
|
||||
FluMenuItem{
|
||||
text:"None"
|
||||
onClicked: {
|
||||
btn_selection_model.text = text
|
||||
tree_view.selectionMode = FluTabView.Equal
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Single"
|
||||
onClicked: {
|
||||
btn_selection_model.text = text
|
||||
tree_view.selectionMode = FluTabView.SizeToContent
|
||||
}
|
||||
},
|
||||
FluMenuItem{
|
||||
text:"Muiltple"
|
||||
onClicked: {
|
||||
btn_selection_model.text = text
|
||||
tree_view.selectionMode = FluTabView.Compact
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"None"
|
||||
onClicked: {
|
||||
btn_selection_model.text = text
|
||||
tree_view.selectionMode = FluTabView.Equal
|
||||
}
|
||||
]
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Single"
|
||||
onClicked: {
|
||||
btn_selection_model.text = text
|
||||
tree_view.selectionMode = FluTabView.SizeToContent
|
||||
}
|
||||
}
|
||||
FluMenuItem{
|
||||
text:"Muiltple"
|
||||
onClicked: {
|
||||
btn_selection_model.text = text
|
||||
tree_view.selectionMode = FluTabView.Compact
|
||||
}
|
||||
}
|
||||
}
|
||||
FluFilledButton{
|
||||
text:"获取选中的数据"
|
||||
|
@ -10,10 +10,6 @@ FluContentPage {
|
||||
title: "Typography"
|
||||
rightPadding: 10
|
||||
|
||||
Component.onCompleted: {
|
||||
slider.seek(0)
|
||||
}
|
||||
|
||||
FluArea{
|
||||
anchors{
|
||||
top:parent.top
|
||||
@ -73,7 +69,7 @@ FluContentPage {
|
||||
|
||||
FluSlider{
|
||||
id:slider
|
||||
vertical:true
|
||||
orientation: Qt.Vertical
|
||||
anchors{
|
||||
right: parent.right
|
||||
rightMargin: 45
|
||||
|
@ -135,7 +135,7 @@ CustomWindow {
|
||||
FluRemoteLoader{
|
||||
id:loader
|
||||
anchors.fill: parent
|
||||
// source: "http://localhost:9000/RemoteComponent.qml"
|
||||
// source: "http://localhost:9000/RemoteComponent.qml"
|
||||
source: "https://zhu-zichu.gitee.io/RemoteComponent.qml"
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,28 @@ CustomWindow {
|
||||
fixSize: true
|
||||
launchMode: FluWindow.Standard
|
||||
|
||||
FluMenuBar {
|
||||
FluMenu {
|
||||
title: qsTr("File")
|
||||
Action { text: qsTr("New...") }
|
||||
Action { text: qsTr("Open...") }
|
||||
Action { text: qsTr("Save") }
|
||||
Action { text: qsTr("Save As...") }
|
||||
FluMenuSeparator { }
|
||||
Action { text: qsTr("Quit") }
|
||||
}
|
||||
FluMenu {
|
||||
title: qsTr("Edit")
|
||||
Action { text: qsTr("Cut") }
|
||||
Action { text: qsTr("Copy") }
|
||||
Action { text: qsTr("Paste") }
|
||||
}
|
||||
FluMenu {
|
||||
title: qsTr("Help")
|
||||
Action { text: qsTr("About") }
|
||||
}
|
||||
}
|
||||
|
||||
FluText{
|
||||
anchors.centerIn: parent
|
||||
text:"我是一个Standard模式的窗口,每次我都会创建一个新的窗口"
|
||||
|
@ -13,9 +13,10 @@ endif()
|
||||
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
|
||||
|
||||
#设置版本号
|
||||
add_definitions(-DVERSION=1,3,4,0)
|
||||
add_definitions(-DVERSION=1,3,5,1)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml)
|
||||
qt_standard_project_setup()
|
||||
|
||||
#遍历所有Cpp文件
|
||||
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
|
||||
@ -32,7 +33,7 @@ foreach(filepath ${QML_PATHS})
|
||||
endforeach(filepath)
|
||||
|
||||
#遍历所有资源文件
|
||||
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp *.qsb *.metainfo)
|
||||
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp)
|
||||
foreach(filepath ${RES_PATHS})
|
||||
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||
list(APPEND resource_files ${filename})
|
||||
@ -57,26 +58,14 @@ qt_add_qml_module(fluentuiplugin
|
||||
SOURCES ${sources_files} fluentui.rc
|
||||
QML_FILES ${qml_files}
|
||||
RESOURCES ${resource_files}
|
||||
#支持designer
|
||||
DESIGNER_SUPPORTED
|
||||
)
|
||||
|
||||
#链接库
|
||||
target_link_libraries(fluentuiplugin PUBLIC
|
||||
Qt::CorePrivate
|
||||
Qt::QuickPrivate
|
||||
Qt::QmlPrivate
|
||||
Qt::Core
|
||||
Qt::Quick
|
||||
Qt::Qml
|
||||
)
|
||||
|
||||
#链接库 win32库 不然mingw会编译错误
|
||||
if(WIN32)
|
||||
target_link_libraries(fluentuiplugin PRIVATE dwmapi user32)
|
||||
endif()
|
||||
|
||||
#如果是debug,则生成的库文件名后面拼接d
|
||||
# 在MinGW和GCC/Clang中, 默认不会链接带`d`后缀的动态库
|
||||
if(MSVC)
|
||||
set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d")
|
||||
endif(MSVC)
|
||||
|
||||
|
||||
#安装
|
||||
install(DIRECTORY ${QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports)
|
||||
|
@ -43,6 +43,10 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist
|
||||
}
|
||||
QQmlEngine *engine = qmlEngine(appWindow);
|
||||
QQmlComponent component(engine, routes().value(route).toString());
|
||||
if (component.isError()) {
|
||||
qWarning() << component.errors();
|
||||
return;
|
||||
}
|
||||
QVariantMap properties;
|
||||
properties.insert("route",route);
|
||||
if(fluRegister){
|
||||
|
@ -8,7 +8,7 @@ FluTextStyle::FluTextStyle(QObject *parent)
|
||||
Caption(caption);
|
||||
|
||||
QFont body;
|
||||
body.setPixelSize(14);
|
||||
body.setPixelSize(13);
|
||||
Body(body);
|
||||
|
||||
QFont bodyStrong;
|
||||
|
@ -147,4 +147,8 @@ Rectangle{
|
||||
return btn_close
|
||||
}
|
||||
|
||||
function darkButton(){
|
||||
return btn_dark
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,5 +3,5 @@ import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Rectangle {
|
||||
color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
||||
color: FluTheme.dark ? Qt.rgba(60/255,60/255,60/255,1) : Qt.rgba(210/255,210/255,210/255,1)
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ Button {
|
||||
}
|
||||
}
|
||||
property var window : Window.window
|
||||
property alias items: menu.content
|
||||
default property alias contentData: menu.contentData
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: control.text
|
||||
Accessible.description: contentDescription
|
||||
@ -75,9 +75,9 @@ Button {
|
||||
color: control.textColor
|
||||
}
|
||||
onClicked: {
|
||||
if(items && menu.getContainerCount()!==0){
|
||||
if(items && menu.count !==0){
|
||||
var pos = control.mapToItem(null, 0, 0)
|
||||
var containerHeight = menu.getContainerHeight()
|
||||
var containerHeight = menu.height
|
||||
if(window.height>pos.y+control.height+containerHeight){
|
||||
menu.y = control.height
|
||||
}else if(pos.y>containerHeight){
|
||||
|
@ -1,23 +1,26 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
import FluentUI
|
||||
|
||||
Menu {
|
||||
default property alias content: container.data
|
||||
property bool enableAnimation: true
|
||||
id: popup
|
||||
width: 140
|
||||
height: container.height
|
||||
modal:true
|
||||
dim:false
|
||||
T.Menu {
|
||||
id: control
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
margins: 0
|
||||
overlap: 1
|
||||
spacing: 0
|
||||
delegate: FluMenuItem { }
|
||||
enter: Transition {
|
||||
reversible: true
|
||||
NumberAnimation {
|
||||
property: "opacity"
|
||||
from:0
|
||||
to:1
|
||||
duration: enableAnimation ? 83 : 0
|
||||
duration: 83
|
||||
}
|
||||
}
|
||||
exit:Transition {
|
||||
@ -25,38 +28,32 @@ Menu {
|
||||
property: "opacity"
|
||||
from:1
|
||||
to:0
|
||||
duration: enableAnimation ? 83 : 0
|
||||
duration: 83
|
||||
}
|
||||
}
|
||||
background:Item{
|
||||
FluShadow{
|
||||
radius: 5
|
||||
}
|
||||
}
|
||||
contentItem: Item {
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight
|
||||
model: control.contentModel
|
||||
interactive: Window.window
|
||||
? contentHeight + control.topPadding + control.bottomPadding > Window.window.height
|
||||
: false
|
||||
clip: true
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
|
||||
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||
border.width: 1
|
||||
radius: 5
|
||||
}
|
||||
Column{
|
||||
id:container
|
||||
spacing: 5
|
||||
topPadding: 5
|
||||
bottomPadding: 5
|
||||
width: popup.width
|
||||
function closePopup(){
|
||||
popup.close()
|
||||
}
|
||||
}
|
||||
currentIndex: control.currentIndex
|
||||
ScrollIndicator.vertical: ScrollIndicator {}
|
||||
}
|
||||
function getContainerHeight(){
|
||||
return container.height
|
||||
background: Rectangle {
|
||||
implicitWidth: 150
|
||||
implicitHeight: 40
|
||||
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(240/255,240/255,240/255,1)
|
||||
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||
border.width: 1
|
||||
radius: 5
|
||||
FluShadow{}
|
||||
}
|
||||
function getContainerCount(){
|
||||
return container.children.length
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
|
21
src/imports/FluentUI/Controls/FluMenuBar.qml
Normal file
@ -0,0 +1,21 @@
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls.impl
|
||||
|
||||
T.MenuBar {
|
||||
id: control
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
delegate: FluMenuBarItem { }
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
Repeater {
|
||||
model: control.contentModel
|
||||
}
|
||||
}
|
||||
background: Item {
|
||||
implicitHeight: 30
|
||||
}
|
||||
}
|
48
src/imports/FluentUI/Controls/FluMenuBarItem.qml
Normal file
@ -0,0 +1,48 @@
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls.impl
|
||||
import FluentUI
|
||||
|
||||
T.MenuBarItem {
|
||||
id: control
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
spacing: 6
|
||||
padding: 6
|
||||
leftPadding: 12
|
||||
rightPadding: 16
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.buttonText
|
||||
contentItem: FluText {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: control.text
|
||||
}
|
||||
background: Rectangle {
|
||||
implicitWidth: 30
|
||||
implicitHeight: 30
|
||||
radius: 3
|
||||
color: {
|
||||
if(FluTheme.dark){
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
if(control.hovered){
|
||||
return Qt.rgba(1,1,1,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(0,0,0,0.06)
|
||||
}
|
||||
if(control.hovered){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,53 +1,63 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
import FluentUI
|
||||
|
||||
Item {
|
||||
property string text: "MenuItem"
|
||||
property var onClickFunc
|
||||
signal clicked
|
||||
id:control
|
||||
width: {
|
||||
if(control.parent){
|
||||
return control.parent.width
|
||||
}
|
||||
return 140
|
||||
T.MenuItem {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
spacing: 6
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.windowText
|
||||
height: visible ? implicitHeight : 0
|
||||
contentItem: FluText {
|
||||
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
|
||||
readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
|
||||
leftPadding: !control.mirrored ? indicatorPadding : arrowPadding
|
||||
rightPadding: control.mirrored ? indicatorPadding : arrowPadding
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: control.text
|
||||
}
|
||||
height: 32
|
||||
Rectangle{
|
||||
anchors.centerIn: parent
|
||||
width: control.width-40
|
||||
height: 32
|
||||
radius: 4
|
||||
indicator: FluIcon {
|
||||
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
visible: control.checked
|
||||
iconSource: FluentIcons.CheckMark
|
||||
}
|
||||
arrow: FluIcon {
|
||||
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
visible: control.subMenu
|
||||
iconSource: FluentIcons.ChevronRightMed
|
||||
}
|
||||
background: Rectangle {
|
||||
implicitWidth: 150
|
||||
implicitHeight: 40
|
||||
x: 1
|
||||
y: 1
|
||||
width: control.width - 2
|
||||
height: control.height - 2
|
||||
color:{
|
||||
if(FluTheme.dark){
|
||||
if(mouse_area.containsMouse){
|
||||
return Qt.rgba(1,1,1,0.05)
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(1,1,1,0.06)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}else{
|
||||
if(mouse_area.containsMouse){
|
||||
return Qt.rgba(0,0,0,0.05)
|
||||
if(control.highlighted){
|
||||
return Qt.rgba(0,0,0,0.03)
|
||||
}
|
||||
return Qt.rgba(0,0,0,0)
|
||||
}
|
||||
}
|
||||
FluText{
|
||||
text: control.text
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
MouseArea{
|
||||
id:mouse_area
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if(control.onClickFunc){
|
||||
control.onClickFunc()
|
||||
return
|
||||
}
|
||||
control.parent.closePopup()
|
||||
control.clicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
src/imports/FluentUI/Controls/FluMenuSeparator.qml
Normal file
@ -0,0 +1,19 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
import FluentUI
|
||||
|
||||
T.MenuSeparator {
|
||||
id: control
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
padding: 0
|
||||
verticalPadding: 0
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 188
|
||||
implicitHeight: 1
|
||||
color: FluTheme.dark ? Qt.rgba(60/255,60/255,60/255,1) : Qt.rgba(210/255,210/255,210/255,1)
|
||||
}
|
||||
}
|
@ -3,6 +3,6 @@ import QtQuick.Controls
|
||||
import FluentUI
|
||||
|
||||
QtObject {
|
||||
default property list<QtObject> children;
|
||||
id:flu_object;
|
||||
default property list<QtObject> children
|
||||
id:control
|
||||
}
|
||||
|
@ -1,83 +1,39 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
import FluentUI
|
||||
|
||||
Item{
|
||||
property int size: 180
|
||||
property int dotSize: 24
|
||||
property int value: 50
|
||||
property int maxValue: 100
|
||||
property bool vertical: false
|
||||
property bool tipEnabled : true
|
||||
property var onLineClickFunc
|
||||
signal pressed
|
||||
signal released
|
||||
id:root
|
||||
height: control.height
|
||||
width: control.width
|
||||
rotation: vertical ? 180 : 0
|
||||
Component.onCompleted: {
|
||||
seek(value)
|
||||
}
|
||||
MouseArea{
|
||||
id:mouse_line
|
||||
anchors.centerIn: control
|
||||
width: vertical ? 10 : control.width
|
||||
height: vertical ? control.height : 10
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
(mouse) => {
|
||||
var val;
|
||||
if(vertical){
|
||||
val = mouse.y*maxValue/control.height
|
||||
}else{
|
||||
val = mouse.x*maxValue/control.width
|
||||
}
|
||||
if(onLineClickFunc){
|
||||
onLineClickFunc(val)
|
||||
}else{
|
||||
seek(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: control
|
||||
width: vertical ? 4 :size
|
||||
height: vertical ? size : 4
|
||||
radius: 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color:FluTheme.dark ? Qt.rgba(162/255,162/255,162/255,1) : Qt.rgba(138/255,138/255,138/255,1)
|
||||
Rectangle{
|
||||
id:rect
|
||||
radius: 2.5
|
||||
width: vertical ? 5 : control.width*(value/maxValue)
|
||||
height: vertical ? control.height*(value/maxValue) : 5
|
||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
id:dot
|
||||
width: dotSize
|
||||
height: dotSize
|
||||
FluShadow{
|
||||
radius: dotSize/2
|
||||
}
|
||||
radius: dotSize/2
|
||||
anchors.verticalCenter: vertical ? undefined : parent.verticalCenter
|
||||
anchors.horizontalCenter: vertical ? parent.horizontalCenter : undefined
|
||||
T.Slider {
|
||||
property bool tooltipEnabled: true
|
||||
id: control
|
||||
to:100
|
||||
stepSize:1
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitHandleWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitHandleHeight + topPadding + bottomPadding)
|
||||
padding: 6
|
||||
handle: Rectangle {
|
||||
x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
radius: 12
|
||||
color:FluTheme.dark ? Qt.rgba(69/255,69/255,69/255,1) :Qt.rgba(1,1,1,1)
|
||||
FluShadow{
|
||||
radius: 12
|
||||
}
|
||||
Rectangle{
|
||||
width: dotSize
|
||||
height: dotSize
|
||||
radius: dotSize/2
|
||||
width: 24
|
||||
height: 24
|
||||
radius: 12
|
||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
anchors.centerIn: parent
|
||||
scale: {
|
||||
if(control_mouse.pressed){
|
||||
if(control.pressed){
|
||||
return 4/10
|
||||
}
|
||||
return control_mouse.containsMouse || mouse_line.containsMouse ? 6/10 : 5/10
|
||||
return control.hovered ? 6/10 : 5/10
|
||||
}
|
||||
Behavior on scale {
|
||||
NumberAnimation{
|
||||
@ -85,47 +41,28 @@ Item{
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea{
|
||||
id:control_mouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
drag {
|
||||
target: dot
|
||||
axis: vertical ? Drag.YAxis : Drag.XAxis
|
||||
minimumX: vertical ? 0 : -dotSize/2
|
||||
maximumX: vertical ? 0 : (control.width - dotSize/2)
|
||||
minimumY: vertical ? -dotSize/2 : 0
|
||||
maximumY: vertical ? (control.height - dotSize/2) : 0
|
||||
}
|
||||
onPressed: {
|
||||
if(tipEnabled){
|
||||
tool_tip.visible = true
|
||||
}
|
||||
root.pressed()
|
||||
}
|
||||
onReleased: {
|
||||
tool_tip.visible = false
|
||||
root.released()
|
||||
}
|
||||
}
|
||||
FluTooltip{
|
||||
id:tool_tip
|
||||
text:String(root.value)
|
||||
y: vertical ? 32 : -40
|
||||
}
|
||||
}
|
||||
function seek(val){
|
||||
if(vertical){
|
||||
dot.y =val/maxValue*control.height - dotSize/2
|
||||
root.value = Qt.binding(function(){
|
||||
return (dot.y+dotSize/2)/control.height*maxValue
|
||||
})
|
||||
}else{
|
||||
dot.x =val/maxValue*control.width - dotSize/2
|
||||
root.value = Qt.binding(function(){
|
||||
return (dot.x+dotSize/2)/control.width*maxValue
|
||||
})
|
||||
FluTooltip{
|
||||
parent: control.handle
|
||||
visible: control.tooltipEnabled && control.pressed
|
||||
text:String(control.value)
|
||||
}
|
||||
background: Rectangle {
|
||||
x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0)
|
||||
implicitWidth: control.horizontal ? 180 : 4
|
||||
implicitHeight: control.horizontal ? 4 : 180
|
||||
width: control.horizontal ? control.availableWidth : implicitWidth
|
||||
height: control.horizontal ? implicitHeight : control.availableHeight
|
||||
radius: 3
|
||||
color:FluTheme.dark ? Qt.rgba(162/255,162/255,162/255,1) : Qt.rgba(138/255,138/255,138/255,1)
|
||||
scale: control.horizontal && control.mirrored ? -1 : 1
|
||||
Rectangle {
|
||||
y: control.horizontal ? 0 : control.visualPosition * parent.height
|
||||
width: control.horizontal ? control.position * parent.width : 4
|
||||
height: control.horizontal ? 4 : control.position * parent.height
|
||||
radius: 2
|
||||
color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +110,11 @@ Item {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
FluTooltip{
|
||||
visible: item_mouse_hove.containsMouse
|
||||
text:item_text.text
|
||||
delay: 1000
|
||||
}
|
||||
MouseArea{
|
||||
id:item_mouse_drag
|
||||
anchors.fill: parent
|
||||
@ -242,11 +247,6 @@ Item {
|
||||
Layout.preferredWidth: visible?item_container.width - 41 - item_btn_close.width:0
|
||||
elide: Text.ElideRight
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
FluTooltip{
|
||||
visible: item_mouse_hove.containsMouse
|
||||
text:item_text.text
|
||||
delay: 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
FluIconButton{
|
||||
|
@ -37,7 +37,6 @@ Item {
|
||||
model_data_source.clear()
|
||||
model_data_source.append(dataSource)
|
||||
}
|
||||
|
||||
Component{
|
||||
id:header_columns
|
||||
FluRectangle{
|
||||
@ -114,7 +113,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Flickable{
|
||||
id:layout_flickable
|
||||
height: layout_table.height
|
||||
@ -219,6 +217,7 @@ Item {
|
||||
property var model : modelData
|
||||
property var dataModel : listModel
|
||||
property var dataObject : itemObject
|
||||
property var tableView : control
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width
|
||||
sourceComponent: {
|
||||
@ -245,7 +244,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:com_text
|
||||
Item{
|
||||
|
@ -71,7 +71,16 @@ Rectangle {
|
||||
columnWidthProvider: function(column) {
|
||||
let w = explicitColumnWidth(column)
|
||||
if (w >= 0){
|
||||
return Math.max(100, w)
|
||||
var minimumWidth = columnSource[column].minimumWidth
|
||||
var maximumWidth = columnSource[column].maximumWidth
|
||||
if(!minimumWidth){
|
||||
minimumWidth = 100
|
||||
}
|
||||
if(!maximumWidth){
|
||||
maximumWidth = 65535
|
||||
}
|
||||
|
||||
return Math.min(Math.max(minimumWidth, w),maximumWidth)
|
||||
}
|
||||
return implicitColumnWidth(column)
|
||||
}
|
||||
|
@ -73,6 +73,5 @@ TextField{
|
||||
id:menu
|
||||
inputItem: control
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,7 @@ FluMenu{
|
||||
property string selectAllText : "全选"
|
||||
property var inputItem
|
||||
id:menu
|
||||
focus:false
|
||||
enableAnimation:false
|
||||
width: 120
|
||||
onVisibleChanged: {
|
||||
if(visible){
|
||||
inputItem.forceActiveFocus()
|
||||
|
@ -5,7 +5,6 @@ import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Rectangle {
|
||||
|
||||
enum HourFormat {
|
||||
H,
|
||||
HH
|
||||
@ -16,7 +15,6 @@ Rectangle {
|
||||
property var window : Window.window
|
||||
property int hourFormat: FluTimePicker.H
|
||||
property int isH: hourFormat === FluTimePicker.H
|
||||
|
||||
id:root
|
||||
color: {
|
||||
if(mouse_area.containsMouse){
|
||||
@ -29,7 +27,6 @@ Rectangle {
|
||||
radius: 4
|
||||
border.width: 1
|
||||
border.color: dividerColor
|
||||
|
||||
MouseArea{
|
||||
id:mouse_area
|
||||
hoverEnabled: true
|
||||
|
@ -7,15 +7,16 @@ import FluentUI
|
||||
Button {
|
||||
property bool disabled: false
|
||||
property string contentDescription: ""
|
||||
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(159/255,159/255,159/255,1) :FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(240/255,240/255,240/255,1)
|
||||
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(233/255,233/255,233/255,1) :FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(233/255,233/255,233/255,1)
|
||||
property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||
property color borderNormalColor: FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||
property color borderCheckColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1)
|
||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(200/255,200/255,200/255,1)
|
||||
property color dotNormalColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1)
|
||||
property color dotCheckColor: FluTheme.dark ? Qt.rgba(0/255,0/255,0/255,1) : Qt.rgba(255/255,255/255,255/255,1)
|
||||
property color dotDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(150/255,150/255,150/255,1)
|
||||
property var clickListener : function(){
|
||||
checked = !checked
|
||||
}
|
||||
@ -76,6 +77,9 @@ Button {
|
||||
scale: hovered&!disabled ? 7/10 : 6/10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: {
|
||||
if(disabled){
|
||||
return dotDisableColor
|
||||
}
|
||||
if(checked){
|
||||
return dotCheckColor
|
||||
}
|
||||
|
@ -1,18 +1,30 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
import FluentUI
|
||||
|
||||
ToolTip {
|
||||
id:tool_tip
|
||||
T.ToolTip {
|
||||
id: control
|
||||
x: parent ? (parent.width - implicitWidth) / 2 : 0
|
||||
y: -implicitHeight - 3
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
margins: 6
|
||||
padding: 6
|
||||
font: FluTextStyle.Body
|
||||
closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
|
||||
contentItem: FluText {
|
||||
text: tool_tip.text
|
||||
padding: 4
|
||||
wrapMode: Text.WrapAnywhere
|
||||
text: control.text
|
||||
font: control.font
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
background: Rectangle{
|
||||
anchors.fill: parent
|
||||
background: Rectangle {
|
||||
color: FluTheme.dark ? Qt.rgba(50/255,49/255,48/255,1) : Qt.rgba(1,1,1,1)
|
||||
radius: 5
|
||||
FluShadow{}
|
||||
radius: 3
|
||||
FluShadow{
|
||||
radius: 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,144 +0,0 @@
|
||||
MetaInfo {
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluTextButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluTextButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Text Button\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Standard Button\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluFilledButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluFilledButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Filled Button\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluToggleButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluToggleButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Toggle Button\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluIconButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluIconButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluDropDownButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluDropDownButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"DropDownButton\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluRadioButton"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluRadioButton"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Radio Button\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluCheckBox"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluCheckBox"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A button with text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"CheckBox\")" }
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluText"
|
||||
icon: "images/label-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluText"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/label-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("A text.")
|
||||
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Text\")" }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Before Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 259 B |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 509 B |
Before Width: | Height: | Size: 189 B |
Before Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 121 B |
Before Width: | Height: | Size: 117 B |
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 133 B |
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 133 B |
Before Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 93 B |
Before Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 482 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 381 B |
Before Width: | Height: | Size: 110 B |
Before Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 151 B |