[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-11-12 15:53:21
Message-ID: 1226505201.036006.32379.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 883295 by bettio:
Tooltip works like in the KDE 3.5's pager but it miss windows icons.
Probably we need to add a new method to ToolTipContent that allows us to add icons to \
tooltips.
M +26 -1 pager.cpp
M +2 -0 pager.h
--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.cpp #883294:883295
@@ -360,8 +360,9 @@
m_windowRects.append(QList<QPair<WId, QRect> >());
}
m_activeWindows.clear();
+ m_windowInfo.clear();
foreach(WId window, windows) {
- KWindowInfo info = KWindowSystem::windowInfo(window, NET::WMGeometry | \
NET::WMFrameExtents | NET::WMWindowType | NET::WMDesktop | NET::WMState | \
NET::XAWMState); + KWindowInfo info = KWindowSystem::windowInfo(window, \
NET::WMGeometry | NET::WMFrameExtents | NET::WMWindowType | NET::WMDesktop | \
NET::WMState | NET::XAWMState | NET::WMVisibleName);
NET::WindowType type = info.windowType(NET::NormalMask | NET::DialogMask | \
NET::OverrideMask |
NET::UtilityMask | NET::DesktopMask | \
NET::DockMask |
NET::TopMenuMask | NET::SplashMask | \
NET::ToolbarMask | @@ -396,6 +397,7 @@
if (window == KWindowSystem::activeWindow()) {
m_activeWindows.append(windowRect);
}
+ m_windowInfo.append(info);
}
}
@@ -1080,8 +1082,31 @@
}
}
+ QString subtext = "";
+ int taskCounter = 0;
+ int displayedTaskCounter = 0;
+ foreach(KWindowInfo winInfo, m_windowInfo){
+ if (winInfo.isOnDesktop(hoverDesktopNumber) || winInfo.onAllDesktops()){
+ if (winInfo.win() == KWindowSystem::activeWindow()){
+ subtext += "<br />• <u>" + winInfo.visibleName() + "</u>";
+ displayedTaskCounter++;
+
+ }else if (taskCounter < 4){
+ subtext += "<br />• " + winInfo.visibleName();
+ displayedTaskCounter++;
+ }
+ taskCounter++;
+ }
+ }
+
+ subtext.prepend(i18np("One window:", "%1 windows:", taskCounter));
+ if (taskCounter - displayedTaskCounter > 0){
+ subtext.append("<br>• <i>" + i18np("and 1 other", "and %1 others", \
taskCounter - displayedTaskCounter) + "</i>"); + }
+
Plasma::ToolTipContent data;
data.setMainText(KWindowSystem::desktopName(hoverDesktopNumber));
+ data.setSubText(subtext);
Plasma::ToolTipManager::self()->setContent(this, data);
}
--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.h #883294:883295
@@ -31,6 +31,7 @@
class KDialog;
class KSelectionOwner;
class KColorScheme;
+class KWindowInfo;
namespace Plasma
{
@@ -128,6 +129,7 @@
QList<QList<QPair<WId, QRect> > > m_windowRects;
QList<QRect> m_activeWindows;
QList<QAction*> m_actions;
+ QList<KWindowInfo> m_windowInfo;
KSelectionOwner* m_desktopLayoutOwner;
Plasma::FrameSvg *m_background;
KColorScheme *m_colorScheme;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic