diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index 0614af27..57e17fe6 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -103,6 +103,7 @@ CustomWindow { z:999 items: ItemsOriginal footerItems:ItemsFooter + topPadding:Qt.platform.os === "osx" ? 20 : 5 displayMode:MainEvent.displayMode logo: "qrc:/example/res/image/favicon.ico" title:"FluentUI" diff --git a/example/src/main.cpp b/example/src/main.cpp index 0846374e..e80408f0 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -10,7 +10,7 @@ #include "AppInfo.h" #include "tool/IPC.h" -FRAMELESSHELPER_USE_NAMESPACE; +FRAMELESSHELPER_USE_NAMESPACE int main(int argc, char *argv[]) { @@ -27,8 +27,8 @@ int main(int argc, char *argv[]) // QQuickWindow::setGraphicsApi(QSGRendererInterface::Software); QGuiApplication app(argc, argv); FramelessHelper::Core::setApplicationOSThemeAware(); -// FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow); -// FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial); + FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow); + FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial); AppInfo* appInfo = new AppInfo(); IPC ipc(0); QString activeWindowEvent = "activeWindow"; diff --git a/src/imports/FluentUI/Controls/FluAppBar.qml b/src/imports/FluentUI/Controls/FluAppBar.qml index a8ff779a..b0e50e3f 100644 --- a/src/imports/FluentUI/Controls/FluAppBar.qml +++ b/src/imports/FluentUI/Controls/FluAppBar.qml @@ -20,6 +20,7 @@ Rectangle{ property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1) property bool showDark: false property bool titleVisible: true + property bool isMac: Qt.platform.os === "osx" property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark id:root color: Qt.rgba(0,0,0,0) @@ -45,14 +46,16 @@ Rectangle{ text: title anchors{ verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: 10 + left: isMac ? undefined : parent.left + leftMargin: isMac ? undefined : 10 + horizontalCenter: isMac ? parent.horizontalCenter : undefined } visible: root.titleVisible color:root.textColor } RowLayout{ anchors.right: parent.right + visible: !isMac height: root.height spacing: 0 RowLayout{ diff --git a/src/imports/FluentUI/Controls/FluNavigationView.qml b/src/imports/FluentUI/Controls/FluNavigationView.qml index 6c74c327..d897101d 100644 --- a/src/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/imports/FluentUI/Controls/FluNavigationView.qml @@ -19,6 +19,7 @@ Item { property int displayMode: FluNavigationView.Auto property Component autoSuggestBox property Component actionItem + property int topPadding: 0 enum PageModeFlag{ Standard = 0, SingleTop = 1, @@ -456,6 +457,10 @@ Item { id:nav_app_bar width: parent.width height: 40 + anchors{ + top: parent.top + topMargin: control.topPadding + } z:999 RowLayout{ height:parent.height @@ -637,7 +642,7 @@ Item { id:layout_header width: layout_list.width clip: true - y:nav_app_bar.height + y:nav_app_bar.height+control.topPadding height: autoSuggestBox ? 38 : 0 Loader{ id:loader_auto_suggest_box