[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase
From: Antonio Larrosa Jimenez <larrosa () kde ! org>
Date: 2003-08-27 19:39:00
[Download RAW message or body]
CVS commit by antlarr:
Fixing the icons in the system tray of these three applications
M +2 -3 klipper/toplevel.cpp 1.134
M +5 -7 ksystraycmd/ksystraycmd.cpp 1.13
M +9 -2 kxkb/kxkb.cpp 1.60
--- kdebase/kxkb/kxkb.cpp #1.59:1.60
@@ -32,4 +32,5 @@ DESCRIPTION
#include <qtooltip.h>
#include <qstringlist.h>
+#include <qimage.h>
#include <kaboutdata.h>
@@ -42,4 +43,5 @@ DESCRIPTION
#include <kprocess.h>
#include <kiconloader.h>
+#include <kiconeffect.h>
#include <kwinmodule.h>
#include <kwin.h>
@@ -74,5 +76,7 @@ void TrayWindow::setCurrentLayout(const
QToolTip::add(this, mDescriptionMap[layout]);
- setPixmap(findPixmap(layout));
+ KIconEffect iconeffect;
+
+ setPixmap( iconeffect.apply(findPixmap(layout), KIcon::Panel, KIcon::DefaultState) );
}
@@ -95,9 +99,12 @@ void TrayWindow::setLayouts(const QStrin
menu->insertTitle( kapp->miniIcon(), kapp->caption() );
+ KIconEffect iconeffect;
+
int cnt = 0;
QStringList::ConstIterator it;
for (it=layouts.begin(); it != layouts.end(); ++it)
{
- contextMenu()->insertItem(findPixmap(*it), i18n((rules.layouts()[*it])), cnt++);
+ const QPixmap pix=iconeffect.apply(findPixmap(*it), KIcon::Small, KIcon::DefaultState);
+ contextMenu()->insertItem(pix, i18n((rules.layouts()[*it])), cnt++);
mDescriptionMap.insert(*it, i18n((rules.layouts()[*it])));
}
--- kdebase/ksystraycmd/ksystraycmd.cpp #1.12:1.13
@@ -130,5 +130,8 @@ void KSysTrayCmd::refresh()
QToolTip::remove( this );
if ( win ) {
- setPixmap( KWin::icon( win, 20, 20, true ) );
+ KConfig *appCfg = kapp->config();
+ KConfigGroupSaver configSaver(appCfg, "System Tray");
+ int iconWidth = appCfg->readNumEntry("systrayIconWidth", 22);
+ setPixmap( KWin::icon( win, iconWidth, iconWidth, true ) );
QToolTip::add( this, KWin::info( win ).name );
}
@@ -141,10 +144,5 @@ void KSysTrayCmd::refresh()
QToolTip::add( this, window );
- QImage img;
- img = kapp->icon();
- img = img.smoothScale( 20, 20 );
- QPixmap pix;
- pix = img;
- setPixmap( pix );
+ setPixmap( KSystemTray::loadIcon( kapp->iconName() ) );
}
}
--- kdebase/klipper/toplevel.cpp #1.133:1.134
@@ -30,4 +30,5 @@
#include <ksimpleconfig.h>
#include <kstringhandler.h>
+#include <ksystemtray.h>
#include <kwin.h>
#include <kdebug.h>
@@ -96,7 +97,5 @@ KlipperWidget::KlipperWidget( QWidget *p
connect( clip, SIGNAL( dataChanged() ), SLOT( slotClipboardChanged() ));
- // do NOT use UserIcon or appdata or something like that -- this breaks in
- // the kicker applet case!
- m_pixmap = MainBarIcon( "klipper", 22 );
+ m_pixmap = KSystemTray::loadIcon( "klipper" );
adjustSize();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic