summaryrefslogtreecommitdiffstats
path: root/knotes
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-10 03:05:08 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-10 03:05:08 +0000
commit54887c51b14c7707178d43d39413bf1bc7a17472 (patch)
tree759a415a01e0b1f588c94ef8584d60121da96439 /knotes
parent3ef2d4c713c90cf32f0a976aed547e281840575b (diff)
downloadtdepim-54887c51b14c7707178d43d39413bf1bc7a17472.tar.gz
tdepim-54887c51b14c7707178d43d39413bf1bc7a17472.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/kdepim@1124759 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knotes')
-rw-r--r--knotes/knotesapp.cpp15
-rw-r--r--knotes/knotesapp.h1
2 files changed, 15 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();
diff --git a/knotes/knotesapp.h b/knotes/knotesapp.h
index f0cf8551b..9cfa5ad31 100644
--- a/knotes/knotesapp.h
+++ b/knotes/knotesapp.h
@@ -102,6 +102,7 @@ public slots:
protected:
void mousePressEvent( QMouseEvent* );
+ void resizeEvent ( QResizeEvent * );
protected slots:
void slotShowNote();