diff options
author | Dan Armak <danarmak@gentoo.org> | 2002-07-16 20:37:01 +0000 |
---|---|---|
committer | Dan Armak <danarmak@gentoo.org> | 2002-07-16 20:37:01 +0000 |
commit | bf1871ceefa443d6c2a75f3a0fd8dc9702e91fd0 (patch) | |
tree | bbcc5cec39be035125f61aa603809709d7d44b52 /kde-base | |
parent | style updates (diff) | |
download | gentoo-2-bf1871ceefa443d6c2a75f3a0fd8dc9702e91fd0.tar.gz gentoo-2-bf1871ceefa443d6c2a75f3a0fd8dc9702e91fd0.tar.bz2 gentoo-2-bf1871ceefa443d6c2a75f3a0fd8dc9702e91fd0.zip |
add patches for kde 3.1alpha1 to enable menu shadows; recompile kdelibs and kdebase to get it to work
Diffstat (limited to 'kde-base')
-rw-r--r-- | kde-base/kdebase/files/kdebase-3.1_alpha1-menushadows.diff | 174 | ||||
-rw-r--r-- | kde-base/kdebase/kdebase-3.1_alpha1.ebuild | 4 | ||||
-rw-r--r-- | kde-base/kdelibs/files/kdelibs-3.1_alpha1-menushadows.diff | 393 | ||||
-rw-r--r-- | kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild | 4 |
4 files changed, 573 insertions, 2 deletions
diff --git a/kde-base/kdebase/files/kdebase-3.1_alpha1-menushadows.diff b/kde-base/kdebase/files/kdebase-3.1_alpha1-menushadows.diff new file mode 100644 index 000000000000..8de92ecb3e0d --- /dev/null +++ b/kde-base/kdebase/files/kdebase-3.1_alpha1-menushadows.diff @@ -0,0 +1,174 @@ +--- kcontrol/style/kcmstyle.cpp 2002/06/28 12:35:51 1.37 ++++ kcontrol/style/kcmstyle.cpp 2002/07/05 13:52:02 1.38 +@@ -1,5 +1,5 @@ + /* +- * $Id: kdebase-3.1_alpha1-menushadows.diff,v 1.1 2002/07/16 20:37:01 danarmak Exp $ ++ * $Id: kdebase-3.1_alpha1-menushadows.diff,v 1.1 2002/07/16 20:37:01 danarmak Exp $ + * + * KCMStyle + * Copyright (C) 2002 Karol Szwed <gallium@kde.org> +@@ -249,6 +249,9 @@ + lblMenuHandle->setBuddy( comboMenuHandle ); + containerLayout->addWidget( lblMenuHandle, 3, 0 ); + containerLayout->addWidget( comboMenuHandle, 3, 1 ); ++ ++ cbMenuShadow = new QCheckBox( i18n("Menu &drop shadow"), containerFrame ); ++ containerLayout->addWidget( cbMenuShadow, 4, 0 ); + + // Push the [label combo] to the left. + comboSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); +@@ -295,6 +298,7 @@ + lblMenuEffectType->setAlignment( AlignBottom | AlignLeft ); + lblMenuOpacity = new QLabel( slOpacity, i18n("Menu &opacity:"), menuContainer ); + lblMenuOpacity->setAlignment( AlignBottom | AlignLeft ); ++ + menuContainerLayout->addWidget( lblMenuEffectType, 0, 0 ); + menuContainerLayout->addWidget( comboMenuEffectType, 1, 0 ); + menuContainerLayout->addWidget( lblMenuOpacity, 2, 0 ); +@@ -353,12 +357,14 @@ + connect(lvStyle, SIGNAL(selectionChanged()), this, SLOT(setStyleDirty())); + // Page2 + connect( cbEnableEffects, SIGNAL(toggled(bool)), this, SLOT(setEffectsDirty())); ++ connect( cbEnableEffects, SIGNAL(toggled(bool)), this, SLOT(setStyleDirty())); + connect( comboTooltipEffect, SIGNAL(highlighted(int)), this, SLOT(setEffectsDirty())); + connect( comboComboEffect, SIGNAL(highlighted(int)), this, SLOT(setEffectsDirty())); + connect( comboMenuEffect, SIGNAL(highlighted(int)), this, SLOT(setStyleDirty())); + connect( comboMenuHandle, SIGNAL(highlighted(int)), this, SLOT(setStyleDirty())); + connect( comboMenuEffectType, SIGNAL(highlighted(int)), this, SLOT(setStyleDirty())); +- connect( slOpacity, SIGNAL(valueChanged(int)),this, SLOT(setEffectsDirty())); ++ connect( slOpacity, SIGNAL(valueChanged(int)),this, SLOT(setStyleDirty())); ++ connect( cbMenuShadow, SIGNAL(toggled(bool)), this, SLOT(setStyleDirty())); + // Page3 + connect( cbHoverButtons, SIGNAL(toggled(bool)), this, SLOT(setToolbarsDirty())); + connect( cbTransparentToolbars, SIGNAL(toggled(bool)), this, SLOT(setToolbarsDirty())); +@@ -413,11 +419,13 @@ + return; + + bool allowMenuTransparency = false; ++ bool allowMenuDropShadow = false; + + // Read the KStyle flags to see if the style writer + // has enabled menu translucency in the style. + if (appliedStyle && appliedStyle->inherits("KStyle")) + { ++ allowMenuDropShadow = true; + KStyle* style = dynamic_cast<KStyle*>(appliedStyle); + if (style) { + KStyle::KStyleFlags flags = style->styleFlags(); +@@ -426,19 +434,35 @@ + } + } + ++ QString warn_string( i18n("<qt>Selected style: <b>%1</b><br><br>" ++ "Some effects(s) that you have chosen could not be applied because the selected style " ++ "does not support these effects. They have therefore been disabled.<br>" ++ "<br>" ).arg( lvStyle->currentItem()->text(2)) ); ++ bool show_warning = false; ++ + // Warn the user if they're applying a style that doesn't support + // menu translucency and they enabled it. + if ( (!allowMenuTransparency) && + (cbEnableEffects->isChecked()) && + (comboMenuEffect->currentItem() == 3) ) // Make Translucent + { +- KMessageBox::information( this, +- i18n("This module has detected that the currently selected style (%1) " +- "does not support Menu Translucency, therefore " +- "this Menu Effect has been disabled.").arg( lvStyle->currentItem()->text( 2 ) ) ); +- comboMenuEffect->setCurrentItem(0); // Disable menu effect. ++ warn_string += "Menu translucency is not available.<br>"; ++ comboMenuEffect->setCurrentItem(0); // Disable menu effect. ++ show_warning = true; ++ } ++ ++ if (!allowMenuDropShadow && cbMenuShadow->isChecked()) ++ { ++ warn_string += "Menu drop-shadows are not available."; ++ cbMenuShadow->setChecked(false); ++ show_warning = true; + } + ++ // Tell the user what features we could not apply on their behalf. ++ if (show_warning) ++ KMessageBox::information(this, warn_string); ++ ++ + // Save effects. + KConfig config( "kdeglobals" ); + config.setGroup("KDE"); +@@ -470,6 +494,8 @@ + QSettings settings; // Only for KStyle stuff + settings.writeEntry("/KStyle/Settings/MenuTransparencyEngine", engine); + settings.writeEntry("/KStyle/Settings/MenuOpacity", slOpacity->value()/100.0); ++ settings.writeEntry("/KStyle/Settings/MenuDropShadow", ++ cbEnableEffects->isChecked() && cbMenuShadow->isChecked() ); + } + + // Misc page +@@ -556,9 +582,10 @@ + comboTooltipEffect->setCurrentItem(0); + comboComboEffect->setCurrentItem(0); + comboMenuEffect->setCurrentItem(0); +- comboMenuHandle->setCurrentItem(0); ++ comboMenuHandle->setCurrentItem(0); + comboMenuEffectType->setCurrentItem(0); + slOpacity->setValue(90); ++ cbMenuShadow->setChecked(false); + + // Miscellanous + cbHoverButtons->setChecked(true); +@@ -703,6 +730,8 @@ + + currentStyle = lvStyle->currentItem()->text(2); + m_bStyleDirty = false; ++ ++ switchStyle( currentStyle ); // make resets visible + } + + +@@ -801,7 +830,7 @@ + + comboMenuHandle->setCurrentItem(config.readNumEntry("InsertTearOffHandle", 0)); + +- // KStyle Menu transparency options... ++ // KStyle Menu transparency and drop-shadow options... + QSettings settings; + QString effectEngine = settings.readEntry("/KStyle/Settings/MenuTransparencyEngine", "Disabled"); + +@@ -832,6 +861,9 @@ + + slOpacity->setValue( (int)(100 * settings.readDoubleEntry("/KStyle/Settings/MenuOpacity", 0.90)) ); + ++ // Menu Drop-shadows... ++ cbMenuShadow->setChecked( settings.readBoolEntry("/KStyle/Settings/MenuDropShadow", false) ); ++ + if (cbEnableEffects->isChecked()) { + containerFrame->setEnabled( true ); + menuContainer->setEnabled( comboMenuEffect->currentItem() == 3 ); +@@ -934,6 +966,9 @@ + "<p><b>Animate: </b>Do some animation.</p>\n" + "<p><b>Fade: </b>Fade in menus using alpha-blending.</p>\n" + "<b>Make Translucent: </b>Alpha-blend menus for a see-through effect. (KDE styles only)") ); ++ QWhatsThis::add( cbMenuShadow, i18n( "When enabled, all popup menus will have a drop-shadow, otherwise " ++ "drop-shadows will not be displayed. At present, only KDE styles can have this " ++ "effect enabled.") ); + QWhatsThis::add( comboMenuEffectType, i18n( "<p><b>Software Tint: </b>Alpha-blend using a flat color.</p>\n" + "<p><b>Software Blend: </b>Alpha-blend using an image.</p>\n" + "<b>XRender Blend: </b>Use the XFree RENDER extension for image blending (if available). " +--- kcontrol/style/kcmstyle.h 2002/04/26 17:04:19 1.9 ++++ kcontrol/style/kcmstyle.h 2002/07/05 13:52:02 1.10 +@@ -1,5 +1,5 @@ + /* +- * $Id: kdebase-3.1_alpha1-menushadows.diff,v 1.1 2002/07/16 20:37:01 danarmak Exp $ ++ * $Id: kdebase-3.1_alpha1-menushadows.diff,v 1.1 2002/07/16 20:37:01 danarmak Exp $ + * + * KCMStyle + * Copyright (C) 2002 Karol Szwed <gallium@kde.org> +@@ -135,6 +135,7 @@ + QComboBox* comboMenuEffectType; + QLabel* lblMenuEffectType; + QLabel* lblMenuOpacity; ++ QCheckBox* cbMenuShadow; + + // Page3 widgets + QGroupBox* gbToolbarSettings; diff --git a/kde-base/kdebase/kdebase-3.1_alpha1.ebuild b/kde-base/kdebase/kdebase-3.1_alpha1.ebuild index 205802f40e23..483dd934b371 100644 --- a/kde-base/kdebase/kdebase-3.1_alpha1.ebuild +++ b/kde-base/kdebase/kdebase-3.1_alpha1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdebase/kdebase-3.1_alpha1.ebuild,v 1.1 2002/07/12 22:07:34 danarmak Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdebase/kdebase-3.1_alpha1.ebuild,v 1.2 2002/07/16 20:37:01 danarmak Exp $ inherit kde-dist DESCRIPTION="${DESCRIPTION}Base" @@ -17,6 +17,8 @@ newdepend ">=media-sound/cdparanoia-3.9.8 samba? ( net-fs/samba )" # lm_sensors? ( ?/lm_sensors ) # ebuild doesn't exist yet +PATCHES="${FILESDIR}/${P}-menushadows.diff" + myconf="$myconf --with-dpms --with-cdparanoia" use ldap && myconf="$myconf --with-ldap" || myconf="$myconf --without-ldap" diff --git a/kde-base/kdelibs/files/kdelibs-3.1_alpha1-menushadows.diff b/kde-base/kdelibs/files/kdelibs-3.1_alpha1-menushadows.diff new file mode 100644 index 000000000000..6d0c6930893f --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-3.1_alpha1-menushadows.diff @@ -0,0 +1,393 @@ +--- kdefx/kstyle.cpp 2002/03/25 21:08:41 1.17 ++++ kdefx/kstyle.cpp 2002/07/05 13:58:00 1.18 +@@ -1,5 +1,5 @@ + /* +- * $Id: kdelibs-3.1_alpha1-menushadows.diff,v 1.1 2002/07/16 20:37:01 danarmak Exp $ ++ * $Id: kdelibs-3.1_alpha1-menushadows.diff,v 1.1 2002/07/16 20:37:01 danarmak Exp $ + * + * KStyle + * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> +@@ -31,6 +31,7 @@ + #include <qapplication.h> + #include <qbitmap.h> + #include <qcleanuphandler.h> ++#include <qmap.h> + #include <qimage.h> + #include <qlistview.h> + #include <qmenubar.h> +@@ -50,25 +51,77 @@ + #include <kimageeffect.h> + #include "kstyle.h" + +-#ifdef HAVE_XRENDER + #include <X11/Xlib.h> ++#ifdef HAVE_XRENDER + #include <X11/extensions/Xrender.h> + extern bool qt_use_xrender; + #endif + ++namespace ++{ ++ // INTERNAL ++ enum TransparencyEngine { ++ Disabled = 0, ++ SoftwareTint, ++ SoftwareBlend, ++ XRender ++ }; ++ ++ // Drop Shadow ++ struct ShadowElements { ++ QWidget* w1; ++ QWidget* w2; ++ }; ++ typedef QMap<const QPopupMenu*,ShadowElements> ShadowMap; ++ ShadowMap shadowMap; ++ ++ // DO NOT ASK ME HOW I MADE THESE TABLES! ++ // (I probably won't remember anyway ;) ++ const double top_right_corner[16] = ++ { 0.949, 0.965, 0.980, 0.992, ++ 0.851, 0.890, 0.945, 0.980, ++ 0.706, 0.780, 0.890, 0.960, ++ 0.608, 0.706, 0.851, 0.949 }; ++ ++ const double bottom_right_corner[16] = ++ { 0.608, 0.706, 0.851, 0.949, ++ 0.706, 0.780, 0.890, 0.960, ++ 0.851, 0.890, 0.945, 0.980, ++ 0.949, 0.965, 0.980, 0.992 }; ++ ++ const double bottom_left_corner[16] = ++ { 0.949, 0.851, 0.706, 0.608, ++ 0.965, 0.890, 0.780, 0.706, ++ 0.980, 0.945, 0.890, 0.851, ++ 0.992, 0.980, 0.960, 0.949 }; + +-// INTERNAL +-enum TransparencyEngine { +- Disabled = 0, +- SoftwareTint, +- SoftwareBlend, +- XRender ++ const double shadow_strip[4] = ++ { 0.565, 0.675, 0.835, 0.945 }; + }; + ++ ++struct KStylePrivate ++{ ++ bool highcolor : 1; ++ bool useFilledFrameWorkaround : 1; ++ bool etchDisabledText : 1; ++ bool menuAltKeyNavigation : 1; ++ bool menuDropShadow : 1; ++ int popupMenuDelay; ++ float menuOpacity; ++ ++ TransparencyEngine transparencyEngine; ++ KStyle::KStyleScrollBarType scrollbarType; ++ TransparencyHandler* menuHandler; ++ KStyle::KStyleFlags flags; ++}; ++ ++ + class TransparencyHandler : public QObject + { + public: +- TransparencyHandler(KStyle* style, TransparencyEngine tEngine, float menuOpacity); ++ TransparencyHandler(KStyle* style, TransparencyEngine tEngine, ++ float menuOpacity, bool useDropShadow); + ~TransparencyHandler(); + bool eventFilter(QObject* object, QEvent* event); + +@@ -78,7 +131,12 @@ + #ifdef HAVE_XRENDER + void XRenderBlendToPixmap(const QPopupMenu* p); + #endif ++ void createShadowWindows(const QPopupMenu* p); ++ void removeShadowWindows(const QPopupMenu* p); ++ void rightShadow(QImage& dst); ++ void bottomShadow(QImage& dst); + private: ++ bool dropShadow; + float opacity; + QPixmap pix; + KStyle* kstyle; +@@ -86,21 +144,6 @@ + }; + + +-struct KStylePrivate +-{ +- bool highcolor : 1; +- bool useFilledFrameWorkaround : 1; +- bool etchDisabledText : 1; +- bool menuAltKeyNavigation : 1; +- int popupMenuDelay; +- float menuOpacity; +- +- TransparencyEngine transparencyEngine; +- KStyle::KStyleScrollBarType scrollbarType; +- TransparencyHandler* menuHandler; +- KStyle::KStyleFlags flags; +-}; +- + // ----------------------------------------------------------------------------- + + +@@ -118,6 +161,7 @@ + d->popupMenuDelay = settings.readNumEntry ("/KStyle/Settings/PopupMenuDelay", 256); + d->etchDisabledText = settings.readBoolEntry("/KStyle/Settings/EtchDisabledText", true); + d->menuAltKeyNavigation = settings.readBoolEntry("/KStyle/Settings/MenuAltKeyNavigation", true); ++ d->menuDropShadow = settings.readBoolEntry("/KStyle/Settings/MenuDropShadow", false); + d->menuHandler = NULL; + + if (useMenuTransparency) { +@@ -140,9 +184,14 @@ + if (d->transparencyEngine != Disabled) { + // Create an instance of the menu transparency handler + d->menuOpacity = settings.readDoubleEntry("/KStyle/Settings/MenuOpacity", 0.90); +- d->menuHandler = new TransparencyHandler(this, d->transparencyEngine, d->menuOpacity); ++ d->menuHandler = new TransparencyHandler(this, d->transparencyEngine, ++ d->menuOpacity, d->menuDropShadow); + } + } ++ ++ // Create a transparency handler if only drop shadows are enabled. ++ if (!d->menuHandler && d->menuDropShadow) ++ d->menuHandler = new TransparencyHandler(this, Disabled, 1.0, d->menuDropShadow); + } + + +@@ -1678,57 +1727,207 @@ + // ----------------------------------------------------------------------------- + + TransparencyHandler::TransparencyHandler( KStyle* style, +- TransparencyEngine tEngine, float menuOpacity ) ++ TransparencyEngine tEngine, float menuOpacity, bool useDropShadow ) + : QObject() + { + te = tEngine; + kstyle = style; + opacity = menuOpacity; ++ dropShadow = useDropShadow; + pix.setOptimization(QPixmap::BestOptim); + }; + +- + TransparencyHandler::~TransparencyHandler() + { + }; + ++// This is meant to be ugly but fast. ++void TransparencyHandler::rightShadow(QImage& dst) ++{ ++ if (dst.depth() != 32) ++ dst = dst.convertDepth(32); ++ ++ // blend top-right corner. ++ int pixels = dst.width() * dst.height(); ++#ifdef WORDS_BIGENDIAN ++ register unsigned char* data = dst.bits() + 1; // Skip alpha ++#else ++ register unsigned char* data = dst.bits(); // Skip alpha ++#endif ++ for(register int i = 0; i < 16; i++) { ++ *data++ = (unsigned char)((*data)*top_right_corner[i]); ++ *data++ = (unsigned char)((*data)*top_right_corner[i]); ++ *data++ = (unsigned char)((*data)*top_right_corner[i]); ++ data++; // skip alpha ++ } ++ ++ pixels -= 32; // tint right strip without rounded edges. ++ register int c = 0; ++ for(register int i = 0; i < pixels; i++) { ++ *data++ = (unsigned char)((*data)*shadow_strip[c]); ++ *data++ = (unsigned char)((*data)*shadow_strip[c]); ++ *data++ = (unsigned char)((*data)*shadow_strip[c]); ++ data++; // skip alpha ++ c = ++c % 4; ++ } ++ ++ // tint bottom edge ++ for(register int i = 0; i < 16; i++) { ++ *data++ = (unsigned char)((*data)*bottom_right_corner[i]); ++ *data++ = (unsigned char)((*data)*bottom_right_corner[i]); ++ *data++ = (unsigned char)((*data)*bottom_right_corner[i]); ++ data++; // skip alpha ++ } ++} ++ ++void TransparencyHandler::bottomShadow(QImage& dst) ++{ ++ if (dst.depth() != 32) ++ dst = dst.convertDepth(32); ++ ++ int line = 0; ++ int width = dst.width() - 4; ++ double strip_data = shadow_strip[0]; ++ double* corner = const_cast<double*>(bottom_left_corner); ++ ++#ifdef WORDS_BIGENDIAN ++ register unsigned char* data = dst.bits() + 1; // Skip alpha ++#else ++ register unsigned char* data = dst.bits(); // Skip alpha ++#endif ++ ++ for(int y = 0; y < 4; y++) ++ { ++ // Bottom-left Corner ++ for(register int x = 0; x < 4; x++) { ++ *data++ = (unsigned char)((*data)*(*corner)); ++ *data++ = (unsigned char)((*data)*(*corner)); ++ *data++ = (unsigned char)((*data)*(*corner)); ++ data++; // skip alpha ++ corner++; ++ } ++ ++ // Scanline ++ for(register int x = 0; x < width; x++) { ++ *data++ = (unsigned char)((*data)*strip_data); ++ *data++ = (unsigned char)((*data)*strip_data); ++ *data++ = (unsigned char)((*data)*strip_data); ++ data++; ++ } ++ ++ strip_data = shadow_strip[++line]; ++ } ++} ++ ++// Create a shadow of thickness 4. ++void TransparencyHandler::createShadowWindows(const QPopupMenu* p) ++{ ++ int x2 = p->x()+p->width(); ++ int y2 = p->y()+p->height(); ++ QRect shadow1(x2, p->y() + 4, 4, p->height()); ++ QRect shadow2(p->x() + 4, y2, p->width() - 4, 4); ++ ++ // Create a fake drop-down shadow effect via blended Xwindows ++ ShadowElements se; ++ se.w1 = new QWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM ); ++ se.w2 = new QWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM ); ++ se.w1->setGeometry(shadow1); ++ se.w2->setGeometry(shadow2); ++ // Insert a new ShadowMap entry ++ shadowMap[p] = se; ++ ++ // Some hocus-pocus here to create the drop-shadow. ++ QPixmap pix_shadow1 = QPixmap::grabWindow(qt_xrootwin(), ++ shadow1.x(), shadow1.y(), shadow1.width(), shadow1.height()); ++ QPixmap pix_shadow2 = QPixmap::grabWindow(qt_xrootwin(), ++ shadow2.x(), shadow2.y(), shadow2.width(), shadow2.height()); ++ ++ QImage img; ++ img = pix_shadow1.convertToImage(); ++ rightShadow(img); ++ pix_shadow1.convertFromImage(img); ++ img = pix_shadow2.convertToImage(); ++ bottomShadow(img); ++ pix_shadow2.convertFromImage(img); ++ ++ // Set the background pixmaps ++ se.w1->setErasePixmap(pix_shadow1); ++ se.w2->setErasePixmap(pix_shadow2); ++ ++ // Show the 'shadow' just before showing the popup menu window ++ // Don't use QWidget::show() so we don't confuse QEffects, thus causing broken focus. ++ XMapWindow(qt_xdisplay(), se.w1->winId()); ++ XMapWindow(qt_xdisplay(), se.w2->winId()); ++} ++ ++void TransparencyHandler::removeShadowWindows(const QPopupMenu* p) ++{ ++ ShadowMap::iterator it = shadowMap.find(p); ++ if (it != shadowMap.end()) ++ { ++ ShadowElements se = it.data(); ++ XUnmapWindow(qt_xdisplay(), se.w1->winId()); // hide ++ XUnmapWindow(qt_xdisplay(), se.w2->winId()); ++ delete se.w1; ++ delete se.w2; ++ shadowMap.erase(it); ++ } ++} + + bool TransparencyHandler::eventFilter( QObject* object, QEvent* event ) + { + // Transparency idea was borrowed from KDE2's "MegaGradient" Style, + // Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> ++ ++ // Added 'fake' menu shadows <04-Jul-2002> -- Karol + QPopupMenu* p = (QPopupMenu*)object; + QEvent::Type et = event->type(); + +- if (et == QEvent::Show) ++ if (et == QEvent::Show) + { +- pix = QPixmap::grabWindow(qt_xrootwin(), +- p->x(), p->y(), p->width(), p->height()); ++ // Handle translucency ++ if (te != Disabled) ++ { ++ pix = QPixmap::grabWindow(qt_xrootwin(), ++ p->x(), p->y(), p->width(), p->height()); + +- switch (te) { ++ switch (te) { + #ifdef HAVE_XRENDER +- case XRender: +- if (qt_use_xrender) { +- XRenderBlendToPixmap(p); +- break; +- } +- // Fall through intended ++ case XRender: ++ if (qt_use_xrender) { ++ XRenderBlendToPixmap(p); ++ break; ++ } ++ // Fall through intended + #else +- case XRender: ++ case XRender: + #endif +- case SoftwareBlend: +- blendToPixmap(p->colorGroup(), p); +- break; ++ case SoftwareBlend: ++ blendToPixmap(p->colorGroup(), p); ++ break; + +- case SoftwareTint: +- default: +- blendToColor(p->colorGroup().button()); +- }; ++ case SoftwareTint: ++ default: ++ blendToColor(p->colorGroup().button()); ++ }; + +- p->setErasePixmap(pix); +- } ++ p->setErasePixmap(pix); ++ } ++ ++ // Handle drop shadow ++ if (dropShadow && p->width() > 16 && p->height() > 16) ++ createShadowWindows(p); ++ } + else if (et == QEvent::Hide) +- p->setErasePixmap(QPixmap()); ++ { ++ // Handle drop shadow ++ if (dropShadow && p->width() > 16 && p->height() > 16) ++ removeShadowWindows(p); ++ ++ // Handle translucency ++ if (te != Disabled) ++ p->setErasePixmap(QPixmap()); ++ } + + return false; + } diff --git a/kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild b/kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild index 69d6acb0ef8e..5c91abec9f01 100644 --- a/kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild +++ b/kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2001 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild,v 1.3 2002/07/13 21:03:28 danarmak Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-3.1_alpha1.ebuild,v 1.4 2002/07/16 20:37:01 danarmak Exp $ inherit kde kde.org #don't inherit kde-base or kde-dist! it calls need-kde which adds kdelibs to depend! @@ -12,6 +12,8 @@ S=${WORKDIR}/kdelibs-3.0.6 SLOT="3" LICENSE="GPL-2 LGPL-2" +PATCHES="${FILESDIR}/${P}-menushadows.diff" + # kde.eclass has kdelibs in DEPEND, and we can't have that in here. so we recreate the entire # DEPEND from scratch. DEPEND="" |