annotate include/gui/sidebar.h @ 24:b949a56b51dd

ci/win32: install xz why isn't this listed in the dependencies?? lol
author Paper <mrpapersonic@gmail.com>
date Tue, 19 Sep 2023 23:55:30 -0400
parents cde8f67a7c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
1 #ifndef __gui__sidebar_h
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
2 #define __gui__sidebar_h
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
3 #include <QItemSelectionModel>
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
4 #include <QListWidget>
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
5 #include <QListWidgetItem>
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
6 class SideBar : public QListWidget {
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
7 Q_OBJECT
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
8
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
9 public:
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
10 SideBar(QWidget* parent = nullptr);
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
11 QListWidgetItem* AddItem(QString name, QIcon icon = QIcon());
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
12 QListWidgetItem* AddSeparator();
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
13 bool IndexIsSeparator(QModelIndex index) const;
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
14 static QIcon CreateIcon(const char* file);
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
15
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
16 signals:
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
17 void CurrentItemChanged(int index);
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
18
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
19 protected:
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
20 virtual void mouseMoveEvent(QMouseEvent* event) override;
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
21 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index,
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 10
diff changeset
22 const QEvent* event) const override;
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
23 int RemoveSeparatorsFromIndex(int index);
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
24 };
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
25 #endif // __gui__sidebar_h