]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbarspaceinfo.cpp
the widget is double-buffered by default so don't triple-buffer
[dolphin.git] / src / statusbarspaceinfo.cpp
index ddcf1b761b04b0ed17a825256c161058bdecb377..b7a1756c30782842175f281da99f08c58588234c 100644 (file)
@@ -48,7 +48,7 @@ StatusBarSpaceInfo::~StatusBarSpaceInfo()
 {
 }
 
-void StatusBarSpaceInfo::setURL(const KUrl& url)
+void StatusBarSpaceInfo::setUrl(const KUrl& url)
 {
     m_url = url;
     refresh();
@@ -66,7 +66,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
 
     const int widthDec = 3;  // visual decrement for the available width
 
-    const QColor c1 = colorGroup().background();
+    const QColor c1 = palette().brush(QPalette::Background).color();
     const QColor c2 = KGlobalSettings::buttonTextColor();
     const QColor frameColor((c1.red()   + c2.red())   / 2,
                             (c1.green() + c2.green()) / 2,
@@ -91,9 +91,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
         }
         painter.drawRect(QRect(left, barTop + 2, right, barHeight - 2));
 
-        text = i18n("%1% of %2 used")
-               .arg( 100 - (int)(100.0 * m_kBAvailable / m_kBSize))
-               .arg(KIO::convertSizeFromKB(m_kBSize));
+        text = i18n("%1% of %2 used", QString::number(100 - (int)(100.0 * m_kBAvailable / m_kBSize)), KIO::convertSizeFromKiB(m_kBSize));
     }
     else {
         if (m_gettingSize) {
@@ -108,7 +106,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
     // draw text (usually 'X% of Y GB used')
     painter.setPen(KGlobalSettings::textColor());
     painter.drawText(QRect(1, 1, barWidth - 2, barHeight + 4),
-                     Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak,
+                     Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextWordWrap,
                      text);
 }