Mercurial > minori
annotate 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 |
rev | line source |
---|---|
9 | 1 #ifndef __gui__sidebar_h |
2 #define __gui__sidebar_h | |
3 #include <QItemSelectionModel> | |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
4 #include <QListWidget> |
7 | 5 #include <QListWidgetItem> |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
6 class SideBar : public QListWidget { |
9 | 7 Q_OBJECT |
7 | 8 |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
9 public: |
9 | 10 SideBar(QWidget* parent = nullptr); |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
11 QListWidgetItem* AddItem(QString name, QIcon icon = QIcon()); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
12 QListWidgetItem* AddSeparator(); |
7 | 13 bool IndexIsSeparator(QModelIndex index) const; |
9 | 14 static QIcon CreateIcon(const char* file); |
7 | 15 |
16 signals: | |
17 void CurrentItemChanged(int index); | |
18 | |
19 protected: | |
20 virtual void mouseMoveEvent(QMouseEvent* event) override; | |
9 | 21 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index, |
22 const QEvent* event) const override; | |
7 | 23 int RemoveSeparatorsFromIndex(int index); |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
24 }; |
9 | 25 #endif // __gui__sidebar_h |