[kde-doc-english] [trojita] src: GUI: use different icons for different window roles

Jan Kundrát jkt at flaska.net
Wed Dec 4 16:05:30 UTC 2013


Git commit a6c89e9363944d46a1db9d217343345ed174612c by Jan Kundrát.
Committed on 27/11/2013 at 18:00.
Pushed by jkt into branch 'master'.

GUI: use different icons for different window roles

I'm experimenting with a vertical DE panel which means that I only get an icon
for each window which makes it pretty hard to distinguish among them. Let's use
different icons for the main application window, for an individual message, for
the composer and for the headers/source view.

v2: Use Thomas' icons for the composer

M  +2    -0    src/Gui/CompleteMessageWidget.cpp
M  +5    -0    src/Gui/ComposeWidget.cpp
M  +2    -0    src/Gui/MessageSourceWidget.cpp
M  +1    -0    src/Gui/Window.cpp
M  +2    -0    src/icons.qrc

http://commits.kde.org/trojita/a6c89e9363944d46a1db9d217343345ed174612c

diff --git a/src/Gui/CompleteMessageWidget.cpp b/src/Gui/CompleteMessageWidget.cpp
index fa3b558..f423eb3 100644
--- a/src/Gui/CompleteMessageWidget.cpp
+++ b/src/Gui/CompleteMessageWidget.cpp
@@ -27,12 +27,14 @@
 #include <QScrollBar>
 #include <QVBoxLayout>
 #include "Gui/FindBar.h"
+#include "Gui/IconLoader.h"
 #include "Gui/MessageView.h"
 
 namespace Gui {
 
 CompleteMessageWidget::CompleteMessageWidget(QWidget *parent, QSettings *settings): QWidget(parent)
 {
+    setWindowIcon(loadIcon(QLatin1String("mail-mark-read")));
     messageView = new MessageView(this, settings);
     area = new QScrollArea();
     area->setWidget(messageView);
diff --git a/src/Gui/ComposeWidget.cpp b/src/Gui/ComposeWidget.cpp
index 64c1d4c..6954646 100644
--- a/src/Gui/ComposeWidget.cpp
+++ b/src/Gui/ComposeWidget.cpp
@@ -79,6 +79,11 @@ ComposeWidget::ComposeWidget(MainWindow *mainWindow, QSettings *settings, MSA::M
 {
     setAttribute(Qt::WA_DeleteOnClose, true);
 
+    QIcon winIcon;
+    winIcon.addFile(QLatin1String(":/icons/trojita-edit-big.png"), QSize(128, 128));
+    winIcon.addFile(QLatin1String(":/icons/trojita-edit-small.png"), QSize(22, 22));
+    setWindowIcon(winIcon);
+
     Q_ASSERT(m_mainWindow);
     m_submission = new Composer::Submission(this, m_mainWindow->imapModel(), msaFactory);
     connect(m_submission, SIGNAL(succeeded()), this, SLOT(sent()));
diff --git a/src/Gui/MessageSourceWidget.cpp b/src/Gui/MessageSourceWidget.cpp
index 23650b3..e9fce11 100644
--- a/src/Gui/MessageSourceWidget.cpp
+++ b/src/Gui/MessageSourceWidget.cpp
@@ -22,6 +22,7 @@
 
 #include "MessageSourceWidget.h"
 #include <QModelIndex>
+#include "Gui/IconLoader.h"
 #include "Gui/Spinner.h"
 #include "Imap/Model/FullMessageCombiner.h"
 
@@ -31,6 +32,7 @@ namespace Gui
 MessageSourceWidget::MessageSourceWidget(QWidget *parent, const QModelIndex &messageIndex):
     QWebView(parent), m_combiner(0), m_loadingSpinner(0)
 {
+    setWindowIcon(loadIcon(QLatin1String("text-x-hex")));
     Q_ASSERT(messageIndex.isValid());
     page()->setNetworkAccessManager(0);
 
diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index cfc578a..a127593 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -1816,6 +1816,7 @@ void MainWindow::slotViewMsgHeaders()
                                     QString::number(messageIndex.data(Imap::Mailbox::RoleMessageUid).toUInt()),
                                     messageIndex.parent().parent().data(Imap::Mailbox::RoleMailboxName).toString()
                                     ));
+        headers->setWindowIcon(loadIcon(QLatin1String("text-x-hex")));
         headers->show();
     }
 }
diff --git a/src/icons.qrc b/src/icons.qrc
index 0791325..307df4d 100644
--- a/src/icons.qrc
+++ b/src/icons.qrc
@@ -42,5 +42,7 @@
         <file>icons/contact-known.svg</file>
         <file>icons/contact-unknown.svgz</file>
         <file>icons/trojita-144.png</file>
+        <file>icons/trojita-edit-small.png</file>
+        <file>icons/trojita-edit-big.png</file>
     </qresource>
 </RCC>



More information about the kde-doc-english mailing list