ui: improve ui

- Implement PixbufManipulator
- Adapt contactDelegate and historyDelegate and
  smartListDelegate
- Add selection hint to smartList
- Add context menu to smartlist
- Rewrite the IM delegate
- Suppress chat button in favor of selection
- Various value passed to const member to avoid a lot of
  allocation
- Various indent fixes

Change-Id: Id8fdda04e16d8479f99eed060d668e1b0c7f9445
Tuleap: #148
Tuleap: #232
diff --git a/imdelegate.h b/imdelegate.h
index fe7e25a..ca66374 100644
--- a/imdelegate.h
+++ b/imdelegate.h
@@ -18,11 +18,8 @@
 
 #pragma once
 
-#include <QObject>
-#include <QApplication>
 #include <QPainter>
 #include <QStyledItemDelegate>
-#include <QSettings>
 
 class ImDelegate : public QStyledItemDelegate
 {
@@ -36,10 +33,18 @@
 
     void setDisplayOptions(DisplayOptions opt);
 protected:
-    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
-    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
+    void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
+    QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
 private:
     bool showDate_;
     bool showAuthor_;
+
+    void formatMsg(const QModelIndex& index, QString& msg) const;
+    QRect getBoundingRect(const Qt::AlignmentFlag& dir, const QString& msg, const QStyleOptionViewItem &option) const;
+
+    const QColor blue {"#3AC0D2"};
+    const QColor grey {"#f2f2f2"};
+    const QSize iconSize_ {38,38};
+    constexpr static int padding_ = 5;
 };