# HG changeset patch # User Wuzzy # Date 1492827471 -7200 # Node ID 91ebbadc461d9cd5820ba08f87b0c6f205909ff5 # Parent 071a05275798f419895690fabdaa3ff71c7bdf90 Stretch teamselwidget across whole page in local multiplayer page diff -r 071a05275798 -r 91ebbadc461d QTfrontend/ui/page/pagemultiplayer.cpp --- a/QTfrontend/ui/page/pagemultiplayer.cpp Sat Apr 22 02:33:32 2017 +0200 +++ b/QTfrontend/ui/page/pagemultiplayer.cpp Sat Apr 22 04:17:51 2017 +0200 @@ -34,10 +34,12 @@ QHBoxLayout * pageLayout = new QHBoxLayout(); gameCFG = new GameCFGWidget(this); - pageLayout->addWidget(gameCFG, 3, Qt::AlignTop); + pageLayout->addWidget(gameCFG); + pageLayout->setAlignment(gameCFG, Qt::AlignTop); teamsSelect = new TeamSelWidget(this); - pageLayout->addWidget(teamsSelect, 2, Qt::AlignTop); + pageLayout->addWidget(teamsSelect); + teamsSelect->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); return pageLayout; } diff -r 071a05275798 -r 91ebbadc461d QTfrontend/ui/widget/teamselect.cpp --- a/QTfrontend/ui/widget/teamselect.cpp Sat Apr 22 02:33:32 2017 +0200 +++ b/QTfrontend/ui/widget/teamselect.cpp Sat Apr 22 04:17:51 2017 +0200 @@ -229,15 +229,17 @@ emit setEnabledGameStart(curPlayingTeams.size()>1); } -void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int fixedHeight) +void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int minHeight, int maxHeight, bool setFrame) { VertScrArea* area = new VertScrArea(color); area->setWidget(pfteams); - mainLayout.addWidget(area, 30); - if (fixedHeight > 0) + mainLayout.addWidget(area); + if (minHeight > 0) + area->setMinimumHeight(minHeight); + if (maxHeight > 0) + area->setMaximumHeight(maxHeight); + if (setFrame) { - area->setMinimumHeight(fixedHeight); - area->setMaximumHeight(fixedHeight); area->setStyleSheet( "FrameTeams{" "border: solid;" @@ -263,8 +265,8 @@ QPalette p; p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); - addScrArea(framePlaying, p.color(QPalette::Window).light(105), 150); - addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); + addScrArea(framePlaying, p.color(QPalette::Window).light(105), 161, 325, true); + addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 80, 0, false); this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); this->setMinimumWidth(200); diff -r 071a05275798 -r 91ebbadc461d QTfrontend/ui/widget/teamselect.h --- a/QTfrontend/ui/widget/teamselect.h Sat Apr 22 02:33:32 2017 +0200 +++ b/QTfrontend/ui/widget/teamselect.h Sat Apr 22 04:17:51 2017 +0200 @@ -70,7 +70,7 @@ void proxyTeamColorChanged(const HWTeam& team); private: - void addScrArea(FrameTeams* pfteams, QColor color, int maxHeight); + void addScrArea(FrameTeams* pfteams, QColor color, int minHeight, int maxHeight, bool setFrame); FrameTeams* frameDontPlaying; FrameTeams* framePlaying;