Skip to content

Commit

Permalink
format framelesswindow.mm
Browse files Browse the repository at this point in the history
  • Loading branch information
zjeffer committed Feb 9, 2025
1 parent 6697616 commit 7281cca
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions src/framelesswindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,14 @@ - (void)zoomButtonAction:(id)sender
AppObserver *observer = [[AppObserver alloc] init];
if (observer) {
observer.window = this;
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver:observer
selector:@selector(appDidHide:)
name:NSWorkspaceDidHideApplicationNotification
object:nil];
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver:observer
selector:@selector(appDidUnhide:)
name:NSWorkspaceDidUnhideApplicationNotification
object:nil];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:observer
selector:@selector(appDidHide:)
name:NSWorkspaceDidHideApplicationNotification
object:nil];
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:observer
selector:@selector(appDidUnhide:)
name:NSWorkspaceDidUnhideApplicationNotification
object:nil];
} else {
qWarning() << "Failed to set up Notification Observer!";
}
Expand Down Expand Up @@ -140,13 +138,10 @@ - (void)zoomButtonAction:(id)sender
// Currently, doesn't work
NSButton *closeButton = [window standardWindowButton:NSWindowCloseButton];
NSButton *minimizeButton = [window standardWindowButton:NSWindowMiniaturizeButton];
closeButton.frame = NSMakeRect(closeButton.frame.origin.x + 10, closeButton.frame.origin.y,
closeButton.frame.size.width, closeButton.frame.size.height);
closeButton.frame = NSMakeRect(closeButton.frame.origin.x + 10, closeButton.frame.origin.y, closeButton.frame.size.width, closeButton.frame.size.height);
minimizeButton.frame =
NSMakeRect(minimizeButton.frame.origin.x + 10, minimizeButton.frame.origin.y,
minimizeButton.frame.size.width, minimizeButton.frame.size.height);
zoomButton.frame = NSMakeRect(zoomButton.frame.origin.x + 10, zoomButton.frame.origin.y,
zoomButton.frame.size.width, zoomButton.frame.size.height);
NSMakeRect(minimizeButton.frame.origin.x + 10, minimizeButton.frame.origin.y, minimizeButton.frame.size.width, minimizeButton.frame.size.height);
zoomButton.frame = NSMakeRect(zoomButton.frame.origin.x + 10, zoomButton.frame.origin.y, zoomButton.frame.size.width, zoomButton.frame.size.height);
}

void CFramelessWindow::setCloseBtnQuit(bool bQuit)
Expand Down

0 comments on commit 7281cca

Please sign in to comment.