Fixed label wraping.
authorRoman Moravčík <roman.moravcik@gmail.com>
Mon, 6 Aug 2012 19:14:48 +0000 (21:14 +0200)
committerRoman Moravčík <roman.moravcik@gmail.com>
Mon, 6 Aug 2012 19:14:48 +0000 (21:14 +0200)
src/mainwindow.cpp

index c67561f..f612990 100644 (file)
@@ -48,12 +48,10 @@ MainWindow::MainWindow(QGraphicsItem *parent) : MApplicationPage(parent)
 
     m_forecastInitialDateLabel = new MLabel();
     m_forecastInitialDateLabel->setAlignment(Qt::AlignCenter);
-    m_forecastInitialDateLabel->setWordWrap(true);
     m_forecastInitialDateLabel->setEnabled(false);
 
     m_forecastDateLabel = new MLabel();
     m_forecastDateLabel->setAlignment(Qt::AlignCenter);
-    m_forecastDateLabel->setWordWrap(true);
 
     m_downloadRetryButton = new MButton(tr("Download again"));
     m_downloadRetryButton->setPreferredWidth(220);
@@ -135,17 +133,18 @@ void MainWindow::setupUi()
     setPannable(false);
 
     QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Horizontal);
-    mainLayout->setSpacing(8);
     centralWidget()->setLayout(mainLayout);
 
     mainLayout->addItem(m_forecast);
 
     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+    layout->setContentsMargins(4, 4, 4, 4);
+    layout->setSpacing(8);
     mainLayout->addItem(layout);
 
     layout->addItem(m_forecastTypeLabel);
+/*    layout->addItem(m_forecastInitialDateLabel); */
     layout->addItem(m_forecastDateLabel);
-    layout->addItem(m_forecastInitialDateLabel);
     layout->addItem(m_downloadRetryButton);
 
     QGraphicsLinearLayout *dayNavigationBox = new QGraphicsLinearLayout(Qt::Horizontal);
@@ -584,11 +583,11 @@ void MainWindow::forecastDomainChanged(QAction *action)
 void MainWindow::downloadedFinished(const QString &filename, const QDateTime &date)
 {
     m_forecast->setImage(filename);
-    m_forecastInitialDateLabel->setText(tr("Forecast from:\n") +
+    m_forecastInitialDateLabel->setText(tr("Forecast from:<br>") +
                                           m_downloader->forecastInitialDate().toString("dd.MM.yyyy, hh:mm"));
 
     /* upcase the first letter of name of day */
-    QString temp = date.toString("dddd\ndd.MM.yyyy, hh:mm");
+    QString temp = date.toString("dddd<br>dd.MM.yyyy, hh:mm");
     m_forecastDateLabel->setText(temp.replace(0, 1, temp.at(0).toUpper()));
 
     showNavigationButtons();