mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
edit field for minimum number of players to allow multi-column layout for
This commit is contained in:
parent
aa38733f03
commit
d2d06b853f
5 changed files with 29 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "zoneviewwidget.h"
|
||||
#include "zoneviewzone.h"
|
||||
#include "phasestoolbar.h"
|
||||
#include "settingscache.h"
|
||||
#include <math.h>
|
||||
#include <QAction>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
|
|
@ -14,6 +15,7 @@ GameScene::GameScene(PhasesToolbar *_phasesToolbar, QObject *parent)
|
|||
{
|
||||
animationTimer = new QBasicTimer;
|
||||
addItem(phasesToolbar);
|
||||
connect(settingsCache, SIGNAL(minPlayersForMultiColumnLayoutChanged()), this, SLOT(rearrange()));
|
||||
}
|
||||
|
||||
GameScene::~GameScene()
|
||||
|
|
@ -59,7 +61,7 @@ void GameScene::rearrange()
|
|||
if (firstPlayer == -1)
|
||||
firstPlayer = 0;
|
||||
const int playersCount = playersPlaying.size();
|
||||
const int columns = playersCount < 4 ? 1 : 2;
|
||||
const int columns = playersCount < settingsCache->getMinPlayersForMultiColumnLayout() ? 1 : 2;
|
||||
const int rows = ceil((qreal) playersCount / columns);
|
||||
|
||||
qreal sceneHeight = 0, sceneWidth = -playerAreaSpacing;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue