2021-05-20 06:25:52 +00:00
|
|
|
#include "statuswindow.h"
|
2021-05-12 08:11:25 +00:00
|
|
|
|
|
|
|
#include <QColor>
|
|
|
|
|
2021-06-01 10:01:47 +00:00
|
|
|
#include <QDebug>
|
|
|
|
|
2021-05-12 08:11:25 +00:00
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
#include <AppKit/NSView.h>
|
|
|
|
#include <AppKit/NSWindow.h>
|
|
|
|
#include <AppKit/NSColor.h>
|
2021-06-01 10:01:47 +00:00
|
|
|
#include <AppKit/NSToolbar.h>
|
|
|
|
#include <AppKit/NSButton.h>
|
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
|
2022-07-21 09:04:07 +00:00
|
|
|
void StatusWindow::removeTitleBarMac()
|
2021-06-01 10:01:47 +00:00
|
|
|
{
|
|
|
|
NSView *nsView = reinterpret_cast<NSView*>(this->winId());
|
|
|
|
NSWindow *window = [nsView window];
|
|
|
|
|
|
|
|
window.titlebarAppearsTransparent = true;
|
|
|
|
window.titleVisibility = NSWindowTitleHidden;
|
|
|
|
window.styleMask |= NSWindowStyleMaskFullSizeContentView;
|
|
|
|
NSButton* close = [window standardWindowButton:NSWindowCloseButton];
|
|
|
|
NSView* titleBarContainerView = close.superview.superview;
|
|
|
|
[titleBarContainerView setHidden:YES];
|
|
|
|
}
|
2021-05-12 08:11:25 +00:00
|
|
|
|
2022-07-21 09:04:07 +00:00
|
|
|
void StatusWindow::showTitleBarMac()
|
2021-05-12 08:11:25 +00:00
|
|
|
{
|
2021-06-01 10:01:47 +00:00
|
|
|
NSView *nsView = reinterpret_cast<NSView*>(this->winId());
|
2021-05-12 08:11:25 +00:00
|
|
|
NSWindow *window = [nsView window];
|
|
|
|
|
|
|
|
window.titlebarAppearsTransparent = true;
|
|
|
|
window.titleVisibility = NSWindowTitleHidden;
|
|
|
|
window.styleMask |= NSWindowStyleMaskFullSizeContentView;
|
2021-06-01 10:01:47 +00:00
|
|
|
NSButton* close = [window standardWindowButton:NSWindowCloseButton];
|
|
|
|
NSView* titleBarContainerView = close.superview.superview;
|
|
|
|
[titleBarContainerView setHidden:NO];
|
2021-05-12 08:11:25 +00:00
|
|
|
}
|