This commit is contained in:
2022-12-15 15:20:03 +01:00
parent 77d9ed2917
commit 28a7d5e741

19
mdi.py
View File

@ -2,6 +2,7 @@ from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMdiArea, QMdiSubWindow, QAction
from PyQt5.QtGui import QIcon, QPixmap, QPainter, QColor
from pyqtgraph import PlotWidget
from theme import MDI_BKG
class MDIArea(QMdiArea):
@ -31,17 +32,21 @@ class MDIArea(QMdiArea):
def paintEvent(self, event):
# draw the watermark in the MDI area
painter = QPainter()
painter.begin(self.viewport())
vport = self.viewport()
painter.begin(vport)
painter.fillRect(event.rect(), QColor(150, 150, 150))
rect = event.rect()
painter.fillRect(rect, MDI_BKG)
logo = self.logo
margin = 20
logo = self.logo
logo_width = logo.width()
logo_height = logo.height()
painter.drawPixmap(
self.width()-logo.width()-margin,
self.height()-logo.height()-margin,
logo.width(),
logo.height(),
self.width() - logo_width - margin,
self.height() - logo_height - margin,
logo_width,
logo_height,
logo
)