diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/gui/sidebar.h	Sun Sep 10 03:59:16 2023 -0400
@@ -0,0 +1,25 @@
+#ifndef __gui__sidebar_h
+#define __gui__sidebar_h
+#include <QItemSelectionModel>
+#include <QListWidget>
+#include <QListWidgetItem>
+class SideBar : public QListWidget {
+		Q_OBJECT
+
+	public:
+		SideBar(QWidget* parent = nullptr);
+		QListWidgetItem* AddItem(QString name, QIcon icon = QIcon());
+		QListWidgetItem* AddSeparator();
+		bool IndexIsSeparator(QModelIndex index) const;
+		static QIcon CreateIcon(const char* file);
+
+	signals:
+		void CurrentItemChanged(int index);
+
+	protected:
+		virtual void mouseMoveEvent(QMouseEvent* event) override;
+		QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index,
+															 const QEvent* event) const override;
+		int RemoveSeparatorsFromIndex(int index);
+};
+#endif // __gui__sidebar_h