diff options
Diffstat (limited to 'src/ui_widgets.py')
-rw-r--r-- | src/ui_widgets.py | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/src/ui_widgets.py b/src/ui_widgets.py index 07b0369..291324f 100644 --- a/src/ui_widgets.py +++ b/src/ui_widgets.py @@ -227,41 +227,12 @@ class AngleSlider(QHBoxLayout): -class Widocques(QWidget): - image = None - - def __init__(self): +class PoincareWidget(QWidget): + def __init__(self,): QWidget.__init__(self) - self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) - self.intensity = 1 - - def minimumSizeHint(self): - return QSize(100, 100) + self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, \ + QSizePolicy.Expanding)) def paintEvent(self, event): - P = QPainter(self) - - w, h = self.frameSize().width(), self.frameSize().height() + pass - ar = Widocques.image.width() \ - / Widocques.image.height() - - if w / h > ar: - # pad left/right - w2 = h * ar - pad = (w - w2) / 2 - rect = QRect(pad, 0, w2, h) - else: - # pad top/bottom - h2 = w / ar - pad = (h - h2) / 2 - rect = QRect(0, pad, w, h2) - - w2 = rect.width() - h2 = rect.height() - rect2 = QRect(rect.left() + 0.1 * w2, rect.top() + 0.1 * h2, \ - w2 * 0.8, h2 * 0.8) - - P.fillRect(QRect(0, 0, w, h), Qt.black) - P.drawImage(rect2, Widocques.image) - P.fillRect(rect2, QColor(0, 0, 0, 255 * (1 - self.intensity))) |