From: Roman Moravčík Date: Mon, 6 Aug 2012 19:14:48 +0000 (+0200) Subject: Fixed label wraping. X-Git-Url: https://vcs.maemo.org/git/?p=medard;a=commitdiff_plain;h=39082e623f96f562f491b91f9812ec0440e5d142 Fixed label wraping. --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c67561f..f612990 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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:
") + 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
dd.MM.yyyy, hh:mm"); m_forecastDateLabel->setText(temp.replace(0, 1, temp.at(0).toUpper())); showNavigationButtons();