Mercurial > minori
diff include/gui/pages/anime_list.h @ 64:fe719c109dbc
*: update
1. add media tracking ability, and it displays info on the `now playing` page
2. the `now playing` page now actually shows something
3. renamed every page class to be more accurate to what it is
4. ...
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 01 Oct 2023 23:15:43 -0400 |
parents | 3d2decf093bb |
children | 6f7385bd334c |
line wrap: on
line diff
--- a/include/gui/pages/anime_list.h Sun Oct 01 06:39:47 2023 -0400 +++ b/include/gui/pages/anime_list.h Sun Oct 01 23:15:43 2023 -0400 @@ -8,27 +8,27 @@ #include <QWidget> #include <vector> -class AnimeListWidgetDelegate : public QStyledItemDelegate { +class AnimeListPageDelegate : public QStyledItemDelegate { Q_OBJECT public: - explicit AnimeListWidgetDelegate(QObject* parent); + explicit AnimeListPageDelegate(QObject* parent); QWidget* createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const override; void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; }; -class AnimeListWidgetSortFilter : public QSortFilterProxyModel { +class AnimeListPageSortFilter : public QSortFilterProxyModel { Q_OBJECT public: - AnimeListWidgetSortFilter(QObject* parent = nullptr); + AnimeListPageSortFilter(QObject* parent = nullptr); protected: bool lessThan(const QModelIndex& l, const QModelIndex& r) const override; }; -class AnimeListWidgetModel : public QAbstractListModel { +class AnimeListPageModel : public QAbstractListModel { Q_OBJECT public: @@ -48,8 +48,8 @@ NB_COLUMNS }; - AnimeListWidgetModel(QWidget* parent, Anime::ListStatus _status); - ~AnimeListWidgetModel() override = default; + AnimeListPageModel(QWidget* parent, Anime::ListStatus _status); + ~AnimeListPageModel() override = default; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role) const override; @@ -65,11 +65,11 @@ /* todo: rename these to "page" or something more sensible than "widget" */ -class AnimeListWidget : public QWidget { +class AnimeListPage : public QWidget { Q_OBJECT public: - AnimeListWidget(QWidget* parent); + AnimeListPage(QWidget* parent); void Refresh(); void Reset(); @@ -94,6 +94,6 @@ QTabBar* tab_bar; QTreeView* tree_view; QRect panelRect; - AnimeListWidgetSortFilter* sort_models[5]; + AnimeListPageSortFilter* sort_models[5]; }; #endif // __gui__pages__anime_list_h \ No newline at end of file