Mercurial > minori
annotate src/include/sidebar.h @ 7:07a9095eaeed
Update
Refactored some code, moved some around
| author | Paper <mrpapersonic@gmail.com> | 
|---|---|
| date | Thu, 24 Aug 2023 23:11:38 -0400 | 
| parents | 1d82f6e04d7d | 
| 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 | 
