From 94d7b0822e041740232f9d4b0f1e0f9f3dee1dd4 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 20 Nov 2010 23:30:07 +0000
Subject: Logo should stay in the centre when login window is resized.

Resolves: #675
Release-Notes: The Swift logo will now remain in the centre when the login window is resized.

diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 3d508cf..4bf5691 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -19,6 +19,7 @@
 #include <QToolButton>
 #include <QLabel>
 #include <QMenuBar>
+#include <QHBoxLayout>
 #include <qdebug.h>
 
 #include "Swift/Controllers/UIEvents/UIEventStream.h"
@@ -60,7 +61,16 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {
 	logo->setPixmap(QPixmap(":/logo-shaded-text.256.png"));
 	logo->setScaledContents(true);
 	logo->setFixedSize(192,192);
-	layout->addWidget(logo);
+
+	QWidget *logoWidget = new QWidget(this);
+	QHBoxLayout *logoLayout = new QHBoxLayout();
+	logoLayout->setMargin(0);
+	logoLayout->addStretch(0);
+	logoLayout->addWidget(logo);
+	logoLayout->addStretch(0);
+	logoWidget->setLayout(logoLayout);
+	layout->addWidget(logoWidget);
+
 	layout->addStretch(2);
 
 	QLabel* jidLabel = new QLabel(this);
-- 
cgit v0.10.2-6-g49f6