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

List:       kde-commits
Subject:    kdebase/kicker
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2005-04-20 19:06:04
Message-ID: 20050420190604.E9977653 () office ! kde ! org
[Download RAW message or body]

CVS commit by nikolaus: 

polishing the task MOEs:
- limiting the width (break lines in order to do so)
- align the icon on top, if the text height is larger than the icon's height


  M +9 -9      share/kickertip.cpp   1.14
  M +3 -12     taskbar/taskcontainer.cpp   1.130


--- kdebase/kicker/share/kickertip.cpp  #1.13:1.14
@@ -80,7 +80,8 @@ void KickerTip::display(const QString& t
 
     delete m_richText;
-    m_richText = new QSimpleRichText("<qt><nobr><h3>" + title + "</h3><p>" +
+    m_richText = new QSimpleRichText("<qt><h3>" + title + "</h3><p>" +
                                      subtext + "</p></qt>",
                                      font());
+    m_richText->setWidth(400);
 
     if (KickerSettings::mouseOversShowIcon())
@@ -210,5 +211,5 @@ void KickerTip::displayInternal()
     if (KickerSettings::mouseOversShowText())
     {
-        textRect.setWidth(m_richText->width());
+        textRect.setWidth(m_richText->widthUsed());
         textRect.setHeight(m_richText->height());
         marginHint = KDialog::marginHint();
@@ -218,7 +219,8 @@ void KickerTip::displayInternal()
     textRect.addCoords(0, 0, 2, 2);
 
-    int textX = 2 + 3 * m_icon.width() / 2;
-    int width = textX + textRect.width() + marginHint;
-    int height = QMAX(3 * m_icon.height() / 2 , textRect.height());
+    int margin = QMAX(m_icon.height() / 4, marginHint);
+    int height = QMAX(m_icon.height(), textRect.height()) + 2 * margin;
+    int textX = 2 + m_icon.width() + 2 * margin;
+    int width = textX + textRect.width() + margin;
     int textY = (height - textRect.height()) / 2;
 
@@ -250,8 +252,6 @@ void KickerTip::displayInternal()
     if (!m_icon.isNull())
     {
-        int yOffset = m_icon.height() / 4;
-        bufferPainter.drawPixmap(this->height() / 2 - m_icon.width() / 2,
-                                 height - m_icon.height() / 2 -
-                                 m_icon.height() / 2 - yOffset,
+        bufferPainter.drawPixmap(margin,
+                                 margin,
                                  m_icon, 0, 0,
                                  m_icon.width(), m_icon.height());

--- kdebase/kicker/taskbar/taskcontainer.cpp  #1.129:1.130
@@ -1477,17 +1477,8 @@ void TaskContainer::showMouseOver()
 #endif
     {
-        pixmap = KGlobal::iconLoader()->loadIcon(sid.lower(),
-                                                 KIcon::Panel,
-                                                 KIcon::SizeHuge,
-                                                 KIcon::DefaultState,
-                                                 0, true);
-    }
-
     // try to load icon via net_wm
-    if (pixmap.isNull())
-    {
         pixmap = KWin::icon(tasks.first()->window(),
-                            KIcon::SizeHuge,
-                            KIcon::SizeHuge,
+                            KIcon::SizeMedium,
+                            KIcon::SizeMedium,
                             true);
     }


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

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