Mercurial > minori
annotate src/include/sidebar.h @ 8:b1f73678ef61
update
text paragraphs are now their own objects, as they should be
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Sat, 26 Aug 2023 03:39:34 -0400 |
| parents | 07a9095eaeed |
| children |
| rev | line source |
|---|---|
|
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
1 #ifndef __sidebar_h |
|
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
2 #define __sidebar_h |
|
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
3 #include <QListWidget> |
| 7 | 4 #include <QListWidgetItem> |
| 5 #include <QItemSelectionModel> | |
|
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
6 class SideBar : public QListWidget { |
| 7 | 7 Q_OBJECT |
| 8 | |
|
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
9 public: |
|
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
10 SideBar(QWidget *parent = nullptr); |
|
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; |
| 14 | |
| 15 signals: | |
| 16 void CurrentItemChanged(int index); | |
| 17 | |
| 18 protected: | |
| 19 virtual void mouseMoveEvent(QMouseEvent* event) override; | |
| 20 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex & index, const QEvent * event) const override; | |
| 21 int RemoveSeparatorsFromIndex(int index); | |
|
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
22 }; |
|
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
23 #endif // __sidebar_h |
