From 1574938ef138766e86fb6ccee42a22b309627f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 13 Jul 2014 18:42:06 +0200 Subject: Fix invisible Klipper tray icon --- klipper/toplevel.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'klipper') diff --git a/klipper/toplevel.cpp b/klipper/toplevel.cpp index d46d867c7..7ebcd1484 100644 --- a/klipper/toplevel.cpp +++ b/klipper/toplevel.cpp @@ -196,23 +196,14 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config ) connect( poll, TQT_SIGNAL( clipboardChanged( bool ) ), this, TQT_SLOT( newClipData( bool ) ) ); - if ( isApplet() ) { + if ( isApplet() || !isShown() ) { m_pixmap = KSystemTray::loadIcon( "klipper" ); - m_iconOrigWidth = width(); - m_iconOrigHeight = height(); } else { - if (isShown()) { - m_pixmap = KSystemTray::loadSizedIcon( "klipper", width() ); - m_iconOrigWidth = width(); - m_iconOrigHeight = height(); - } - else { - m_pixmap = KSystemTray::loadIcon( "klipper" ); - m_iconOrigWidth = m_pixmap.width(); - m_iconOrigHeight = m_pixmap.height(); - } + m_pixmap = KSystemTray::loadSizedIcon( "klipper", width() ); } + m_iconOrigWidth = m_pixmap.width(); + m_iconOrigHeight = m_pixmap.height(); adjustSize(); globalKeys = new TDEGlobalAccel(TQT_TQOBJECT(this)); @@ -307,8 +298,11 @@ void KlipperWidget::paintEvent(TQPaintEvent *) { TQPainter p(this); // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes - if ((m_iconOrigWidth != width()) || (m_iconOrigHeight != height())) { + if (m_scaledpixmap.isNull() || + (m_iconOrigWidth != width()) || (m_iconOrigHeight != height())) { TQImage newIcon; + m_iconOrigWidth = width(); + m_iconOrigHeight = height(); m_pixmap = KSystemTray::loadSizedIcon( "klipper", width() ); newIcon = m_pixmap; newIcon = newIcon.smoothScale(width(), height()); -- cgit v1.2.3