Allow selecting the search result when searching for buffers
[quassel.git] / src / uisupport / bufferview.h
index d2f577a..feb48a1 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2016 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -69,6 +69,9 @@ public slots:
     void previousBuffer();
     void hideCurrentBuffer();
     void filterTextChanged(QString filterString);
+    void changeHighlight(const Direction direction);
+    void selectHighlighted();
+    void clearHighlight();
 
 signals:
     void removeBuffer(const QModelIndex &);
@@ -132,6 +135,7 @@ private:
         WasActive = 0x02
     };
     QHash<NetworkId, short> _expandedState;
+    QModelIndex m_currentHighlight;
 };
 
 
@@ -145,10 +149,13 @@ class BufferViewDelegate : public QStyledItemDelegate
 
 public:
     BufferViewDelegate(QObject *parent = 0);
-    bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);
+    bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
+
+    QModelIndex currentHighlight;
+    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
 
 protected:
-    virtual void customEvent(QEvent *event);
+    virtual void customEvent(QEvent *event) override;
 };