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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
1 #ifndef __gui__sidebar_h
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
2 #define __gui__sidebar_h
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
3 #include <QItemSelectionModel>
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QListWidget>
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
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
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
7 Q_OBJECT
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
8
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 public:
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
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
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
13 bool IndexIsSeparator(QModelIndex index) const;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
14 static QIcon CreateIcon(const char* file);
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
15
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
16 signals:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
17 void CurrentItemChanged(int index);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
18
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
19 protected:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
20 virtual void mouseMoveEvent(QMouseEvent* event) override;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
21 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index,
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
22 const QEvent* event) const override;
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
23 int RemoveSeparatorsFromIndex(int index);
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 };
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
25 #endif // __gui__sidebar_h