summaryrefslogtreecommitdiffstats
path: root/adept/notifier/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adept/notifier/app.cpp')
-rw-r--r--adept/notifier/app.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/adept/notifier/app.cpp b/adept/notifier/app.cpp
index 2ed8c2b..d815772 100644
--- a/adept/notifier/app.cpp
+++ b/adept/notifier/app.cpp
@@ -50,14 +50,27 @@ void TrayWindow::contextMenuAboutToShow( KPopupMenu *r ) {
m_quit->plug( r );
}
+void TrayWindow::resizeEvent ( QResizeEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ setPixmap( m_updates == 0 ?
+ loadSizedIcon( u8( "adept_notifier_ok" ), width() ) :
+ loadSizedIcon( u8( "adept_notifier_warning" ), width() ) );
+
+ if ( m_updates == 0 )
+ hide();
+ else
+ show();
+}
+
void TrayWindow::setAvailableUpdates( int n )
{
m_updates = n;
kdDebug() << "TrayWindow obtained " << n << endl;
setPixmap( m_updates == 0 ?
- loadIcon( u8( "adept_notifier_ok" ) ) :
- loadIcon( u8( "adept_notifier_warning" ) ) );
+ loadSizedIcon( u8( "adept_notifier_ok" ), width() ) :
+ loadSizedIcon( u8( "adept_notifier_warning" ), width() ) );
if ( m_updates == 0 )
hide();
@@ -83,11 +96,23 @@ void ApportTrayWindow::mousePressEvent(QMouseEvent *ev)
hide();
}
+void ApportTrayWindow::resizeEvent ( QResizeEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ setPixmap( loadSizedIcon(u8("apport"), width()) );
+}
+
void RebootTrayWindow::mousePressEvent(QMouseEvent *ev)
{
emit clicked();
}
+void RebootTrayWindow::resizeEvent ( QResizeEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ setPixmap( loadSizedIcon(u8("reload"), width()) );
+}
+
NotifierApp::NotifierApp(bool allowStyles, bool GUIenabled)
: KUniqueApplication(allowStyles, GUIenabled),
m_tray( 0 )
@@ -141,10 +166,10 @@ NotifierApp::NotifierApp(bool allowStyles, bool GUIenabled)
*proc << "/usr/share/apport/apport-checkreports";
connect( proc, SIGNAL(processExited(KProcess*)), this, SLOT(apportCheckExited(KProcess*)) );
proc->start(KProcess::Block);
-
+
if (m_crashes) {
ApportTrayWindow* crashApplet = new ApportTrayWindow;
- crashApplet->setPixmap( crashApplet->loadIcon(u8("apport")) );
+ crashApplet->setPixmap( crashApplet->loadSizedIcon(u8("apport"), crashApplet->width()) );
QString crashMessage = i18n("An application has crashed on your "
"system (now or in the past).\n"
"Click to "
@@ -204,7 +229,7 @@ void NotifierApp::rebootWatcher(const QString& path) {
if (path == QString("/var/lib/update-notifier/dpkg-run-stamp") && m_rebootRequired && !m_rebootShown) {
RebootTrayWindow* rebootApplet = new RebootTrayWindow;
- rebootApplet->setPixmap( rebootApplet->loadIcon(u8("reload")) );
+ rebootApplet->setPixmap( rebootApplet->loadSizedIcon(u8("reload"), rebootApplet->width()) );
QString rebootMessage = i18n("In order to complete the update your system needs to be restarted.");
QToolTip::add(rebootApplet, rebootMessage);