[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.3/kdeplasma-addons/applets/notes
From:       Darío Andrés Rodríguez <andresbajotierra () gmail ! co
Date:       2009-07-31 18:35:49
Message-ID: 1249065349.068927.30359.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1005287 by darioandres:

Backport to 4.3:
SVN commit 1005285 by darioandres:

Use CSS for global formatting to avoid affecting children QFont.
Review by Sebas

CCBUG: 201982


 M  +7 -2      notes.cpp  


--- branches/KDE/4.3/kdeplasma-addons/applets/notes/notes.cpp #1005286:1005287
@@ -411,7 +411,13 @@
         const qreal ypad = geometry().height() / 15;
         m_layout->setContentsMargins(xpad, ypad, xpad, ypad);
         m_font.setPointSize(fontSize());
-        m_textEdit->nativeWidget()->setFont(m_font);
+
+        QString cssWeight = m_font.bold() ? "bold" : "normal";
+        QString cssStyle = m_font.italic() ? "italic" : "normal";
+        QString cssSize = QString::number(m_font.pointSize()) + QString("pt");
+        QString css = QString("QTextEdit { font-family:%1; font-size:%2; font-weight:%3;"
+        "font-style:%4; }").arg(m_font.family(), cssSize, cssWeight, cssStyle);
+        m_textEdit->nativeWidget()->setStyleSheet(css);
     }
 }
 
@@ -560,7 +566,6 @@
         cg.writeEntry("font", newFont);
         m_font = newFont;
         m_font.setPointSize(fontSize());
-        m_textEdit->nativeWidget()->setFont(newFont);
     }
 
     if (m_customFontSize != ui.customFontSizeSpinBox->value()) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic