This commit is contained in:
朱子楚 2023-05-17 20:20:29 +08:00
parent 4e4760e37f
commit 1446fd8933
4 changed files with 15 additions and 6 deletions

View File

@ -103,6 +103,7 @@ CustomWindow {
z:999 z:999
items: ItemsOriginal items: ItemsOriginal
footerItems:ItemsFooter footerItems:ItemsFooter
topPadding:Qt.platform.os === "osx" ? 20 : 5
displayMode:MainEvent.displayMode displayMode:MainEvent.displayMode
logo: "qrc:/example/res/image/favicon.ico" logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI" title:"FluentUI"

View File

@ -10,7 +10,7 @@
#include "AppInfo.h" #include "AppInfo.h"
#include "tool/IPC.h" #include "tool/IPC.h"
FRAMELESSHELPER_USE_NAMESPACE; FRAMELESSHELPER_USE_NAMESPACE
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -27,8 +27,8 @@ int main(int argc, char *argv[])
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software); // QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
FramelessHelper::Core::setApplicationOSThemeAware(); FramelessHelper::Core::setApplicationOSThemeAware();
// FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow); FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
// FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial); FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
AppInfo* appInfo = new AppInfo(); AppInfo* appInfo = new AppInfo();
IPC ipc(0); IPC ipc(0);
QString activeWindowEvent = "activeWindow"; QString activeWindowEvent = "activeWindow";

View File

@ -20,6 +20,7 @@ Rectangle{
property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1) property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1)
property bool showDark: false property bool showDark: false
property bool titleVisible: true property bool titleVisible: true
property bool isMac: Qt.platform.os === "osx"
property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
id:root id:root
color: Qt.rgba(0,0,0,0) color: Qt.rgba(0,0,0,0)
@ -45,14 +46,16 @@ Rectangle{
text: title text: title
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: isMac ? undefined : parent.left
leftMargin: 10 leftMargin: isMac ? undefined : 10
horizontalCenter: isMac ? parent.horizontalCenter : undefined
} }
visible: root.titleVisible visible: root.titleVisible
color:root.textColor color:root.textColor
} }
RowLayout{ RowLayout{
anchors.right: parent.right anchors.right: parent.right
visible: !isMac
height: root.height height: root.height
spacing: 0 spacing: 0
RowLayout{ RowLayout{

View File

@ -19,6 +19,7 @@ Item {
property int displayMode: FluNavigationView.Auto property int displayMode: FluNavigationView.Auto
property Component autoSuggestBox property Component autoSuggestBox
property Component actionItem property Component actionItem
property int topPadding: 0
enum PageModeFlag{ enum PageModeFlag{
Standard = 0, Standard = 0,
SingleTop = 1, SingleTop = 1,
@ -456,6 +457,10 @@ Item {
id:nav_app_bar id:nav_app_bar
width: parent.width width: parent.width
height: 40 height: 40
anchors{
top: parent.top
topMargin: control.topPadding
}
z:999 z:999
RowLayout{ RowLayout{
height:parent.height height:parent.height
@ -637,7 +642,7 @@ Item {
id:layout_header id:layout_header
width: layout_list.width width: layout_list.width
clip: true clip: true
y:nav_app_bar.height y:nav_app_bar.height+control.topPadding
height: autoSuggestBox ? 38 : 0 height: autoSuggestBox ? 38 : 0
Loader{ Loader{
id:loader_auto_suggest_box id:loader_auto_suggest_box