view 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
line wrap: on
line source

#ifndef __sidebar_h
#define __sidebar_h
#include <QListWidget>
#include <QListWidgetItem>
#include <QItemSelectionModel>
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;

	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 // __sidebar_h