diff --git a/example/qml-Qt6/page/T_SplitLayout.qml b/example/qml-Qt6/page/T_SplitLayout.qml index 50aeb610..c037d017 100644 --- a/example/qml-Qt6/page/T_SplitLayout.qml +++ b/example/qml-Qt6/page/T_SplitLayout.qml @@ -9,4 +9,76 @@ FluContentPage{ title:"SplitLayout" + RowLayout{ + id:layout_dropdown + anchors{ + top: parent.top + topMargin: 20 + } + FluText{ + text:"orientation:" + } + FluDropDownButton{ + id:btn_orientation + Layout.preferredWidth: 100 + text:"Horizontal" + FluMenuItem{ + text:"Horizontal" + onClicked: { + btn_orientation.text = text + split_layout.orientation = Qt.Horizontal + } + } + FluMenuItem{ + text:"Vertical" + onClicked: { + btn_orientation.text = text + split_layout.orientation = Qt.Vertical + } + } + } + } + FluSplitLayout { + id:split_layout + anchors{ + top: layout_dropdown.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + topMargin: 8 + } + orientation: Qt.Horizontal + Item { + clip: true + implicitWidth: 200 + implicitHeight: 200 + SplitView.maximumWidth: 400 + SplitView.maximumHeight: 400 + FluText { + text: "Page 1" + anchors.centerIn: parent + } + } + Item { + clip: true + id: centerItem + SplitView.minimumWidth: 50 + SplitView.minimumHeight: 50 + SplitView.fillWidth: true + SplitView.fillHeight: true + FluText { + text: "Page 2" + anchors.centerIn: parent + } + } + Item { + clip: true + implicitWidth: 200 + implicitHeight: 200 + FluText { + text: "Page 3" + anchors.centerIn: parent + } + } + } } diff --git a/example/qml/page/T_SplitLayout.qml b/example/qml/page/T_SplitLayout.qml index afa50fc6..16026d75 100644 --- a/example/qml/page/T_SplitLayout.qml +++ b/example/qml/page/T_SplitLayout.qml @@ -9,4 +9,76 @@ FluContentPage{ title:"SplitLayout" + RowLayout{ + id:layout_dropdown + anchors{ + top: parent.top + topMargin: 20 + } + FluText{ + text:"orientation:" + } + FluDropDownButton{ + id:btn_orientation + Layout.preferredWidth: 100 + text:"Horizontal" + FluMenuItem{ + text:"Horizontal" + onClicked: { + btn_orientation.text = text + split_layout.orientation = Qt.Horizontal + } + } + FluMenuItem{ + text:"Vertical" + onClicked: { + btn_orientation.text = text + split_layout.orientation = Qt.Vertical + } + } + } + } + FluSplitLayout { + id:split_layout + anchors{ + top: layout_dropdown.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + topMargin: 8 + } + orientation: Qt.Horizontal + Item { + clip: true + implicitWidth: 200 + implicitHeight: 200 + SplitView.maximumWidth: 400 + SplitView.maximumHeight: 400 + FluText { + text: "Page 1" + anchors.centerIn: parent + } + } + Item { + clip: true + id: centerItem + SplitView.minimumWidth: 50 + SplitView.minimumHeight: 50 + SplitView.fillWidth: true + SplitView.fillHeight: true + FluText { + text: "Page 2" + anchors.centerIn: parent + } + } + Item { + clip: true + implicitWidth: 200 + implicitHeight: 200 + FluText { + text: "Page 3" + anchors.centerIn: parent + } + } + } } diff --git a/example/qml/page/T_StaggeredLayout.qml b/example/qml/page/T_StaggeredLayout.qml index cd99502a..82855509 100644 --- a/example/qml/page/T_StaggeredLayout.qml +++ b/example/qml/page/T_StaggeredLayout.qml @@ -2,8 +2,8 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 -import "../component" import FluentUI 1.0 +import "../component" FluContentPage{ diff --git a/src/FluNetwork.cpp b/src/FluNetwork.cpp index 59f19214..4b3c8978 100644 --- a/src/FluNetwork.cpp +++ b/src/FluNetwork.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/src/FluentUI.cpp b/src/FluentUI.cpp index 8838c002..ee1128c2 100644 --- a/src/FluentUI.cpp +++ b/src/FluentUI.cpp @@ -137,6 +137,7 @@ void FluentUI::registerTypes(const char *uri){ qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluClip.qml"),uri,major,minor,"FluClip"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoader.qml"),uri,major,minor,"FluLoader"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluShortcutPicker.qml"),uri,major,minor,"FluShortcutPicker"); + qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSplitLayout.qml"),uri,major,minor,"FluSplitLayout"); qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri,major,minor,"FluentIcons", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri,major,minor,"FluThemeType", "Access to enums & flags only"); diff --git a/src/Qt5/imports/FluentUI/Controls/FluSplitLayout.qml b/src/Qt5/imports/FluentUI/Controls/FluSplitLayout.qml new file mode 100644 index 00000000..5ea75c77 --- /dev/null +++ b/src/Qt5/imports/FluentUI/Controls/FluSplitLayout.qml @@ -0,0 +1,30 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import FluentUI 1.0 + +SplitView { + property color handleColor : FluTheme.dark ? Qt.rgba(159/255,159/255,159/255,1) : Qt.rgba(138/255,138/255,138/255,1) + id:control + QtObject{ + id:d + property bool isVertical: control.orientation === Qt.Vertical + } + handle: Rectangle { + implicitWidth: 12 + implicitHeight: 12 + clip: true + color: { + if(SplitHandle.pressed){ + return FluTheme.itemPressColor + } + return SplitHandle.hovered ? FluTheme.itemHoverColor : FluTheme.itemNormalColor + } + Rectangle{ + width: d.isVertical ? 26 : 4 + height: d.isVertical ? 4 : 26 + anchors.centerIn: parent + color: control.handleColor + radius: 2 + } + } +} diff --git a/src/Qt5/imports/FluentUI/plugins.qmltypes b/src/Qt5/imports/FluentUI/plugins.qmltypes index 03fdc3ca..2bb2293b 100644 --- a/src/Qt5/imports/FluentUI/plugins.qmltypes +++ b/src/Qt5/imports/FluentUI/plugins.qmltypes @@ -3017,15 +3017,15 @@ Module { defaultProperty: "data" Property { name: "logo"; type: "QUrl" } Property { name: "title"; type: "string" } - Property { name: "items"; type: "FluObject_QMLTYPE_157"; isPointer: true } - Property { name: "footerItems"; type: "FluObject_QMLTYPE_157"; isPointer: true } + Property { name: "items"; type: "FluObject_QMLTYPE_159"; isPointer: true } + Property { name: "footerItems"; type: "FluObject_QMLTYPE_159"; isPointer: true } Property { name: "displayMode"; type: "int" } Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true } Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true } Property { name: "topPadding"; type: "int" } Property { name: "pageMode"; type: "int" } - Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_45"; isPointer: true } - Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_45"; isPointer: true } + Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_47"; isPointer: true } + Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_47"; isPointer: true } Property { name: "navCompactWidth"; type: "int" } Property { name: "navTopMargin"; type: "int" } Property { name: "cellHeight"; type: "int" } @@ -3112,6 +3112,7 @@ Module { Property { name: "_idx"; type: "int" } Property { name: "_ext"; type: "QVariant" } Property { name: "_parent"; type: "QVariant" } + Property { name: "visible"; type: "bool" } Property { name: "title"; type: "string" } Property { name: "url"; type: "QVariant" } Property { name: "disabled"; type: "bool" } @@ -3137,6 +3138,7 @@ Module { Property { name: "_idx"; type: "int" } Property { name: "_ext"; type: "QVariant" } Property { name: "_parent"; type: "QVariant" } + Property { name: "visible"; type: "bool" } } Component { prototype: "QObject" @@ -3147,6 +3149,7 @@ Module { defaultProperty: "children" Property { name: "key"; type: "string"; isReadonly: true } Property { name: "_idx"; type: "int" } + Property { name: "visible"; type: "bool" } Property { name: "title"; type: "string" } Property { name: "icon"; type: "QVariant" } Property { name: "disabled"; type: "bool" } @@ -3166,6 +3169,7 @@ Module { isComposite: true Property { name: "key"; type: "string"; isReadonly: true } Property { name: "_idx"; type: "int" } + Property { name: "visible"; type: "bool" } Property { name: "title"; type: "string" } Property { name: "parent"; type: "QVariant" } } @@ -3177,6 +3181,7 @@ Module { isComposite: true Property { name: "key"; type: "string"; isReadonly: true } Property { name: "_idx"; type: "int" } + Property { name: "visible"; type: "bool" } Property { name: "parent"; type: "QVariant" } Property { name: "spacing"; type: "double" } Property { name: "size"; type: "int" } @@ -3441,6 +3446,34 @@ Module { Property { name: "elevation"; type: "int" } Property { name: "radius"; type: "int" } } + Component { + prototype: "QQuickButton" + name: "FluentUI/FluShortcutPicker 1.0" + exports: ["FluentUI/FluShortcutPicker 1.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "current"; type: "QVariant" } + Property { name: "title"; type: "string" } + Property { name: "message"; type: "string" } + Property { name: "positiveText"; type: "string" } + Property { name: "neutralText"; type: "string" } + Property { name: "negativeText"; type: "string" } + Signal { name: "accepted" } + Property { name: "iconSize"; type: "int" } + Property { name: "iconSource"; type: "int" } + Property { name: "disabled"; type: "bool" } + Property { name: "radius"; type: "int" } + Property { name: "contentDescription"; type: "string" } + Property { name: "hoverColor"; type: "QColor" } + Property { name: "pressedColor"; type: "QColor" } + Property { name: "normalColor"; type: "QColor" } + Property { name: "disableColor"; type: "QColor" } + Property { name: "iconDelegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "color"; type: "QColor" } + Property { name: "iconColor"; type: "QColor" } + Property { name: "textColor"; type: "QColor" } + } Component { prototype: "QQuickSlider" name: "FluentUI/FluSlider 1.0" @@ -3449,6 +3482,7 @@ Module { isComposite: true defaultProperty: "data" Property { name: "tooltipEnabled"; type: "bool" } + Property { name: "text"; type: "string" } } Component { prototype: "QQuickSpinBox" @@ -3462,10 +3496,19 @@ Module { Property { name: "hoverColor"; type: "QColor" } Property { name: "pressedColor"; type: "QColor" } } + Component { + prototype: "QQuickSplitView" + name: "FluentUI/FluSplitLayout 1.0" + exports: ["FluentUI/FluSplitLayout 1.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + Property { name: "handleColor"; type: "QColor" } + } Component { prototype: "QQuickItem" - name: "FluentUI/FluStaggeredView 1.0" - exports: ["FluentUI/FluStaggeredView 1.0"] + name: "FluentUI/FluStaggeredLayout 1.0" + exports: ["FluentUI/FluStaggeredLayout 1.0"] exportMetaObjectRevisions: [0] isComposite: true defaultProperty: "data" @@ -3544,7 +3587,10 @@ Module { Property { name: "columnSource"; type: "QVariant" } Property { name: "dataSource"; type: "QVariant" } Property { name: "borderColor"; type: "QColor" } + Property { name: "horizonalHeaderVisible"; type: "bool" } + Property { name: "verticalHeaderVisible"; type: "bool" } Property { name: "tableModel"; type: "QQmlTableModel"; isReadonly: true; isPointer: true } + Property { name: "tableView"; type: "QQuickTableView"; isReadonly: true; isPointer: true } Method { name: "closeEditor"; type: "QVariant" } Method { name: "resetPosition"; type: "QVariant" } Method { @@ -3787,6 +3833,7 @@ Module { Property { name: "showMaximize"; type: "bool" } Property { name: "showStayTop"; type: "bool" } Property { name: "autoMaximize"; type: "bool" } + Property { name: "autoVisible"; type: "bool" } Property { name: "useSystemAppBar"; type: "bool" } Property { name: "resizeBorderColor"; type: "QColor" } Property { name: "resizeBorderWidth"; type: "int" } @@ -3797,7 +3844,6 @@ Module { Property { name: "_realHeight"; type: "int" } Property { name: "_realWidth"; type: "int" } Property { name: "_appBarHeight"; type: "int" } - Property { name: "_enableMarginsBottomLeftRight"; type: "bool" } Property { name: "content"; type: "QObject"; isList: true; isReadonly: true } Signal { name: "showSystemMenu" } Signal { diff --git a/src/Qt5/imports/FluentUI/qmldir b/src/Qt5/imports/FluentUI/qmldir index 0ef5be4f..f57747a6 100644 --- a/src/Qt5/imports/FluentUI/qmldir +++ b/src/Qt5/imports/FluentUI/qmldir @@ -96,4 +96,6 @@ FluLoadingButton 1.0 Controls/FluLoadingButton.qml FluClip 1.0 Controls/FluClip.qml FluLoader 1.0 Controls/FluLoader.qml FluShortcutPicker 1.0 Controls/FluShortcutPicker.qml +FluSplitLayout 1.0 Controls/FluSplitLayout.qml +FluStaggeredLayout 1.0 Controls/FluStaggeredLayout.qml plugin fluentuiplugin diff --git a/src/Qt5/imports/fluentui.qrc b/src/Qt5/imports/fluentui.qrc index 36277e7e..2f336421 100644 --- a/src/Qt5/imports/fluentui.qrc +++ b/src/Qt5/imports/fluentui.qrc @@ -106,5 +106,6 @@ FluentUI/Image/btn_min_normal.png FluentUI/Image/btn_min_pushed.png FluentUI/Controls/FluImageButton.qml + FluentUI/Controls/FluSplitLayout.qml diff --git a/src/Qt6/imports/FluentUI/Controls/FluSplitLayout.qml b/src/Qt6/imports/FluentUI/Controls/FluSplitLayout.qml new file mode 100644 index 00000000..cc8b286f --- /dev/null +++ b/src/Qt6/imports/FluentUI/Controls/FluSplitLayout.qml @@ -0,0 +1,30 @@ +import QtQuick +import QtQuick.Controls +import FluentUI + +SplitView { + property color handleColor : FluTheme.dark ? Qt.rgba(159/255,159/255,159/255,1) : Qt.rgba(138/255,138/255,138/255,1) + id:control + QtObject{ + id:d + property bool isVertical: control.orientation === Qt.Vertical + } + handle: Rectangle { + implicitWidth: 12 + implicitHeight: 12 + clip: true + color: { + if(SplitHandle.pressed){ + return FluTheme.itemPressColor + } + return SplitHandle.hovered ? FluTheme.itemHoverColor : FluTheme.itemNormalColor + } + Rectangle{ + width: d.isVertical ? 26 : 4 + height: d.isVertical ? 4 : 26 + anchors.centerIn: parent + color: control.handleColor + radius: 2 + } + } +}