|
8 | 8 | QGraphicsView, QGraphicsScene, QGraphicsItem, QGraphicsSimpleTextItem, |
9 | 9 | QGraphicsTextItem, QGraphicsLineItem, QGraphicsWidget, QGraphicsRectItem, |
10 | 10 | QGraphicsEllipseItem, QGraphicsLinearLayout, QGridLayout, QLabel, QFrame, |
11 | | - QSizePolicy, QApplication, |
| 11 | + QSizePolicy, QApplication, QDesktopWidget, |
12 | 12 | ) |
13 | 13 | from AnyQt.QtGui import QColor, QPainter, QFont, QPen, QBrush |
14 | 14 | from AnyQt.QtCore import Qt, QRectF, QSize |
@@ -50,7 +50,7 @@ def show(self, pos, text, change_y=True): |
50 | 50 | self.adjustSize() |
51 | 51 |
|
52 | 52 | x, y = pos.x(), (pos.y() + 15 if change_y else self.y()) |
53 | | - avail = QApplication.focusWindow().screen().availableGeometry() |
| 53 | + avail = QDesktopWidget().availableGeometry(self) |
54 | 54 | if x + self.width() > avail.right(): |
55 | 55 | x -= self.width() |
56 | 56 | if y + self.height() > avail.bottom(): |
@@ -113,7 +113,7 @@ def __init__(self, radius, scale, offset, min_x, max_x, title, |
113 | 113 | self.setBrush(QColor(150, 150, 150, 255)) |
114 | 114 | self.setPen(QPen(QBrush(QColor(75, 75, 75, 255)), 2)) |
115 | 115 |
|
116 | | - def move_to_sum(self, invisible_sum: float=None): |
| 116 | + def move_to_sum(self, invisible_sum: float = None): |
117 | 117 | total = sum(item.value for item in self.movable_dot_items) |
118 | 118 |
|
119 | 119 | if invisible_sum is not None: |
|
0 commit comments