summaryrefslogtreecommitdiffstats
path: root/kdeui/ksystemtray.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-10 03:03:22 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-10 03:03:22 +0000
commitbe5389144b23dad9f4b131118e158138fdd027b5 (patch)
treead36206f759598dc895f97390f474372411b15dc /kdeui/ksystemtray.cpp
parent139dd5b8c4fad3d61f9f7a1776c3c7b6ab77e239 (diff)
downloadtdelibs-be5389144b23dad9f4b131118e158138fdd027b5.tar.gz
tdelibs-be5389144b23dad9f4b131118e158138fdd027b5.zip
Part of batch commit to enable true tasktray resize support for Trinity applications
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1124756 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/ksystemtray.cpp')
-rw-r--r--kdeui/ksystemtray.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/kdeui/ksystemtray.cpp b/kdeui/ksystemtray.cpp
index 593bc6bc0..33d7f3506 100644
--- a/kdeui/ksystemtray.cpp
+++ b/kdeui/ksystemtray.cpp
@@ -29,9 +29,9 @@
#include "kaboutdata.h"
#ifdef Q_WS_X11
-#include <kwin.h>
-#include <kwinmodule.h>
-#include <qxembed.h>
+#include <kwin.h>
+#include <kwinmodule.h>
+#include <qxembed.h>
#endif
#include <kiconloader.h>
@@ -62,7 +62,7 @@ KSystemTray::KSystemTray( QWidget* parent, const char* name )
#ifdef Q_WS_X11
QXEmbed::initialize();
#endif
-
+
d = new KSystemTrayPrivate;
d->actionCollection = new KActionCollection(this);
@@ -95,6 +95,9 @@ KSystemTray::KSystemTray( QWidget* parent, const char* name )
}
setCaption( KGlobal::instance()->aboutData()->programName());
setAlignment( alignment() | Qt::AlignVCenter | Qt::AlignHCenter );
+
+ // Handle the possibility that the requested system tray size is something other than 22x22 pixels, per the Free Desktop specifications
+ setScaledContents(true);
}
KSystemTray::~KSystemTray()
@@ -306,7 +309,7 @@ KActionCollection* KSystemTray::actionCollection()
{
return d->actionCollection;
}
-
+
QPixmap KSystemTray::loadIcon( const QString &icon, KInstance *instance )
{
KConfig *appCfg = kapp->config();
@@ -315,6 +318,11 @@ QPixmap KSystemTray::loadIcon( const QString &icon, KInstance *instance )
return instance->iconLoader()->loadIcon( icon, KIcon::Panel, iconWidth );
}
+QPixmap KSystemTray::loadSizedIcon( const QString &icon, int iconWidth, KInstance *instance )
+{
+ return instance->iconLoader()->loadIcon( icon, KIcon::Panel, iconWidth );
+}
+
void KSystemTray::setPixmap( const QPixmap& p )
{
QLabel::setPixmap( p );