Mercurial > minori
diff src/gui/pages/now_playing.cpp @ 66:6481c5aed3e1
posters: add poster widget...
why does AniList call these cover images? they're posters...
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 02 Oct 2023 05:56:32 -0400 |
parents | fe719c109dbc |
children | 2417121d894e |
line wrap: on
line diff
--- a/src/gui/pages/now_playing.cpp Sun Oct 01 23:26:35 2023 -0400 +++ b/src/gui/pages/now_playing.cpp Mon Oct 02 05:56:32 2023 -0400 @@ -21,13 +21,7 @@ public: Playing(QWidget* parent = nullptr); - - void SetPlayingAnime(int id) { - if (info.get()) - layout()->removeWidget(info.get()); - info.reset(new AnimeInfoWidget(Anime::db.items[id])); - layout()->addWidget(info.get()); - } + void SetPlayingAnime(int id); private: std::unique_ptr<AnimeInfoWidget> info = nullptr; @@ -41,10 +35,18 @@ } Playing::Playing(QWidget* parent) : QWidget(parent) { - QVBoxLayout* layout = new QVBoxLayout(this); + QHBoxLayout* layout = new QHBoxLayout(this); + layout->setContentsMargins(0, 0, 0, 0); } +void Playing::SetPlayingAnime(int id) { + if (info.get()) + layout()->removeWidget(info.get()); + info.reset(new AnimeInfoWidget(Anime::db.items[id])); + layout()->addWidget(info.get()); +} + } // namespace NowPlayingPages NowPlayingPage::NowPlayingPage(QWidget* parent) : QFrame(parent) {