forked from github_mirror/framelesshelper
macos: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
7a65ce04ee
commit
bfc7b27900
|
@ -28,6 +28,7 @@
|
|||
#include <QtGui/qwindow.h>
|
||||
#include "framelessmanager.h"
|
||||
#include "framelessmanager_p.h"
|
||||
#include "framelessconfig_p.h"
|
||||
#include "utils.h"
|
||||
|
||||
FRAMELESSHELPER_BEGIN_NAMESPACE
|
||||
|
@ -73,7 +74,20 @@ void FramelessHelperQt::addWindow(const SystemParameters ¶ms)
|
|||
data.eventFilter = new FramelessHelperQt(window);
|
||||
g_qtHelper()->data.insert(windowId, data);
|
||||
g_qtHelper()->mutex.unlock();
|
||||
const bool shouldApplyFramelessFlag = [¶ms]() -> bool {
|
||||
#ifdef Q_OS_MACOS
|
||||
if (FramelessConfig::instance()->isSet(Option::WindowUseRoundCorners)
|
||||
&& (params.getCurrentApplicationType() == ApplicationType::Quick)) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(params);
|
||||
#endif
|
||||
return true;
|
||||
}();
|
||||
if (shouldApplyFramelessFlag) {
|
||||
params.setWindowFlags(params.getWindowFlags() | Qt::FramelessWindowHint);
|
||||
}
|
||||
window->installEventFilter(data.eventFilter);
|
||||
#ifdef Q_OS_MACOS
|
||||
Utils::setSystemTitleBarVisible(windowId, false);
|
||||
|
|
|
@ -163,6 +163,7 @@ public:
|
|||
return;
|
||||
}
|
||||
nsview.wantsLayer = YES;
|
||||
nswindow.styleMask |= NSWindowStyleMaskResizable;
|
||||
if (visible) {
|
||||
nswindow.styleMask &= ~NSWindowStyleMaskFullSizeContentView;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue