From e007f1cd723ba585c369cb0ccf88834725db6e3a Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 8 Sep 2013 06:16:00 +0200 Subject: [PATCH] * Fixed statusbar shifting to the right when going into fullscreen mode on OSX. --- src/tomahawk/TomahawkWindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tomahawk/TomahawkWindow.cpp b/src/tomahawk/TomahawkWindow.cpp index 03aabd262..9123b7c7c 100644 --- a/src/tomahawk/TomahawkWindow.cpp +++ b/src/tomahawk/TomahawkWindow.cpp @@ -941,6 +941,12 @@ TomahawkWindow::fullScreenEntered() TomahawkSettings::instance()->setFullscreenEnabled( true ); statusBar()->setSizeGripEnabled( false ); + // Since we just disabled the size-grip the entire statusbar will shift a bit to the right + // The volume bar would now have no margin to the right screen edge. Prevent that. + QMargins margins = statusBar()->contentsMargins(); + margins.setRight( 24 ); + statusBar()->setContentsMargins( margins ); + #if defined( Q_WS_MAC ) ActionCollection::instance()->getAction( "fullscreen" )->setText( tr( "Exit Full Screen" ) ); #endif @@ -953,6 +959,12 @@ TomahawkWindow::fullScreenExited() TomahawkSettings::instance()->setFullscreenEnabled( false ); statusBar()->setSizeGripEnabled( true ); + // Since we just enabled the size-grip the entire statusbar will shift a bit to the left + // The volume bar would now have too big a margin to the right screen edge. Prevent that. + QMargins margins = statusBar()->contentsMargins(); + margins.setRight( 0 ); + statusBar()->setContentsMargins( margins ); + #if defined( Q_WS_MAC ) ActionCollection::instance()->getAction( "fullscreen" )->setText( tr( "Enter Full Screen" ) ); #endif