From 193335248b00556f0011b7e32b148a7a2c0eefe2 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Tue, 20 Oct 2015 15:03:41 +0200
Subject: Change window icon to default avatar on Windows

The task bar in Windows 10 has black as the default color.
The mainly black Swift application icon is hardly visible on
black background. Thus this patch changes the Window icon
on Windows to the default avatar icon in Swift.

Test-Information:

Tested on Windows 8 and Windows 10.

Change-Id: I1965cf37ba5a714094cff24ab971c0fc9f9d7fe1

diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 1e771ff..17176a9 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
  * All rights reserved.
  * See the COPYING file for more information.
  */
@@ -56,8 +56,12 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream, SettingsProvider* set
 
 	setWindowTitle("Swift");
 #ifndef Q_OS_MAC
+#ifdef  Q_OS_WIN32
+	setWindowIcon(QIcon(":/logo-icon-16-win.png"));
+#else
 	setWindowIcon(QIcon(":/logo-icon-16.png"));
 #endif
+#endif
 	QtUtilities::setX11Resource(this, "Main");
 	setAccessibleName(tr("Swift Login Window"));
 	//setAccessibleDescription(tr("This window is used for providing credentials to log into your XMPP service"));
diff --git a/Swift/QtUI/Swift.qrc b/Swift/QtUI/Swift.qrc
index eeef80d..0478d76 100644
--- a/Swift/QtUI/Swift.qrc
+++ b/Swift/QtUI/Swift.qrc
@@ -2,6 +2,7 @@
 <RCC version="1.0">
 	<qresource>
 		<file alias="logo-icon-16.png">../resources/logo/logo-icon-16.png</file>
+		<file alias="logo-icon-16-win.png">../resources/logo/logo-icon-16-win.png</file>
 		<file alias="logo-chat-16.png">../resources/logo/logo-chat-16.png</file>
 		<file alias="logo-shaded-text.256.png">../resources/logo/logo-shaded-text.256.png</file>
 		<file alias="icons/online.png">../resources/icons/online.png</file>
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index bb6fc31..52b17b0 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -39,8 +39,12 @@ namespace Swift {
 QtUserSearchWindow::QtUserSearchWindow(UIEventStream* eventStream, UserSearchWindow::Type type, const std::set<std::string>& groups, SettingsProvider* settingsProvider) : eventStream_(eventStream), type_(type), model_(NULL), firstMultiJIDPage_(NULL), settings_(settingsProvider), searchNext_(false), supportsImpromptu_(false) {
 	setupUi(this);
 #ifndef Q_OS_MAC
+#ifdef  Q_OS_WIN32
+	setWindowIcon(QIcon(":/logo-icon-16-win.png"));
+#else
 	setWindowIcon(QIcon(":/logo-icon-16.png"));
 #endif
+#endif
 	QString title;
 	switch(type) {
 		case AddContact:
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
index 89de95e..916246c 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
@@ -4,30 +4,41 @@
  * See Documentation/Licenses/BSD-simplified.txt for more information.
  */
 
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
 #include "QtWhiteboardWindow.h"
 
 #include <iostream>
 
 #include <boost/bind.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
 #include <boost/numeric/conversion/cast.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
 
-#include <Swiften/Whiteboard/WhiteboardSession.h>
-#include <Swiften/Elements/WhiteboardPayload.h>
+#include <QLabel>
+#include <QMessageBox>
+
+#include <Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h>
 #include <Swiften/Elements/Whiteboard/WhiteboardLineElement.h>
 #include <Swiften/Elements/Whiteboard/WhiteboardRectElement.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h>
 #include <Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h>
-#include <Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h>
+#include <Swiften/Elements/WhiteboardPayload.h>
+#include <Swiften/Whiteboard/WhiteboardSession.h>
 
-#include <QMessageBox>
-#include <QLabel>
+#include <Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h>
 
 namespace Swift {
 	QtWhiteboardWindow::QtWhiteboardWindow(WhiteboardSession::ref whiteboardSession) : QWidget() {
 #ifndef Q_OS_MAC
-		setWindowIcon(QIcon(":/logo-icon-16.png"));
+#ifdef  Q_OS_WIN32
+	setWindowIcon(QIcon(":/logo-icon-16-win.png"));
+#else
+	setWindowIcon(QIcon(":/logo-icon-16.png"));
+#endif
 #endif
 		layout = new QVBoxLayout(this);
 		hLayout = new QHBoxLayout;
diff --git a/Swift/resources/logo/logo-icon-16-win.png b/Swift/resources/logo/logo-icon-16-win.png
new file mode 100644
index 0000000..84642b9
Binary files /dev/null and b/Swift/resources/logo/logo-icon-16-win.png differ
-- 
cgit v0.10.2-6-g49f6