mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
inline layouts
This commit is contained in:
parent
d51620640b
commit
3414eb12cf
2 changed files with 14 additions and 14 deletions
|
|
@ -1538,7 +1538,7 @@ void TabGame::createPlayAreaWidget(bool bReplay)
|
||||||
scene = new GameScene(phasesToolbar, this);
|
scene = new GameScene(phasesToolbar, this);
|
||||||
gameView = new GameView(scene);
|
gameView = new GameView(scene);
|
||||||
|
|
||||||
gamePlayAreaVBox = new QVBoxLayout;
|
auto gamePlayAreaVBox = new QVBoxLayout;
|
||||||
gamePlayAreaVBox->setContentsMargins(0, 0, 0, 0);
|
gamePlayAreaVBox->setContentsMargins(0, 0, 0, 0);
|
||||||
gamePlayAreaVBox->addWidget(gameView);
|
gamePlayAreaVBox->addWidget(gameView);
|
||||||
|
|
||||||
|
|
@ -1594,7 +1594,7 @@ void TabGame::createReplayDock()
|
||||||
connect(replayFastForwardButton, &QToolButton::toggled, this, &TabGame::replayFastForwardButtonToggled);
|
connect(replayFastForwardButton, &QToolButton::toggled, this, &TabGame::replayFastForwardButtonToggled);
|
||||||
|
|
||||||
// putting everything together
|
// putting everything together
|
||||||
replayControlLayout = new QHBoxLayout;
|
auto replayControlLayout = new QHBoxLayout;
|
||||||
replayControlLayout->addWidget(timelineWidget, 10);
|
replayControlLayout->addWidget(timelineWidget, 10);
|
||||||
replayControlLayout->addWidget(replayPlayButton);
|
replayControlLayout->addWidget(replayPlayButton);
|
||||||
replayControlLayout->addWidget(replayFastForwardButton);
|
replayControlLayout->addWidget(replayFastForwardButton);
|
||||||
|
|
@ -1635,8 +1635,8 @@ void TabGame::createCardInfoDock(bool bReplay)
|
||||||
Q_UNUSED(bReplay);
|
Q_UNUSED(bReplay);
|
||||||
|
|
||||||
cardInfoFrameWidget = new CardInfoFrameWidget();
|
cardInfoFrameWidget = new CardInfoFrameWidget();
|
||||||
cardHInfoLayout = new QHBoxLayout;
|
auto cardHInfoLayout = new QHBoxLayout;
|
||||||
cardVInfoLayout = new QVBoxLayout;
|
auto cardVInfoLayout = new QVBoxLayout;
|
||||||
cardVInfoLayout->setContentsMargins(0, 0, 0, 0);
|
cardVInfoLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
cardVInfoLayout->addWidget(cardInfoFrameWidget);
|
cardVInfoLayout->addWidget(cardInfoFrameWidget);
|
||||||
cardVInfoLayout->addLayout(cardHInfoLayout);
|
cardVInfoLayout->addLayout(cardHInfoLayout);
|
||||||
|
|
@ -1679,12 +1679,17 @@ void TabGame::createPlayerListDock(bool bReplay)
|
||||||
|
|
||||||
void TabGame::createMessageDock(bool bReplay)
|
void TabGame::createMessageDock(bool bReplay)
|
||||||
{
|
{
|
||||||
|
auto messageLogLayout = new QVBoxLayout;
|
||||||
|
messageLogLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
messageLog = new MessageLogWidget(tabSupervisor, this);
|
messageLog = new MessageLogWidget(tabSupervisor, this);
|
||||||
connect(messageLog, &MessageLogWidget::cardNameHovered, cardInfoFrameWidget,
|
connect(messageLog, &MessageLogWidget::cardNameHovered, cardInfoFrameWidget,
|
||||||
qOverload<const QString &>(&CardInfoFrameWidget::setCard));
|
qOverload<const QString &>(&CardInfoFrameWidget::setCard));
|
||||||
connect(messageLog, &MessageLogWidget::showCardInfoPopup, this, &TabGame::showCardInfoPopup);
|
connect(messageLog, &MessageLogWidget::showCardInfoPopup, this, &TabGame::showCardInfoPopup);
|
||||||
connect(messageLog, &MessageLogWidget::deleteCardInfoPopup, this, &TabGame::deleteCardInfoPopup);
|
connect(messageLog, &MessageLogWidget::deleteCardInfoPopup, this, &TabGame::deleteCardInfoPopup);
|
||||||
|
|
||||||
|
messageLogLayout->addWidget(messageLog);
|
||||||
|
|
||||||
if (!bReplay) {
|
if (!bReplay) {
|
||||||
connect(messageLog, &MessageLogWidget::openMessageDialog, this, &TabGame::openMessageDialog);
|
connect(messageLog, &MessageLogWidget::openMessageDialog, this, &TabGame::openMessageDialog);
|
||||||
connect(messageLog, &MessageLogWidget::addMentionTag, this, &TabGame::addMentionTag);
|
connect(messageLog, &MessageLogWidget::addMentionTag, this, &TabGame::addMentionTag);
|
||||||
|
|
@ -1698,6 +1703,8 @@ void TabGame::createMessageDock(bool bReplay)
|
||||||
connect(gameTimer, &QTimer::timeout, this, &TabGame::incrementGameTime);
|
connect(gameTimer, &QTimer::timeout, this, &TabGame::incrementGameTime);
|
||||||
gameTimer->start();
|
gameTimer->start();
|
||||||
|
|
||||||
|
messageLogLayout->addWidget(timeElapsedLabel);
|
||||||
|
|
||||||
sayLabel = new QLabel;
|
sayLabel = new QLabel;
|
||||||
sayEdit = new LineEditCompleter;
|
sayEdit = new LineEditCompleter;
|
||||||
sayEdit->setMaxLength(MAX_TEXT_LENGTH);
|
sayEdit->setMaxLength(MAX_TEXT_LENGTH);
|
||||||
|
|
@ -1726,18 +1733,12 @@ void TabGame::createMessageDock(bool bReplay)
|
||||||
connect(tabSupervisor, &TabSupervisor::adminLockChanged, this, &TabGame::adminLockChanged);
|
connect(tabSupervisor, &TabSupervisor::adminLockChanged, this, &TabGame::adminLockChanged);
|
||||||
connect(sayEdit, &LineEditCompleter::returnPressed, this, &TabGame::actSay);
|
connect(sayEdit, &LineEditCompleter::returnPressed, this, &TabGame::actSay);
|
||||||
|
|
||||||
sayHLayout = new QHBoxLayout;
|
auto sayHLayout = new QHBoxLayout;
|
||||||
sayHLayout->addWidget(sayLabel);
|
sayHLayout->addWidget(sayLabel);
|
||||||
sayHLayout->addWidget(sayEdit);
|
sayHLayout->addWidget(sayEdit);
|
||||||
}
|
|
||||||
|
|
||||||
messageLogLayout = new QVBoxLayout;
|
|
||||||
messageLogLayout->setContentsMargins(0, 0, 0, 0);
|
|
||||||
if (!bReplay)
|
|
||||||
messageLogLayout->addWidget(timeElapsedLabel);
|
|
||||||
messageLogLayout->addWidget(messageLog);
|
|
||||||
if (!bReplay)
|
|
||||||
messageLogLayout->addLayout(sayHLayout);
|
messageLogLayout->addLayout(sayHLayout);
|
||||||
|
}
|
||||||
|
|
||||||
messageLogLayoutWidget = new QWidget;
|
messageLogLayoutWidget = new QWidget;
|
||||||
messageLogLayoutWidget->setLayout(messageLogLayout);
|
messageLogLayoutWidget->setLayout(messageLogLayout);
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,7 @@ private:
|
||||||
GameScene *scene;
|
GameScene *scene;
|
||||||
GameView *gameView;
|
GameView *gameView;
|
||||||
QMap<int, DeckViewContainer *> deckViewContainers;
|
QMap<int, DeckViewContainer *> deckViewContainers;
|
||||||
QVBoxLayout *cardVInfoLayout, *messageLogLayout, *gamePlayAreaVBox, *deckViewContainerLayout;
|
QVBoxLayout *deckViewContainerLayout;
|
||||||
QHBoxLayout *cardHInfoLayout, *sayHLayout, *mainHLayout, *replayControlLayout;
|
|
||||||
QWidget *cardBoxLayoutWidget, *messageLogLayoutWidget, *gamePlayAreaWidget, *deckViewContainerWidget,
|
QWidget *cardBoxLayoutWidget, *messageLogLayoutWidget, *gamePlayAreaWidget, *deckViewContainerWidget,
|
||||||
*replayControlWidget;
|
*replayControlWidget;
|
||||||
QDockWidget *cardInfoDock, *messageLayoutDock, *playerListDock, *replayDock;
|
QDockWidget *cardInfoDock, *messageLayoutDock, *playerListDock, *replayDock;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue