Add new logo for the main page
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 11 Feb 2009 18:39:45 +0000 (19:39 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 11 Feb 2009 19:12:48 +0000 (20:12 +0100)
Probably only temporary until Nuno Pinheiro is kind enough to do more gorgeous artwork,
but better than the old thing. Also we now have smooth scaling if the logo doesn't fit
in its original size...

pics/pics.qrc
pics/quassel-large.png [deleted file]
pics/quassel-logo.png [new file with mode: 0644]
pics/quassel-logo.svgz [new file with mode: 0644]
src/qtui/CMakeLists.txt
src/qtui/mainpage.cpp [new file with mode: 0644]
src/qtui/mainpage.h [new file with mode: 0644]
src/qtui/ui/bufferwidget.ui

index b3aa529..7ec8223 100644 (file)
@@ -1,6 +1,6 @@
 <RCC>
   <qresource prefix="/pics" >
-    <file>quassel-large.png</file>
+    <file>quassel-logo.png</file>
     <file>qt-logo.png</file>
   </qresource>
 </RCC>
diff --git a/pics/quassel-large.png b/pics/quassel-large.png
deleted file mode 100644 (file)
index 4b68972..0000000
Binary files a/pics/quassel-large.png and /dev/null differ
diff --git a/pics/quassel-logo.png b/pics/quassel-logo.png
new file mode 100644 (file)
index 0000000..40c41f3
Binary files /dev/null and b/pics/quassel-logo.png differ
diff --git a/pics/quassel-logo.svgz b/pics/quassel-logo.svgz
new file mode 100644 (file)
index 0000000..a573c6c
Binary files /dev/null and b/pics/quassel-logo.svgz differ
index ca17c3a..492c50a 100644 (file)
@@ -31,6 +31,7 @@ set(SOURCES
     debugmessagemodelfilter.cpp
     inputwidget.cpp
     jumpkeyhandler.cpp
+    mainpage.cpp
     mainwin.cpp
     msgprocessorstatuswidget.cpp
     nicklistwidget.cpp
@@ -73,6 +74,7 @@ set(MOC_HDRS
     debugmessagemodelfilter.h
     inputwidget.h
     jumpkeyhandler.h
+    mainpage.h
     mainwin.h
     msgprocessorstatuswidget.h
     nicklistwidget.h
diff --git a/src/qtui/mainpage.cpp b/src/qtui/mainpage.cpp
new file mode 100644 (file)
index 0000000..0939294
--- /dev/null
@@ -0,0 +1,45 @@
+/***************************************************************************
+*   Copyright (C) 2005-09 by the Quassel Project                          *
+*   devel@quassel-irc.org                                                 *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) version 3.                                           *
+*                                                                         *
+*   This program is distributed in the hope that it will be useful,       *
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+*   GNU General Public License for more details.                          *
+*                                                                         *
+*   You should have received a copy of the GNU General Public License     *
+*   along with this program; if not, write to the                         *
+*   Free Software Foundation, Inc.,                                       *
+*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+***************************************************************************/
+
+#include <QImage>
+#include <QPainter>
+
+#include "mainpage.h"
+
+MainPage::MainPage(QWidget *parent) : QWidget(parent) {
+
+
+}
+
+void MainPage::paintEvent(QPaintEvent *event) {
+  Q_UNUSED(event);
+
+  QPainter painter(this);
+  QImage img(":/pics/quassel-logo.png"); // FIXME load externally
+
+  if(img.height() > height() || img.width() > width())
+    img = img.scaled(width(), height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
+
+  qreal xmargin = (width() - img.width()) / 2;
+  qreal ymargin = (height() - img.height()) / 2;
+
+  painter.drawImage(xmargin, ymargin, img);
+
+}
diff --git a/src/qtui/mainpage.h b/src/qtui/mainpage.h
new file mode 100644 (file)
index 0000000..1d1e35d
--- /dev/null
@@ -0,0 +1,38 @@
+/***************************************************************************
+*   Copyright (C) 2005-09 by the Quassel Project                          *
+*   devel@quassel-irc.org                                                 *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) version 3.                                           *
+*                                                                         *
+*   This program is distributed in the hope that it will be useful,       *
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+*   GNU General Public License for more details.                          *
+*                                                                         *
+*   You should have received a copy of the GNU General Public License     *
+*   along with this program; if not, write to the                         *
+*   Free Software Foundation, Inc.,                                       *
+*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+***************************************************************************/
+
+#ifndef MAINPAGE_H_
+#define MAINPAGE_H_
+
+#include <QWidget>
+
+class MainPage : public QWidget {
+  Q_OBJECT
+
+public:
+  MainPage(QWidget *parent = 0);
+
+protected:
+  void paintEvent(QPaintEvent *event);
+
+
+};
+
+#endif
index 93de974..9cf2689 100644 (file)
@@ -1,90 +1,52 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>BufferWidget</class>
- <widget class="QWidget" name="BufferWidget" >
-  <property name="geometry" >
+ <widget class="QWidget" name="BufferWidget">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>782</width>
-    <height>542</height>
+    <width>613</width>
+    <height>434</height>
    </rect>
   </property>
-  <property name="sizePolicy" >
-   <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     <horstretch>5</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
-  <property name="minimumSize" >
+  <property name="minimumSize">
    <size>
     <width>200</width>
     <height>100</height>
    </size>
   </property>
-  <property name="contextMenuPolicy" >
+  <property name="contextMenuPolicy">
    <enum>Qt::DefaultContextMenu</enum>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string/>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout" >
+  <layout class="QHBoxLayout" name="horizontalLayout">
    <item>
-    <widget class="QStackedWidget" name="stackedWidget" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+    <widget class="QStackedWidget" name="stackedWidget">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="currentIndex" >
+     <property name="currentIndex">
       <number>0</number>
      </property>
-     <widget class="QWidget" name="page" >
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <item>
-        <widget class="QFrame" name="frame" >
-         <property name="frameShape" >
-          <enum>QFrame::StyledPanel</enum>
-         </property>
-         <property name="frameShadow" >
-          <enum>QFrame::Plain</enum>
-         </property>
-         <layout class="QVBoxLayout" >
-          <item>
-           <widget class="QLabel" name="label" >
-            <property name="font" >
-             <font>
-              <family>Trebuchet MS</family>
-             </font>
-            </property>
-            <property name="text" >
-             <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Trebuchet MS'; font-size:13pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;img src=":/pics/quassel-large.png" />&lt;span style=" font-size:89pt; color:#00008b;">uassel IRC&lt;/span>&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:49pt;">&lt;span style=" font-size:22pt;">Chat comfortably. Anywhere.&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
-            </property>
-            <property name="scaledContents" >
-             <bool>true</bool>
-            </property>
-            <property name="alignment" >
-             <set>Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignTop|Qt::AlignVCenter|Qt::AlignVertical_Mask</set>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-      </layout>
+     <widget class="MainPage" name="page">
+      <layout class="QVBoxLayout" name="verticalLayout"/>
      </widget>
     </widget>
    </item>
    <item>
-    <widget class="ChatViewSearchBar" native="1" name="searchBar" />
+    <widget class="ChatViewSearchBar" name="searchBar" native="true"/>
    </item>
   </layout>
  </widget>
@@ -92,12 +54,18 @@ p, li { white-space: pre-wrap; }
   <customwidget>
    <class>ChatViewSearchBar</class>
    <extends>QWidget</extends>
-   <header location="global" >chatviewsearchbar.h</header>
+   <header location="global">chatviewsearchbar.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>MainPage</class>
+   <extends>QWidget</extends>
+   <header>mainpage.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
  <resources>
-  <include location="../../../pics/pics.qrc" />
+  <include location="../../../pics/pics.qrc"/>
  </resources>
  <connections/>
 </ui>