diff -r 0345f54d3959 -r 2b8a0d8ba12a eric6/Graphics/ModuleItem.py --- a/eric6/Graphics/ModuleItem.py Sun Apr 12 15:03:27 2020 +0200 +++ b/eric6/Graphics/ModuleItem.py Sun Apr 12 18:40:37 2020 +0200 @@ -52,19 +52,27 @@ """ ItemType = "module" - def __init__(self, model=None, x=0, y=0, rounded=False, + def __init__(self, model=None, x=0, y=0, rounded=False, colors=None, parent=None, scene=None): """ Constructor - @param model module model containing the module data (ModuleModel) - @param x x-coordinate (integer) - @param y y-coordinate (integer) - @keyparam rounded flag indicating a rounded corner (boolean) - @keyparam parent reference to the parent object (QGraphicsItem) - @keyparam scene reference to the scene object (QGraphicsScene) + @param model module model containing the module data + @type ModuleModel + @param x x-coordinate + @type int + @param y y-coordinate + @type int + @param rounded flag indicating a rounded corner + @type bool + @param colors tuple containing the foreground and background colors + @type tuple of (QColor, QColor) + @param parent reference to the parent object + @type QGraphicsItem + @param scene reference to the scene object + @type QGraphicsScene """ - UMLItem.__init__(self, model, x, y, rounded, parent) + UMLItem.__init__(self, model, x, y, rounded, colors, parent) scene.addItem(self) @@ -87,6 +95,7 @@ x = self.margin + self.rect().x() y = self.margin + self.rect().y() self.header = QGraphicsSimpleTextItem(self) + self.header.setBrush(self._colors[0]) self.header.setFont(boldFont) self.header.setText(self.model.getName()) self.header.setPos(x, y) @@ -96,6 +105,7 @@ else: txt = " " self.classes = QGraphicsSimpleTextItem(self) + self.classes.setBrush(self._colors[0]) self.classes.setFont(self.font) self.classes.setText(txt) self.classes.setPos(x, y)