summaryrefslogtreecommitdiffstats
path: root/kicker/applets/minipager/pagerapplet.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 20:21:27 +0000
commit10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch)
tree88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kicker/applets/minipager/pagerapplet.cpp
parent4aed2c8219774f5d797760606b8489a92ddc5163 (diff)
downloadtdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz
tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes Will need to check for commit warnings and repair as encountered Also needs full compile test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker/applets/minipager/pagerapplet.cpp')
-rw-r--r--kicker/applets/minipager/pagerapplet.cpp44
1 files changed, 37 insertions, 7 deletions
diff --git a/kicker/applets/minipager/pagerapplet.cpp b/kicker/applets/minipager/pagerapplet.cpp
index 3ba87c0b1..6cc000562 100644
--- a/kicker/applets/minipager/pagerapplet.cpp
+++ b/kicker/applets/minipager/pagerapplet.cpp
@@ -136,6 +136,7 @@ KMiniPager::KMiniPager(const QString& configFile, Type type, int actions,
connect( m_kwin, SIGNAL( currentDesktopViewportChanged(int, const QPoint&)),
SLOT(slotSetDesktopViewport(int, const QPoint&)));
connect( m_kwin, SIGNAL( numberOfDesktopsChanged(int)), SLOT( slotSetDesktopCount(int) ) );
+ connect( m_kwin, SIGNAL( desktopGeometryChanged(int)), SLOT( slotRefreshViewportCount(int) ) );
connect( m_kwin, SIGNAL( activeWindowChanged(WId)), SLOT( slotActiveWindowChanged(WId) ) );
connect( m_kwin, SIGNAL( windowAdded(WId) ), this, SLOT( slotWindowAdded(WId) ) );
connect( m_kwin, SIGNAL( windowRemoved(WId) ), this, SLOT( slotWindowRemoved(WId) ) );
@@ -513,6 +514,28 @@ void KMiniPager::slotSetDesktopCount( int )
updateLayout();
}
+void KMiniPager::slotRefreshViewportCount( int )
+{
+ QValueList<KMiniPagerButton*>::ConstIterator it;
+ QValueList<KMiniPagerButton*>::ConstIterator itEnd = m_desktops.end();
+ for( it = m_desktops.begin(); it != itEnd; ++it )
+ {
+ delete (*it);
+ }
+ m_desktops.clear();
+
+ drawButtons();
+
+ m_curDesk = m_kwin->currentDesktop();
+ if ( m_curDesk == 0 )
+ {
+ m_curDesk = 1;
+ }
+
+ resizeEvent(0);
+ updateLayout();
+}
+
void KMiniPager::slotActiveWindowChanged( WId win )
{
if (desktopPreview())
@@ -715,8 +738,10 @@ void KMiniPager::aboutToShowContextMenu()
PagerSettings::EnumBackgroundType::BgPlain + bgOffset);
showMenu->insertItem(i18n("&Transparent"),
PagerSettings::EnumBackgroundType::BgTransparent + bgOffset);
- showMenu->insertItem(i18n("&Desktop Wallpaper"),
+ if (m_useViewports == false) {
+ showMenu->insertItem(i18n("&Desktop Wallpaper"),
PagerSettings::EnumBackgroundType::BgLive + bgOffset);
+ }
connect(showMenu, SIGNAL(activated(int)), SLOT(contextMenuActivated(int)));
m_contextMenu->insertItem(i18n("&Pager Options"),showMenu);
@@ -795,12 +820,17 @@ void KMiniPager::contextMenuActivated(int result)
break;
case PagerSettings::EnumBackgroundType::BgLive + bgOffset:
{
- m_settings->setBackgroundType(PagerSettings::EnumBackgroundType::BgLive);
- QValueList<KMiniPagerButton*>::ConstIterator it;
- QValueList<KMiniPagerButton*>::ConstIterator itEnd = m_desktops.end();
- for( it = m_desktops.begin(); it != itEnd; ++it )
- {
- (*it)->backgroundChanged();
+ if (m_useViewports == true) {
+ m_settings->setBackgroundType(PagerSettings::EnumBackgroundType::BgLive);
+ QValueList<KMiniPagerButton*>::ConstIterator it;
+ QValueList<KMiniPagerButton*>::ConstIterator itEnd = m_desktops.end();
+ for( it = m_desktops.begin(); it != itEnd; ++it )
+ {
+ (*it)->backgroundChanged();
+ }
+ }
+ else {
+ m_settings->setBackgroundType(PagerSettings::EnumBackgroundType::BgTransparent);
}
break;
}