Changeset 11130:8f0f1f0946e9 in orange


Ignore:
Timestamp:
10/16/12 14:18:31 (18 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Set the drop shadow frame mask to exclude the area over the 'widget'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/gui/dropshadow.py

    r11100 r11130  
    77    QWidget, QPainter, QPixmap, QGraphicsScene, QGraphicsRectItem, 
    88    QGraphicsDropShadowEffect, QColor, QPen, QPalette, QStyleOption, 
    9     QAbstractScrollArea, QToolBar 
     9    QAbstractScrollArea, QToolBar, QRegion 
    1010) 
    1111 
     
    157157        elif etype == QEvent.Hide: 
    158158            self.hide() 
    159         return False 
     159        return QWidget.eventFilter(self, obj, event) 
    160160 
    161161    def __updateGeometry(self): 
     
    174174        if geom != self.geometry(): 
    175175            self.setGeometry(geom) 
     176 
     177        # Set the widget mask (punch a hole through to the `widget` instance. 
     178        rect = self.rect() 
     179 
     180        mask = QRegion(rect) 
     181        transparent = QRegion(rect.adjusted(radius, radius, -radius, -radius)) 
     182 
     183        mask = mask.subtracted(transparent) 
     184        self.setMask(mask) 
    176185 
    177186    def __updatePixmap(self): 
Note: See TracChangeset for help on using the changeset viewer.