From 10e41144596fc9ced40fc349d9ecd099b1c2ea19 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 11 Dec 2009 20:21:27 +0000 Subject: 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 --- kicker/applets/minipager/pagerapplet.cpp | 44 +++++++++++++++++++++++++++----- kicker/applets/minipager/pagerapplet.h | 1 + 2 files changed, 38 insertions(+), 7 deletions(-) (limited to 'kicker/applets/minipager') 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::ConstIterator it; + QValueList::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::ConstIterator it; - QValueList::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::ConstIterator it; + QValueList::ConstIterator itEnd = m_desktops.end(); + for( it = m_desktops.begin(); it != itEnd; ++it ) + { + (*it)->backgroundChanged(); + } + } + else { + m_settings->setBackgroundType(PagerSettings::EnumBackgroundType::BgTransparent); } break; } diff --git a/kicker/applets/minipager/pagerapplet.h b/kicker/applets/minipager/pagerapplet.h index f47b0411d..d96ba83f7 100644 --- a/kicker/applets/minipager/pagerapplet.h +++ b/kicker/applets/minipager/pagerapplet.h @@ -84,6 +84,7 @@ public slots: void slotSetDesktop(int desktop); void slotSetDesktopViewport(int desktop, const QPoint& viewport); void slotSetDesktopCount(int count); + void slotRefreshViewportCount(int currentDesktop); void slotButtonSelected(int desk ); void slotActiveWindowChanged( WId win ); void slotWindowAdded( WId ); -- cgit v1.2.1