From cbe7f1e17247b1f8d6a192b9894f0f574fa28667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Mon, 14 Jan 2013 01:08:41 +0100 Subject: [PATCH] Topping: better looking widget, and new field for the total score --- qt/topping_widget.cpp | 8 ++ qt/ui/topping_widget.ui | 189 ++++++++++++++++++++++++++-------------- 2 files changed, 133 insertions(+), 64 deletions(-) diff --git a/qt/topping_widget.cpp b/qt/topping_widget.cpp index d8d563d..774e485 100644 --- a/qt/topping_widget.cpp +++ b/qt/topping_widget.cpp @@ -52,6 +52,13 @@ ToppingWidget::ToppingWidget(QWidget *parent, PlayModel &iPlayModel, { setupUi(this); + splitter->setStretchFactor(0, 0); + splitter->setStretchFactor(1, 0); + splitter->setStretchFactor(2, 1); + QList sizes; + sizes << 1 << 1 << 10; + splitter->setSizes(sizes); + QObject::connect(&iPlayModel, SIGNAL(movePlayed(const wstring&, const wstring&)), this, SLOT(playWord(const wstring&, const wstring&))); @@ -141,6 +148,7 @@ void ToppingWidget::refresh() lineEditPlay->clear(); lineEditCoords->clear(); lineEditRack->setEnabled(true); + lineEditTotalScore->setText(QString("%1").arg(m_game->getCurrentPlayer().getTotalScore())); // Do not allow entering a move when displaying an old turn setEnabled(m_game->isLastTurn()); } diff --git a/qt/ui/topping_widget.ui b/qt/ui/topping_widget.ui index bba0c70..7b88c80 100644 --- a/qt/ui/topping_widget.ui +++ b/qt/ui/topping_widget.ui @@ -6,13 +6,19 @@ 0 0 - 560 - 150 + 642 + 151 - + + + + 16777215 + 16777215 + + Qt::Horizontal @@ -25,21 +31,61 @@ - - - - true - - - - + _("Shu&ffle") + + + + true + + + + + + + _("Play") + + + + + + + false + + + + 0 + 0 + + + + + 50 + 16777215 + + + + + + + + _("Get hints...") + + + + + + _("Word:") + + + + _("Ref.:") @@ -47,6 +93,22 @@ + + + + 80 + 0 + + + + _("Enter the word to play (case-insensitive). A joker from the rack must be written in parentheses. E.g.: w(o)rd or W(O)RD") + + + _("Enter the word to play (case-insensitive). A joker from the rack must be written in parentheses. E.g.: w(o)rd or W(O)RD") + + + + @@ -68,57 +130,7 @@ - - - - _("Word:") - - - - - - - _("Enter the word to play (case-insensitive). A joker from the rack must be written in parentheses. E.g.: w(o)rd or W(O)RD") - - - _("Enter the word to play (case-insensitive). A joker from the rack must be written in parentheses. E.g.: w(o)rd or W(O)RD") - - - - - - - _("Play") - - - - - - - false - - - - 0 - 0 - - - - - 50 - 16777215 - - - - - - - - _("Get hints...") - - - - + Qt::Vertical @@ -131,8 +143,53 @@ - - + + + + + + + + + + _("Total score:") + + + + + + + + 50 + 0 + + + + true + + + + + + + + horizontalLayoutWidget + horizontalLayoutWidget + horizontalLayoutWidget + + + + + + Qt::Vertical + + + + 20 + 40 + + + @@ -165,6 +222,10 @@ + splitter + widgetContainer + verticalLayoutWidget + splitter