X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.h;h=feb48a11b0a378f7c605e041d41df77f08bf1b35;hp=26102fd256e66cd9ba2837c0acebef761104953a;hb=5c4459d5df51a99bc6ee2e7389e3a7aec3f81091;hpb=efee441a243efb88929e1e275d71ee27991bf074 diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 26102fd2..feb48a11 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -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,13 +69,15 @@ public slots: void previousBuffer(); void hideCurrentBuffer(); void filterTextChanged(QString filterString); + void changeHighlight(const Direction direction); + void selectHighlighted(); + void clearHighlight(); signals: void removeBuffer(const QModelIndex &); void removeBufferPermanently(const QModelIndex &); protected: - virtual void keyPressEvent(QKeyEvent *); virtual void dropEvent(QDropEvent *event); virtual void rowsInserted(const QModelIndex &parent, int start, int end); virtual void wheelEvent(QWheelEvent *); @@ -133,6 +135,7 @@ private: WasActive = 0x02 }; QHash _expandedState; + QModelIndex m_currentHighlight; }; @@ -146,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; }; @@ -169,6 +175,7 @@ public : inline BufferView *bufferView() const { return qobject_cast(widget()); } inline bool isActive() const { return _active; } void setWidget(QWidget *newWidget); + void setLocked(bool locked); QWidget *widget() const { return _childWidget; } void activateFilter();