Mercurial > minori
diff src/gui/widgets/anime_button.cc @ 365:f81bed4e04ac
*: megacommit that probably breaks things
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 02 Oct 2024 23:06:43 -0400 |
parents | 6b0768158dcd |
children |
line wrap: on
line diff
--- a/src/gui/widgets/anime_button.cc Tue Jul 16 21:15:59 2024 -0400 +++ b/src/gui/widgets/anime_button.cc Wed Oct 02 23:06:43 2024 -0400 @@ -35,8 +35,7 @@ QHBoxLayout* ly = new QHBoxLayout(this); _poster.SetClickable(false); - _poster.setFixedSize(120, 170); - ly->addWidget(&_poster, 0, Qt::AlignTop); + ly->addWidget(&_poster, 1, Qt::AlignTop); const std::vector<std::pair<std::string, std::string>> imap = { {Strings::Translate("Aired:"), ""}, @@ -51,7 +50,6 @@ { QWidget* misc_section = new QWidget(this); - misc_section->setFixedSize(354, 180); QVBoxLayout* misc_layout = new QVBoxLayout(misc_section); misc_layout->setContentsMargins(0, 0, 0, 0); @@ -79,13 +77,12 @@ dummy_layout->setSpacing(0); dummy_layout->setContentsMargins(0, 0, 0, 0); - _synopsis.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); _synopsis.SetSelectable(false); dummy_layout->addWidget(&_synopsis); misc_layout->addWidget(dummy); } - ly->addWidget(misc_section, 0, Qt::AlignTop); + ly->addWidget(misc_section, 3, Qt::AlignTop); } } @@ -112,3 +109,11 @@ _synopsis.SetText(anime.GetSynopsis()); } + +bool AnimeButton::hasHeightForWidth() const { + return true; +} + +int AnimeButton::heightForWidth(int w) const { + return static_cast<int>(static_cast<double>(w) / 2.5); +}