summaryrefslogtreecommitdiffstats
path: root/kcontrol/randr/krandrtray.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-10 03:04:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-10 03:04:21 +0000
commit5ccb957341daaf5c223a49391f3076e95832ac1f (patch)
tree0e23ba8717f429560881bedc107e1f6de2c78075 /kcontrol/randr/krandrtray.cpp
parent4d3847fc45c6700ec1667d9616c8f91b734cb75d (diff)
downloadtdebase-5ccb957341daaf5c223a49391f3076e95832ac1f.tar.gz
tdebase-5ccb957341daaf5c223a49391f3076e95832ac1f.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/kdebase@1124757 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/randr/krandrtray.cpp')
-rw-r--r--kcontrol/randr/krandrtray.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp
index adfe48e5f..8b230ba74 100644
--- a/kcontrol/randr/krandrtray.cpp
+++ b/kcontrol/randr/krandrtray.cpp
@@ -51,7 +51,7 @@ KRandRSystemTray::KRandRSystemTray(QWidget* parent, const char *name)
, m_popupUp(false)
, m_help(new KHelpMenu(this, KGlobal::instance()->aboutData(), false, actionCollection()))
{
- setPixmap(KSystemTray::loadIcon("randr"));
+ setPixmap(KSystemTray::loadSizedIcon("randr", width()));
setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
connect(this, SIGNAL(quitSelected()), kapp, SLOT(quit()));
QToolTip::add(this, i18n("Screen resize & rotate"));
@@ -88,6 +88,19 @@ KRandRSystemTray::KRandRSystemTray(QWidget* parent, const char *name)
}
}
+void KRandRSystemTray::resizeEvent ( QResizeEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ QPixmap origpixmap;
+ QPixmap scaledpixmap;
+ QImage newIcon;
+ origpixmap = KSystemTray::loadSizedIcon( "randr", width() );
+ newIcon = origpixmap;
+ newIcon = newIcon.smoothScale(width(), height());
+ scaledpixmap = newIcon;
+ setPixmap(scaledpixmap);
+}
+
void KRandRSystemTray::mousePressEvent(QMouseEvent* e)
{
// Popup the context menu with left-click