From 3886bc21b562e89accb18fe32b8b8477b8a52fa4 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Wed, 19 Feb 2014 17:19:02 +0400 Subject: [PATCH] Set location of splash screen basing on the current screen device. --- platform/platform-impl/src/com/intellij/ui/Splash.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/ui/Splash.java b/platform/platform-impl/src/com/intellij/ui/Splash.java index 7025b4461c44..8ef5a2a6f6ae 100644 --- a/platform/platform-impl/src/com/intellij/ui/Splash.java +++ b/platform/platform-impl/src/com/intellij/ui/Splash.java @@ -78,7 +78,12 @@ public class Splash extends JDialog implements StartupProgress { Dimension size = getPreferredSize(); setSize(size); pack(); - setLocationRelativeTo(null); + setLocationInTheCenterOfScreen(); + } + + private void setLocationInTheCenterOfScreen() { + Rectangle deviceBounds = getGraphicsConfiguration().getBounds(); + setLocation((deviceBounds.width - getWidth()) / 2, (deviceBounds.height - getHeight()) / 2); } public Splash(ApplicationInfoEx info) {