Mercurial > minori
comparison src/gui/pages/now_playing.cpp @ 68:2417121d894e
*: normalize usage of layouts
before, I used them two ways, once was by setting the layout later
by using setLayout(QWidget), and the other was just using the constructor.
I find the constructor to be easier to read, so I chose that one.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 02 Oct 2023 21:33:25 -0400 |
parents | 6481c5aed3e1 |
children | 27a19dd6cba1 |
comparison
equal
deleted
inserted
replaced
67:442065432549 | 68:2417121d894e |
---|---|
34 layout->addStretch(); | 34 layout->addStretch(); |
35 } | 35 } |
36 | 36 |
37 Playing::Playing(QWidget* parent) : QWidget(parent) { | 37 Playing::Playing(QWidget* parent) : QWidget(parent) { |
38 QHBoxLayout* layout = new QHBoxLayout(this); | 38 QHBoxLayout* layout = new QHBoxLayout(this); |
39 | 39 |
40 layout->setContentsMargins(0, 0, 0, 0); | 40 layout->setContentsMargins(0, 0, 0, 0); |
41 } | 41 } |
42 | 42 |
43 void Playing::SetPlayingAnime(int id) { | 43 void Playing::SetPlayingAnime(int id) { |
44 if (info.get()) | 44 if (info.get()) |
66 stack = new QStackedWidget(this); | 66 stack = new QStackedWidget(this); |
67 stack->addWidget(new NowPlayingPages::Default(stack)); | 67 stack->addWidget(new NowPlayingPages::Default(stack)); |
68 stack->addWidget(new NowPlayingPages::Playing(stack)); | 68 stack->addWidget(new NowPlayingPages::Playing(stack)); |
69 layout->addWidget(stack); | 69 layout->addWidget(stack); |
70 | 70 |
71 layout->addStretch(); | |
72 SetDefault(); | 71 SetDefault(); |
73 } | 72 } |
74 | 73 |
75 void NowPlayingPage::SetDefault() { | 74 void NowPlayingPage::SetDefault() { |
76 stack->setCurrentIndex(0); | 75 stack->setCurrentIndex(0); |