Skip to content
Snippets Groups Projects
Commit 19579217 authored by Nick Draper's avatar Nick Draper
Browse files

dynamically resize spalsh screen image based on screen resolution

This should resolve some of the Huge splash screens we get with the workbench sometimes.

It also means we only have to maintain one splash screen image and not two resolutions of the same thing.
parent 6deec404
Branches 22031_phaseQuadGUI
No related tags found
No related merge requests found
......@@ -121,17 +121,19 @@ MAIN_APP = qapplication()
atexit.register(qCleanupResources)
def _get_splash_image_name():
def _get_splash_image():
# gets the width of the screen where the main window was initialised
width = QGuiApplication.primaryScreen().size().width()
height = QGuiApplication.primaryScreen().size().height()
if width > 2048:
return ':/images/MantidSplashScreen_4k.jpg'
else:
return ':/images/MantidSplashScreen.png'
# the proportion of the whole window size for the splash screen
splash_screen_scaling = 0.2
return QPixmap(':/images/MantidSplashScreen_4k.jpg').scaled(width * splash_screen_scaling,
height * splash_screen_scaling,
Qt.KeepAspectRatio,
Qt.SmoothTransformation)
SPLASH = QSplashScreen(QPixmap(_get_splash_image_name()),
SPLASH = QSplashScreen(_get_splash_image(),
Qt.WindowStaysOnTopHint)
SPLASH.show()
SPLASH.showMessage("Starting...", Qt.AlignBottom | Qt.AlignLeft
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment