diff options
| author | Loïc Guégan <loic.guegan@mailbox.org> | 2024-09-17 14:35:38 +0200 |
|---|---|---|
| committer | Loïc Guégan <loic.guegan@mailbox.org> | 2024-09-17 14:35:38 +0200 |
| commit | 08c3a724eed0b0a2b20de5a72e772ebccf747abc (patch) | |
| tree | 82897d38d44f72b7d7cf849581fb5ed4eca227d6 /tropical/qt/eventdrawer.py | |
| parent | 1b97acaa87a8e8740381573bd3d994344b008043 (diff) | |
Minor changes
Diffstat (limited to 'tropical/qt/eventdrawer.py')
| -rw-r--r-- | tropical/qt/eventdrawer.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tropical/qt/eventdrawer.py b/tropical/qt/eventdrawer.py index 4afcf55..07ba449 100644 --- a/tropical/qt/eventdrawer.py +++ b/tropical/qt/eventdrawer.py @@ -18,10 +18,11 @@ class EvtQGraphicsView(QGraphicsView): class EvtDrawerScene(QGraphicsScene): - def __init__(self, calState): + def __init__(self, calState, env): self.gridWidth=2 super().__init__(None) self.calState=calState + self.env=env def drawForeground(self, painter, rect): origXF, origYF, widthF, heightF = rect.getRect() @@ -36,13 +37,21 @@ class EvtDrawerScene(QGraphicsScene): pen.setJoinStyle(Qt.PenJoinStyle.MiterJoin) po=int(self.gridWidth/2) # Pen offset painter.setPen(pen) + # Init Brush + brush=QtGui.QBrush() + brush.setColor(QtGui.QColor("#e5e5e5")) + brush.setStyle(Qt.BrushStyle.SolidPattern) + painter.setBrush(brush) - painter.drawRect(x+po,y+po,width-po*2,height-po*2) + eventHeight=80 + colorWidth=20 + for e in self.env.listEventsOn(2024,10,1): + painter.drawRect(x+po,y+po,width-po*2,eventHeight-po*2) class EvtDrawer(): - def __init__(self, layout, calState): - self.gs=EvtDrawerScene(calState) + def __init__(self, layout, calState, env): + self.gs=EvtDrawerScene(calState, env) self.gv=EvtQGraphicsView(self.gs) # Setup propertion spLeft=QSizePolicy(QSizePolicy.Policy.Preferred,QSizePolicy.Policy.Preferred); |
