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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/pager
From:       Davide Bettio <davbet () aliceposta ! it>
Date:       2008-03-08 14:14:23
Message-ID: 1204985663.485566.28274.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 783528 by bettio:

Added window icons support.


 M  +13 -0     pager.cpp  
 M  +1 -0      pager.h  
 M  +10 -3     pagerConfig.ui  


--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.cpp #783527:783528
@@ -48,6 +48,7 @@
     : Plasma::Applet(parent, args),
       m_dialog(0),
       m_showDesktopNumber(true),
+      m_showWindowIcons(true),
       m_rows(2),
       m_columns(0),
       m_dragId(0),
@@ -68,6 +69,7 @@
 
     KConfigGroup cg = config();
     m_showDesktopNumber = cg.readEntry("showDesktopNumber", m_showDesktopNumber);
+    m_showWindowIcons = cg.readEntry("showWindowIcons", m_showWindowIcons);
     m_rows = globalConfig().readEntry("rows", m_rows);
 
     if (m_rows < 1) {
@@ -161,6 +163,7 @@
 
     }
     ui.showDesktopNumberCheckBox->setChecked(m_showDesktopNumber);
+    ui.showWindowIconsCheckBox->setChecked(m_showWindowIcons);
 
     ui.spinRows->setValue(m_rows);
     ui.spinRows->setMaximum(m_desktopCount);
@@ -271,6 +274,12 @@
         changed = true;
     }
 
+    if (m_showWindowIcons != ui.showWindowIconsCheckBox->isChecked()) {
+        m_showWindowIcons = ui.showWindowIconsCheckBox->isChecked();
+        cg.writeEntry("showWindowIcons", m_showWindowIcons);
+        changed = true;
+    }
+
     // we need to keep all pager applets consistent since this affects
     // the layout of the desktops as used by the window manager,
     // so we store the row count in the applet global configuration
@@ -603,6 +612,10 @@
                 painter->setClipRect(m_rects[i]);
             }
             painter->drawRect(rect);
+            if ((rect.width() > 16) && (rect.height() > 16) && m_showWindowIcons){
+                painter->drawPixmap(rect.x() + (rect.width() - 16) / 2, rect.y() + \
(rect.height() - 16) / 2, 16, 16, +                                    \
KWindowSystem::icon(m_windowRects[i][j].first, 16, 16, true)); +            }
         }
     }
 
--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.h #783527:783528
@@ -81,6 +81,7 @@
         KDialog *m_dialog;
         Ui::pagerConfig ui;
 	bool m_showDesktopNumber;
+        bool m_showWindowIcons;
 	int m_rows;
 	int m_columns;
 	
--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pagerConfig.ui #783527:783528
@@ -35,7 +35,14 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="0" >
+   <item row="1" column="0" colspan="3" >
+    <widget class="QCheckBox" name="showWindowIconsCheckBox" >
+     <property name="text" >
+      <string>Display window &amp;icons</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" >
     <widget class="QLabel" name="labelRows" >
      <property name="text" >
       <string>Number of rows:</string>
@@ -45,7 +52,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="1" >
+   <item row="2" column="1" >
     <widget class="QSpinBox" name="spinRows" >
      <property name="toolTip" >
       <string>Change the number of rows</string>
@@ -61,7 +68,7 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="2" >
+   <item row="2" column="2" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>


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

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