summaryrefslogtreecommitdiffstats
path: root/knotes/knotesapp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knotes/knotesapp.cpp')
-rw-r--r--knotes/knotesapp.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/knotes/knotesapp.cpp b/knotes/knotesapp.cpp
index 80bf1f086..1a1bdde89 100644
--- a/knotes/knotesapp.cpp
+++ b/knotes/knotesapp.cpp
@@ -105,7 +105,7 @@ KNotesApp::KNotesApp()
KWin::setSystemTrayWindowFor( winId(), qt_xrootwin() );
QToolTip::add( this, i18n( "KNotes: Sticky notes for KDE" ) );
setBackgroundMode( X11ParentRelative );
- setPixmap( KSystemTray::loadIcon( "knotes" ) );
+ setPixmap( KSystemTray::loadSizedIcon( "knotes", QWidget::width() ) );
// set the initial style
KNote::setStyle( KNotesGlobalConfig::style() );
@@ -210,6 +210,19 @@ KNotesApp::KNotesApp()
updateNoteActions();
}
+void KNotesApp::resizeEvent ( QResizeEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ QPixmap origpixmap;
+ QPixmap scaledpixmap;
+ QImage newIcon;
+ origpixmap = KSystemTray::loadSizedIcon( "knotes", QWidget::width() );
+ newIcon = origpixmap;
+ newIcon = newIcon.smoothScale(QWidget::width(), QWidget::height());
+ scaledpixmap = newIcon;
+ setPixmap(scaledpixmap);
+}
+
KNotesApp::~KNotesApp()
{
saveNotes();