Removed in-lineedit labels such as "search:" and "room name:" due to size issues with localization and platform differences.
authordag10
Sat, 09 Feb 2013 18:32:51 -0500
changeset 8488 e72f3398a28b
parent 8487 ec8391680132
child 8489 25cb6f4a1d1b
Removed in-lineedit labels such as "search:" and "room name:" due to size issues with localization and platform differences.
QTfrontend/ui/page/pagenetgame.cpp
QTfrontend/ui/page/pageroomslist.cpp
QTfrontend/ui/widget/hatprompt.cpp
QTfrontend/ui/widget/themeprompt.cpp
--- a/QTfrontend/ui/page/pagenetgame.cpp	Sun Feb 10 01:54:24 2013 +0400
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Sat Feb 09 18:32:51 2013 -0500
@@ -54,16 +54,9 @@
     leRoomName->setMaximumWidth(600);
     leRoomName->setFixedHeight(30);
     leRoomName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+    leRoomName->setStyleSheet("border-right: 0; padding-left: 4px; border-top-right-radius: 0px; border-bottom-right-radius: 0px;");
     roomConfigLayout->addWidget(leRoomName, 100);
 
-    QLabel * lblRoomName = new QLabel(tr("Room name: "), leRoomName);
-    lblRoomName->setFont(QFont("Arial", 12, QFont::Black));
-    QFontMetrics lblMetrics(lblRoomName->font());
-    int lblRoomNameWidth = lblMetrics.width(lblRoomName->text());
-    lblRoomName->setStyleSheet(QString("background: none; margin-left: -%1px; margin-top: 6px;").arg(lblRoomNameWidth + 12));
-    leRoomName->setFont(QFont("Arial", 12, QFont::Normal));
-    leRoomName->setStyleSheet(QString("HistoryLineEdit, QLabel { border-right: 0; padding-left: %1px; padding-bottom: 2px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; }").arg(lblRoomNameWidth + 16));
-
     BtnUpdate = new QPushButton();
     BtnUpdate->setEnabled(false);
     BtnUpdate->setText(tr("Update"));
--- a/QTfrontend/ui/page/pageroomslist.cpp	Sun Feb 10 01:54:24 2013 +0400
+++ b/QTfrontend/ui/page/pageroomslist.cpp	Sat Feb 09 18:32:51 2013 -0500
@@ -26,7 +26,6 @@
 #include <QMessageBox>
 #include <QHeaderView>
 #include <QGroupBox>
-#include <QFontMetrics>
 #include <QMenu>
 #include <QDebug>
 
@@ -51,7 +50,7 @@
     pageLayout->addLayout(topLayout, 0);
 
     // Help/prompt message at top
-    QLabel * lblDesc = new QLabel(tr("Join a room"));
+    QLabel * lblDesc = new QLabel(tr("Search for a room:"));
     lblDesc->setObjectName("lblDesc");
     lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}");
     lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -63,18 +62,12 @@
     searchContainer->setFixedHeight(24);
     searchContainer->setObjectName("searchContainer");
     searchContainer->setStyleSheet("#searchContainer { background: #F6CB1C; border-top-right-radius: 10px; padding: 3px; }");
-    searchContainer->setFixedWidth(250);
+    searchContainer->setFixedWidth(200);
     searchText = new LineEditCursor(searchContainer);
-    searchText->setFixedWidth(250);
+    searchText->setFixedWidth(200);
     searchText->setMaxLength(60);
     searchText->setFixedHeight(22);
-
-    // Search label
-    QLabel * lblSearch = new QLabel(tr("Search: "), searchText);
-    QFontMetrics lblMetrics(lblSearch->font());
-    int lblSearchWidth = lblMetrics.width(lblSearch->text());
-    lblSearch->setStyleSheet(QString("background: none; margin-left: -%1px; margin-top: 4px;").arg(lblSearchWidth + 5));
-    searchText->setStyleSheet(QString("LineEditCursor, QLabel { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: %1px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }").arg(lblSearchWidth + 5));
+    searchText->setStyleSheet("LineEditCursor { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: 4px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }");
 
     // Corner widget
     QLabel * corner = new QLabel();
--- a/QTfrontend/ui/widget/hatprompt.cpp	Sun Feb 10 01:54:24 2013 +0400
+++ b/QTfrontend/ui/widget/hatprompt.cpp	Sat Feb 09 18:32:51 2013 -0500
@@ -28,7 +28,6 @@
 #include <QLineEdit>
 #include <QLabel>
 #include <QSortFilterProxyModel>
-#include <QFontMetrics>
 #include <QDebug>
 
 #include "DataManager.h"
@@ -61,7 +60,7 @@
     QHBoxLayout * topLayout = new QHBoxLayout();
 
     // Help/prompt message at top
-    QLabel * lblDesc = new QLabel(tr("Select a hat"));
+    QLabel * lblDesc = new QLabel(tr("Search for a hat:"));
     lblDesc->setObjectName("lblDesc");
     lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}");
     lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -73,24 +72,18 @@
     filterContainer->setFixedHeight(24);
     filterContainer->setObjectName("filterContainer");
     filterContainer->setStyleSheet("#filterContainer { background: #F6CB1C; border-top-right-radius: 10px; padding: 3px; }");
-    filterContainer->setFixedWidth(250);
+    filterContainer->setFixedWidth(150);
     txtFilter = new LineEditCursor(filterContainer);
-    txtFilter->setFixedWidth(250);
+    txtFilter->setFixedWidth(150);
     txtFilter->setFocus();
     txtFilter->setFixedHeight(22);
+    txtFilter->setStyleSheet("LineEditCursor { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: 4px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }");
     connect(txtFilter, SIGNAL(textChanged(const QString &)), this, SLOT(filterChanged(const QString &)));
     connect(txtFilter, SIGNAL(moveUp()), this, SLOT(moveUp()));
     connect(txtFilter, SIGNAL(moveDown()), this, SLOT(moveDown()));
     connect(txtFilter, SIGNAL(moveLeft()), this, SLOT(moveLeft()));
     connect(txtFilter, SIGNAL(moveRight()), this, SLOT(moveRight()));
 
-    // Filter label
-    QLabel * lblFilter = new QLabel(tr("Filter: "), txtFilter);
-    QFontMetrics lblMetrics(lblFilter->font());
-    int lblFilterWidth = lblMetrics.width(lblFilter->text());
-    lblFilter->setStyleSheet(QString("background: none; margin-left: -%1px; margin-top: 4px;").arg(lblFilterWidth + 5));
-    txtFilter->setStyleSheet(QString("LineEditCursor, QLabel { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: %1px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }").arg(lblFilterWidth + 5));
-
     // Corner widget
     QLabel * corner = new QLabel();
     corner->setPixmap(QPixmap(QString::fromUtf8(":/res/inverse-corner-bl.png")));
--- a/QTfrontend/ui/widget/themeprompt.cpp	Sun Feb 10 01:54:24 2013 +0400
+++ b/QTfrontend/ui/widget/themeprompt.cpp	Sat Feb 09 18:32:51 2013 -0500
@@ -28,7 +28,6 @@
 #include <QLineEdit>
 #include <QLabel>
 #include <QSortFilterProxyModel>
-#include <QFontMetrics>
 #include <QDebug>
 
 #include "DataManager.h"
@@ -61,7 +60,7 @@
     QHBoxLayout * topLayout = new QHBoxLayout();
 
     // Help/prompt message at top
-    QLabel * lblDesc = new QLabel(tr("Select a theme"));
+    QLabel * lblDesc = new QLabel(tr("Search for a theme:"));
     lblDesc->setObjectName("lblDesc");
     lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}");
     lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -73,24 +72,18 @@
     filterContainer->setFixedHeight(24);
     filterContainer->setObjectName("filterContainer");
     filterContainer->setStyleSheet("#filterContainer { background: #F6CB1C; border-top-right-radius: 10px; padding: 3px; }");
-    filterContainer->setFixedWidth(250);
+    filterContainer->setFixedWidth(150);
     txtFilter = new LineEditCursor(filterContainer);
-    txtFilter->setFixedWidth(250);
+    txtFilter->setFixedWidth(150);
     txtFilter->setFocus();
     txtFilter->setFixedHeight(22);
+    txtFilter->setStyleSheet("LineEditCursor { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: 4px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }");
     connect(txtFilter, SIGNAL(textChanged(const QString &)), this, SLOT(filterChanged(const QString &)));
     connect(txtFilter, SIGNAL(moveUp()), this, SLOT(moveUp()));
     connect(txtFilter, SIGNAL(moveDown()), this, SLOT(moveDown()));
     connect(txtFilter, SIGNAL(moveLeft()), this, SLOT(moveLeft()));
     connect(txtFilter, SIGNAL(moveRight()), this, SLOT(moveRight()));
 
-    // Filter label
-    QLabel * lblFilter = new QLabel(tr("Filter: "), txtFilter);
-    QFontMetrics lblMetrics(lblFilter->font());
-    int lblFilterWidth = lblMetrics.width(lblFilter->text());
-    lblFilter->setStyleSheet(QString("background: none; margin-left: -%1px; margin-top: 4px;").arg(lblFilterWidth + 5));
-    txtFilter->setStyleSheet(QString("LineEditCursor, QLabel { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: %1px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }").arg(lblFilterWidth + 5));
-
     // Corner widget
     QLabel * corner = new QLabel();
     corner->setPixmap(QPixmap(QString::fromUtf8(":/res/inverse-corner-bl.png")));