From 067b421f39222f0b8d68ef505454b20ce33343d8 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 28 Feb 2016 11:17:52 +0200 Subject: [PATCH] Fixed default width of progress bar in OS X startup window If window was resized before progress bar appears it will have hardcoded and so incorrect width --- src/posix/cocoa/st_console.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/posix/cocoa/st_console.mm b/src/posix/cocoa/st_console.mm index 09c15e395..cdeb2cbaa 100644 --- a/src/posix/cocoa/st_console.mm +++ b/src/posix/cocoa/st_console.mm @@ -377,7 +377,12 @@ void FConsoleWindow::SetProgressBar(const bool visible) { ExpandTextView(-PROGRESS_BAR_HEIGHT); - m_progressBar = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(2.0f, 0.0f, 508.0f, 16.0f)]; + static const CGFloat PROGRESS_BAR_X = 2.0f; + const NSRect PROGRESS_BAR_RECT = NSMakeRect( + PROGRESS_BAR_X, 0.0f, + [m_window frame].size.width - PROGRESS_BAR_X * 2, 16.0f); + + m_progressBar = [[NSProgressIndicator alloc] initWithFrame:PROGRESS_BAR_RECT]; [m_progressBar setIndeterminate:NO]; [m_progressBar setAutoresizingMask:NSViewWidthSizable];