summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-07-13 18:42:06 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-07-13 18:42:33 +0200
commit1574938ef138766e86fb6ccee42a22b309627f29 (patch)
treee515f84d5274a0bcee57b738815a366c7c9da58d
parenta027ac32f4a207da9441f6229e6c0f5f0f9454c9 (diff)
downloadtdebase-1574938ef138766e86fb6ccee42a22b309627f29.tar.gz
tdebase-1574938ef138766e86fb6ccee42a22b309627f29.zip
Fix invisible Klipper tray icon
-rw-r--r--klipper/toplevel.cpp22
1 files changed, 8 insertions, 14 deletions
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());