Merge pull request #1153 from ctrlaltca/issue_1144

Fix windows size growing out of screen; fix #1144
This commit is contained in:
Zach 2015-06-27 21:20:57 -04:00
commit 36d0a13fc9
4 changed files with 15 additions and 8 deletions

View file

@ -67,7 +67,7 @@ PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient
} else
userContextMenu = 0;
setMinimumHeight(60);
setMinimumHeight(40);
setIconSize(QSize(20, 15));
setColumnCount(6);
setColumnWidth(0, 20);

View file

@ -12,7 +12,7 @@
#include "dlg_creategame.h"
#include "tab_game.h"
#include "tab_supervisor.h"
#include "cardinfowidget.h"
#include "cardframe.h"
#include "playerlistwidget.h"
#include "messagelogwidget.h"
#include "phasestoolbar.h"
@ -280,7 +280,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
gameView = new GameView(scene);
gameView->hide();
cardInfo = new CardInfoWidget(CardInfoWidget::ModeGameTab);
cardInfo = new CardFrame(250, 372);
playerListWidget = new PlayerListWidget(0, 0, this);
playerListWidget->setFocusPolicy(Qt::NoFocus);
@ -293,6 +293,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
deckViewContainerLayout = new QVBoxLayout;
QVBoxLayout *messageLogLayout = new QVBoxLayout;
messageLogLayout->setContentsMargins(0, 0, 0, 0);
messageLogLayout->addWidget(messageLog);
QWidget *messageLogLayoutWidget = new QWidget;
@ -357,7 +358,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
setLayout(superMainLayout);
splitter->restoreState(settingsCache->getTabGameSplitterSizes());
splitter->setChildrenCollapsible(false);
messageLog->logReplayStarted(gameInfo.game_id());
}
@ -390,7 +392,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
gameView = new GameView(scene);
gameView->hide();
cardInfo = new CardInfoWidget(CardInfoWidget::ModeGameTab);
cardInfo = new CardFrame(250, 372);
playerListWidget = new PlayerListWidget(tabSupervisor, clients.first(), this);
playerListWidget->setFocusPolicy(Qt::NoFocus);
connect(playerListWidget, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool)));
@ -414,6 +416,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
deckViewContainerLayout = new QVBoxLayout;
QVBoxLayout *messageLogLayout = new QVBoxLayout;
messageLogLayout->setContentsMargins(0, 0, 0, 0);
messageLogLayout->addWidget(timeElapsedLabel);
messageLogLayout->addWidget(messageLog);
messageLogLayout->addLayout(hLayout);
@ -488,6 +491,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
setLayout(mainLayout);
splitter->restoreState(settingsCache->getTabGameSplitterSizes());
splitter->setChildrenCollapsible(false);
messageLog->logGameJoined(gameInfo.game_id());

View file

@ -11,7 +11,7 @@ class CardDatabase;
class GameView;
class DeckView;
class GameScene;
class CardInfoWidget;
class CardFrame;
class MessageLogWidget;
class QTimer;
class QSplitter;
@ -125,7 +125,7 @@ private:
QToolButton *replayStartButton, *replayPauseButton, *replayFastForwardButton;
QSplitter *splitter;
CardInfoWidget *cardInfo;
CardFrame *cardInfo;
PlayerListWidget *playerListWidget;
QLabel *timeElapsedLabel;
MessageLogWidget *messageLog;

View file

@ -21,6 +21,9 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, bool _fullInfo, QWidget *paren
nameFont.setBold(true);
nameFont.setPointSize(nameFont.pointSize() * 1.5);
nameLabel.setFont(nameFont);
avatarLabel.setMaximumWidth(400);
avatarLabel.setMaximumHeight(200);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget(&avatarLabel, 0, 0, 1, 3, Qt::AlignCenter);
@ -61,7 +64,7 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
const std::string bmp = user.avatar_bmp();
if (!avatarPixmap.loadFromData((const uchar *) bmp.data(), bmp.size()))
avatarPixmap = UserLevelPixmapGenerator::generatePixmap(64, userLevel, false);
avatarLabel.setPixmap(avatarPixmap);
avatarLabel.setPixmap(avatarPixmap.scaled(avatarLabel.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
nameLabel.setText(QString::fromStdString(user.name()));
realNameLabel2.setText(QString::fromStdString(user.real_name()));