From 1251338619091d83445cfb2be605240000e06ba9 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 19 Jun 2015 14:33:23 +0200 Subject: [PATCH 1/4] enforce max size for user avatar on userinfobox; refs #1144 --- cockatrice/src/userinfobox.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/userinfobox.cpp b/cockatrice/src/userinfobox.cpp index 2f367212d..9edd0c22d 100644 --- a/cockatrice/src/userinfobox.cpp +++ b/cockatrice/src/userinfobox.cpp @@ -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())); From 1ae79fbcaab392657ef477f898bcaf35cb491f70 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 19 Jun 2015 14:42:13 +0200 Subject: [PATCH 2/4] Removed double margin around chatbox in game --- cockatrice/src/tab_game.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index 0d91d7ea1..752b937d6 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -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; @@ -414,6 +415,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList &_client deckViewContainerLayout = new QVBoxLayout; QVBoxLayout *messageLogLayout = new QVBoxLayout; + messageLogLayout->setContentsMargins(0, 0, 0, 0); messageLogLayout->addWidget(timeElapsedLabel); messageLogLayout->addWidget(messageLog); messageLogLayout->addLayout(hLayout); From c400d6d4ec7724da5a5e836d6859c0c088a2d176 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 19 Jun 2015 14:57:20 +0200 Subject: [PATCH 3/4] use the new card frame in game; mitigates #1144 --- cockatrice/src/tab_game.cpp | 6 +++--- cockatrice/src/tab_game.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index 752b937d6..fec202f73 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -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); @@ -391,7 +391,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList &_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))); diff --git a/cockatrice/src/tab_game.h b/cockatrice/src/tab_game.h index ae2ac28ff..d6a18c0c9 100644 --- a/cockatrice/src/tab_game.h +++ b/cockatrice/src/tab_game.h @@ -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; From ec45a099e1161e40fb7b0b91481ad7cc068730ee Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 22 Jun 2015 18:24:05 +0200 Subject: [PATCH 4/4] Made items not collapsible; changed players widget's min height from 60 to 40 px --- cockatrice/src/playerlistwidget.cpp | 2 +- cockatrice/src/tab_game.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/playerlistwidget.cpp b/cockatrice/src/playerlistwidget.cpp index e18bab98c..e38975337 100644 --- a/cockatrice/src/playerlistwidget.cpp +++ b/cockatrice/src/playerlistwidget.cpp @@ -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); diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index fec202f73..d612bfbcc 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -358,7 +358,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) setLayout(superMainLayout); splitter->restoreState(settingsCache->getTabGameSplitterSizes()); - + splitter->setChildrenCollapsible(false); + messageLog->logReplayStarted(gameInfo.game_id()); } @@ -490,6 +491,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList &_client setLayout(mainLayout); splitter->restoreState(settingsCache->getTabGameSplitterSizes()); + splitter->setChildrenCollapsible(false); messageLog->logGameJoined(gameInfo.game_id());