diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-01 18:25:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-01 18:25:02 +0000 |
commit | 291eb697d16574d229c819334204250ab5616077 (patch) | |
tree | 2b10ca78c086e01aeee2feb056e5586f23bcfb9a | |
parent | 31ce63759fa4a3111634bb6e1d5dd05c314a427f (diff) | |
download | tdebase-291eb697d16574d229c819334204250ab5616077.tar.gz tdebase-291eb697d16574d229c819334204250ab5616077.zip |
Fix shutdown dialog icon background
Fix Kicker show desktop button tooltip
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1250808 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kicker/applets/launcher/quickbutton.cpp | 8 | ||||
-rw-r--r-- | ksmserver/shutdowndlg.cpp | 40 |
2 files changed, 26 insertions, 22 deletions
diff --git a/kicker/applets/launcher/quickbutton.cpp b/kicker/applets/launcher/quickbutton.cpp index 996d8abe3..0c19e5326 100644 --- a/kicker/applets/launcher/quickbutton.cpp +++ b/kicker/applets/launcher/quickbutton.cpp @@ -343,8 +343,12 @@ void QuickButton::updateKickerTip(KickerTip::Data &data) { data.subtext = data.message; } - data.icon = KMimeType::pixmapForURL(_qurl->kurl(), 0, - KIcon::Panel, KIcon::SizeHuge, KIcon::DefaultState); + if (_qurl->url() == "SPECIAL_BUTTON__SHOW_DESKTOP") { + data.icon = KGlobal::iconLoader()->loadIcon("desktop", KIcon::Panel, KIcon::SizeHuge, KIcon::DefaultState); + } + else { + data.icon = KMimeType::pixmapForURL(_qurl->kurl(), 0, KIcon::Panel, KIcon::SizeHuge, KIcon::DefaultState); + } } void QuickButton::setPopupDirection(KPanelApplet::Direction d) diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index e21cbf4a3..d16c36335 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -1105,28 +1105,28 @@ KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent) TQWidget* ticon = new TQWidget( frame ); KIconLoader * ldr = KGlobal::iconLoader(); TQPixmap trinityPixmap = ldr->loadIcon("kmenu", KIcon::Panel, KIcon::SizeLarge, KIcon::DefaultState, 0L, true); - if (TQPaintDevice::x11AppDepth() == 32) { - // Manually draw the alpha portions onto the widget background color... - TQRgb backgroundRgb = ticon->paletteBackgroundColor().rgb(); - TQImage correctedImage = trinityPixmap.convertToImage(); - correctedImage = correctedImage.convertDepth(32); - correctedImage.setAlphaBuffer(true); - int w = correctedImage.width(); - int h = correctedImage.height(); - for (int y = 0; y < h; ++y) { - TQRgb *ls = (TQRgb *)correctedImage.scanLine( y ); - for (int x = 0; x < w; ++x) { - TQRgb l = ls[x]; - float alpha_adjust = tqAlpha( l )/255.0; - int r = int( (tqRed( l ) * alpha_adjust) + (tqRed( backgroundRgb ) * (1.0-alpha_adjust)) ); - int g = int( (tqGreen( l ) * alpha_adjust) + (tqGreen( backgroundRgb ) * (1.0-alpha_adjust)) ); - int b = int( (tqBlue( l ) * alpha_adjust) + (tqBlue( backgroundRgb ) * (1.0-alpha_adjust)) ); - int a = int( 255 ); - ls[x] = tqRgba( r, g, b, a ); - } + + // Manually draw the alpha portions of the icon onto the widget background color... + TQRgb backgroundRgb = ticon->paletteBackgroundColor().rgb(); + TQImage correctedImage = trinityPixmap.convertToImage(); + correctedImage = correctedImage.convertDepth(32); + correctedImage.setAlphaBuffer(true); + int w = correctedImage.width(); + int h = correctedImage.height(); + for (int y = 0; y < h; ++y) { + TQRgb *ls = (TQRgb *)correctedImage.scanLine( y ); + for (int x = 0; x < w; ++x) { + TQRgb l = ls[x]; + float alpha_adjust = tqAlpha( l )/255.0; + int r = int( (tqRed( l ) * alpha_adjust) + (tqRed( backgroundRgb ) * (1.0-alpha_adjust)) ); + int g = int( (tqGreen( l ) * alpha_adjust) + (tqGreen( backgroundRgb ) * (1.0-alpha_adjust)) ); + int b = int( (tqBlue( l ) * alpha_adjust) + (tqBlue( backgroundRgb ) * (1.0-alpha_adjust)) ); + int a = int( 255 ); + ls[x] = tqRgba( r, g, b, a ); } - trinityPixmap.convertFromImage(correctedImage); } + trinityPixmap.convertFromImage(correctedImage); + ticon->setBackgroundPixmap(trinityPixmap); ticon->setMinimumSize(trinityPixmap.size()); ticon->setMaximumSize(trinityPixmap.size()); |