~ubuntu-branches/debian/squeeze/kdelibs/squeeze

« back to all changes in this revision

Viewing changes to kdefx/kstyle.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Modestas Vainius
  • Date: 2010-08-07 23:20:21 UTC
  • Revision ID: james.westby@ubuntu.com-20100807232021-owvkgp5wpc076s33
Tags: 4:3.5.10.dfsg.1-5
* Change by email address to @debian.org.
* Drop common HTML docs from kdelibs-data package. Instead suggest
  kdelibs5-data which ships them (Closes: #591609). What's more, whoever
  wants to view docs, will have to install khelpcenter4 which pulls in
  kdelibs5-data anyway.
* Switch to dpkg-source format 3.0 (quilt):
  - drop simple-patchsys.mk from debian/rules;
  - add debian/patches/series file.
* Fix corruption of zip files caused by wrong encoding of umlauts in kzip
  (patch 67_kio_zip_file_encoding.diff). (Closes: #563942) Thanks to Bjoern
  Ricks for the patch.
* Support opening of KDE 4 khelpcenter in Help -> Handbook. (Closes: #525621)
  Thanks to Ben Burton for the patch.
* Do not recurse into .pc subdirectory with doxygen 
  (patch debian/patches/02_exclude_pc_from_dox.diff).
* Urgency=medium due to multiple RC bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
        bool  menuAltKeyNavigation     : 1;
155
155
        bool  menuDropShadow           : 1;
156
156
        bool  sloppySubMenus           : 1;
 
157
        bool  semiTransparentRubberband : 1;
157
158
        int   popupMenuDelay;
158
159
        float menuOpacity;
159
160
 
187
188
        d->menuAltKeyNavigation = settings.readBoolEntry("/KStyle/Settings/MenuAltKeyNavigation", true);
188
189
        d->scrollablePopupmenus = settings.readBoolEntry("/KStyle/Settings/ScrollablePopupMenus", false);
189
190
        d->menuDropShadow       = settings.readBoolEntry("/KStyle/Settings/MenuDropShadow", false);
 
191
        d->semiTransparentRubberband = settings.readBoolEntry("/KStyle/Settings/SemiTransparentRubberband", false);
190
192
        d->menuHandler = NULL;
191
193
 
192
194
        if (useMenuTransparency) {
553
555
                else
554
556
                        // General handle, probably a kicker applet handle.
555
557
                        drawKStylePrimitive( KPE_GeneralHandle, p, widget, r, cg, flags, opt );
556
 
 
 
558
#if QT_VERSION >= 0x030300
 
559
#ifdef HAVE_XRENDER
 
560
        } else if ( d->semiTransparentRubberband && pe == QStyle::PE_RubberBand ) {
 
561
                        QRect rect = r.normalize();
 
562
                        QPoint point;
 
563
                        point = p->xForm( point );
 
564
        
 
565
                        static XRenderColor clr = { 0, 0, 0, 0 };
 
566
                        static unsigned long fillColor = 0;
 
567
                        if ( fillColor != cg.highlight().rgb() ) {
 
568
                                fillColor = cg.highlight().rgb();
 
569
                                
 
570
                                unsigned long color = fillColor << 8 | 0x40;
 
571
 
 
572
                                int red = (color >> 24) & 0xff;
 
573
                                int green = (color >> 16) & 0xff;
 
574
                                int blue = (color >> 8) & 0xff;
 
575
                                int alpha = (color >> 0) & 0xff;
 
576
 
 
577
                                red = red * alpha / 255;
 
578
                                green = green * alpha / 255;
 
579
                                blue = blue * alpha / 255;
 
580
 
 
581
                                clr.red = (red << 8) + red;
 
582
                                clr.green = (green << 8) + green;
 
583
                                clr.blue = (blue << 8) + blue;
 
584
                                clr.alpha = (alpha << 8) + alpha;
 
585
                        }
 
586
                
 
587
                        XRenderFillRectangle(
 
588
                                        p->device()->x11Display(),
 
589
                                        PictOpOver,
 
590
                                        p->device()->x11RenderHandle(),
 
591
                                        &clr,
 
592
                                        rect.x() + point.x(),
 
593
                                        rect.y() + point.y(),
 
594
                                        rect.width(),
 
595
                                        rect.height() );
 
596
 
 
597
                        p->save();
 
598
                        p->setRasterOp( Qt::CopyROP );
 
599
                        p->setPen( QPen( cg.highlight().dark( 160 ), 1 ) );
 
600
                        p->setBrush( NoBrush );
 
601
                        p->drawRect(
 
602
                                        rect.x() + point.x(),
 
603
                                        rect.y() + point.y(),
 
604
                                        rect.width(),
 
605
                                        rect.height() );
 
606
                        p->restore();
 
607
#endif
 
608
#endif
557
609
        } else
558
610
                QCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt );
559
611
}