Stretch teamselwidget across whole page in local multiplayer page
authorWuzzy <almikes@aol.com>
Sat, 22 Apr 2017 04:17:51 +0200
changeset 12298 91ebbadc461d
parent 12297 071a05275798
child 12299 6b25d117a904
Stretch teamselwidget across whole page in local multiplayer page
QTfrontend/ui/page/pagemultiplayer.cpp
QTfrontend/ui/widget/teamselect.cpp
QTfrontend/ui/widget/teamselect.h
--- 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;
 }
--- 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);
--- 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;