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

List:       kde-commits
Subject:    branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks
From:       Marco Martin <notmart () gmail ! com>
Date:       2009-09-13 16:51:34
Message-ID: 1252860694.938974.5637.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1022979 by mart:

since te framesvg of the task backgrounds is shared, sometimes we have
to resize it even if there wasn't a resizeevent (due to popup tasks
smaller than the tasks in the taskbar for instance)


 M  +15 -5     abstracttaskitem.cpp  
 M  +1 -0      abstracttaskitem.h  


--- branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks/abstracttaskitem.cpp \
#1022978:1022979 @@ -516,18 +516,23 @@
 
     syncActiveRect();
 
+    resizeBackground(event->newSize().toSize());
+}
+
+void AbstractTaskItem::resizeBackground(const QSize &size)
+{
     Plasma::FrameSvg *itemBackground = m_applet->itemBackground();
 
     itemBackground->setElementPrefix("focus");
-    m_applet->resizeItemBackground(event->newSize().toSize());
+    m_applet->resizeItemBackground(size);
     itemBackground->setElementPrefix("normal");
-    m_applet->resizeItemBackground(event->newSize().toSize());
+    m_applet->resizeItemBackground(size);
     itemBackground->setElementPrefix("minimized");
-    m_applet->resizeItemBackground(event->newSize().toSize());
+    m_applet->resizeItemBackground(size);
     itemBackground->setElementPrefix("attention");
-    m_applet->resizeItemBackground(event->newSize().toSize());
+    m_applet->resizeItemBackground(size);
     itemBackground->setElementPrefix("hover");
-    m_applet->resizeItemBackground(m_activeRect.size().toSize());
+    m_applet->resizeItemBackground(size);
 
     //restore the prefix
     itemBackground->setElementPrefix(m_backgroundPrefix);
@@ -546,6 +551,11 @@
     */
     Plasma::FrameSvg *itemBackground = m_applet->itemBackground();
 
+    //since a single framesvg is shared between all tasks, we could have to resize \
it even if there wasn't a resizeevent +    if (size().toSize() != \
itemBackground->frameSize()) { +        resizeBackground(size().toSize());
+    }
+
     if (!m_animId && ~option->state & QStyle::State_Sunken) {
         itemBackground->setElementPrefix(m_backgroundPrefix);
         if (itemBackground->frameSize() == m_activeRect.size().toSize()) {
--- branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks/abstracttaskitem.h \
#1022978:1022979 @@ -202,6 +202,7 @@
     void fadeBackground(const QString &newBackground, int duration, bool fadeIn);
     // text color, use this because it could be animated
     QColor textColor() const;
+    void resizeBackground(const QSize &size);
 
     void resizeEvent(QGraphicsSceneResizeEvent *event);
 


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

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