From 8231cc23f3e8b266a6b0e229865905233e867cbf Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 7 Jul 2014 19:51:30 -0500 Subject: Fix korgac abort on startup due to oversized tray icon creation when icon widget has not yet been shown Properly print caldav/carddav wallet warnings to prevent backtrace spew --- knotes/knotesapp.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'knotes/knotesapp.cpp') diff --git a/knotes/knotesapp.cpp b/knotes/knotesapp.cpp index 26aee48c..14fd625b 100644 --- a/knotes/knotesapp.cpp +++ b/knotes/knotesapp.cpp @@ -105,7 +105,7 @@ KNotesApp::KNotesApp() KWin::setSystemTrayWindowFor( winId(), tqt_xrootwin() ); TQToolTip::add( this, i18n( "KNotes: Sticky notes for TDE" ) ); setBackgroundMode( X11ParentRelative ); - setPixmap( KSystemTray::loadSizedIcon( "knotes", TQWidget::width() ) ); + setPixmap( KSystemTray::loadIcon( "knotes" ) ); // set the initial style KNote::setStyle( KNotesGlobalConfig::style() ); @@ -210,7 +210,7 @@ KNotesApp::KNotesApp() updateNoteActions(); } -void KNotesApp::resizeEvent ( TQResizeEvent * ) +void KNotesApp::resizeTrayIcon () { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes TQPixmap origpixmap; @@ -223,6 +223,18 @@ void KNotesApp::resizeEvent ( TQResizeEvent * ) setPixmap(scaledpixmap); } +void KNotesApp::resizeEvent ( TQResizeEvent * ) +{ + // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes + resizeTrayIcon(); +} + +void KNotesApp::showEvent ( TQShowEvent * ) +{ + // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes + resizeTrayIcon(); +} + KNotesApp::~KNotesApp() { saveNotes(); -- cgit v1.2.3