Mercurial > minori
view include/gui/widgets/sidebar.h @ 79:c489dd4434af
*: what did I do again?
I really forgot what I did here :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Thu, 12 Oct 2023 11:31:39 -0400 |
parents | 27a19dd6cba1 |
children | c69230dc2b5d |
line wrap: on
line source
#ifndef __gui__sidebar_h #define __gui__sidebar_h #include <QItemSelectionModel> #include <QListWidget> #include <QListWidgetItem> class SideBar : public QListWidget { Q_OBJECT public: SideBar(QWidget* parent = nullptr); QListWidgetItem* AddItem(QString name, QIcon icon = QIcon()); QListWidgetItem* AddSeparator(); bool IndexIsSeparator(QModelIndex index) const; static QIcon CreateIcon(const char* file); void SetBackgroundColor(QColor color); signals: void CurrentItemChanged(int index); public slots: void SetCurrentItem(int index); protected: virtual void mouseMoveEvent(QMouseEvent* event) override; QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index, const QEvent* event) const override; int RemoveSeparatorsFromIndex(int index); int AddSeparatorsToIndex(int index); }; #endif // __gui__sidebar_h