comparison include/gui/sidebar.h @ 9:5c0397762b53

INCOMPLETE: megacommit :)
author Paper <mrpapersonic@gmail.com>
date Sun, 10 Sep 2023 03:59:16 -0400
parents src/include/sidebar.h@07a9095eaeed
children 4b198a111713
comparison
equal deleted inserted replaced
8:b1f73678ef61 9:5c0397762b53
1 #ifndef __gui__sidebar_h
2 #define __gui__sidebar_h
3 #include <QItemSelectionModel>
4 #include <QListWidget>
5 #include <QListWidgetItem>
6 class SideBar : public QListWidget {
7 Q_OBJECT
8
9 public:
10 SideBar(QWidget* parent = nullptr);
11 QListWidgetItem* AddItem(QString name, QIcon icon = QIcon());
12 QListWidgetItem* AddSeparator();
13 bool IndexIsSeparator(QModelIndex index) const;
14 static QIcon CreateIcon(const char* file);
15
16 signals:
17 void CurrentItemChanged(int index);
18
19 protected:
20 virtual void mouseMoveEvent(QMouseEvent* event) override;
21 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index,
22 const QEvent* event) const override;
23 int RemoveSeparatorsFromIndex(int index);
24 };
25 #endif // __gui__sidebar_h