Mercurial > minori
view include/gui/widgets/sidebar.h @ 369:47c9f8502269
*: clang-format all the things
I've edited the formatting a bit. Now pointer asterisks (and reference
ampersands) are on the variable instead of the type, as well as having
newlines for function braces (but nothing else)
author | Paper <paper@tflc.us> |
---|---|
date | Fri, 25 Jul 2025 10:16:02 -0400 |
parents | 99cbc51433e4 |
children |
line wrap: on
line source
#ifndef MINORI_GUI_WIDGETS_SIDEBAR_H_ #define MINORI_GUI_WIDGETS_SIDEBAR_H_ #include <QItemSelectionModel> #include <QListWidget> class QListWidgetItem; class SideBar final : public QListWidget { Q_OBJECT public: SideBar(QWidget* parent = nullptr); QListWidgetItem* AddItem(QString name, QIcon icon = QIcon()); QListWidgetItem* AddSeparator(); int GetCurrentItem(); bool IndexIsSeparator(QModelIndex index) const; static QIcon CreateIcon(const char* file); void SetBackgroundTransparent(bool yes); signals: void CurrentItemChanged(int index); public slots: void SetCurrentItem(int index); protected: virtual void mouseMoveEvent(QMouseEvent* event) override; QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex& index, const QEvent* event) const override; int RemoveSeparatorsFromIndex(int index); int AddSeparatorsToIndex(int index); }; #endif // MINORI_GUI_WIDGETS_SIDEBAR_H_