@@ -83,7 +83,7 @@ def __init__(self, toolName, brushSize, color,
8383 brushSize {float} -- tools brushsize
8484 color {QColor} -- the Color to be used
8585 paintPattern {PaintPattern} -- the paint pattern that will be used
86- PaintBoard {PaintBoard} -- Its a paintboard?
86+ PaintBoard {PaintBoard} -- Parent class
8787 iconPath {str} -- the path to the icon. duh...
8888 shortcut {str} -- well. its a shortcut. nothing less, nothing more.
8989 statusTip {str} -- the status tip that will be displayed...
@@ -389,10 +389,9 @@ def colorBoxRun(self):
389389
390390 def mousePressEvent (self , event ):
391391 if event .button () == Qt .LeftButton and \
392- self .connectTool is not None :
392+ self .currentTool is not None :
393393 self .drawing = True
394- if self .currentTool is not None and \
395- self .currentTool .toolName == "A bucket filled" \
394+ if self .currentTool .toolName == "A bucket filled" \
396395 and self .currentTool .duration >= 0 :
397396 Pen = QPen (self .currentTool .color )
398397 Pen .setWidth (self .currentTool .brushSize )
@@ -402,6 +401,14 @@ def mousePressEvent(self, event):
402401 self .currentTool .toolName = "A bucket"
403402 self .currentTool .color = QColor (0 ,0 ,0 ,0 )
404403 self .connectTool (self .currentTool )
404+ elif self .currentTool .toolName == "Solid Brush" \
405+ and self .currentTool .duration >= 0 :
406+ Pen = QPen (self .currentTool .color )
407+ Pen .setWidth (self .currentTool .brushSize )
408+ self .painter .setPen (Pen ) #TODO: doesn't work properly
409+ self .painter .drawRect (event .pos (), 25 , 10 )
410+ self .currentTool .duration -= 1
411+
405412 self .lastPoint = event .pos ()
406413 self .update ()
407414 else :
0 commit comments