summaryrefslogtreecommitdiffstats
path: root/kcontrol/randr/krandrtray.cpp
diff options
context:
space:
mode:
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