Skip to content

Commit

Permalink
Handler.m: Adjust centering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed May 27, 2024
1 parent 477902f commit 4e9ded5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OCLP-Helper/Handler.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ -(void)createAppWindowWithProgressBar {
[progressBar startAnimation:nil];
[window.contentView addSubview:progressBar];

[window center];

// Reference: https://stackoverflow.com/a/61174052
CGFloat xPos = NSWidth(window.screen.frame) / 2 - NSWidth(window.frame) / 2;
CGFloat yPos = NSHeight(window.screen.frame) / 2 - NSHeight(window.frame) / 2;

[window setFrame:NSMakeRect(xPos, yPos, NSWidth(window.frame), NSHeight(window.frame)) display:YES];
}

-(void)spawnProgressWindow {
Expand Down

0 comments on commit 4e9ded5

Please sign in to comment.