--- a/eric6/Graphics/PackageItem.py Sun Apr 12 15:03:27 2020 +0200 +++ b/eric6/Graphics/PackageItem.py Sun Apr 12 18:40:37 2020 +0200 @@ -55,20 +55,29 @@ ItemType = "package" def __init__(self, model=None, x=0, y=0, rounded=False, - noModules=False, parent=None, scene=None): + noModules=False, colors=None, parent=None, scene=None): """ Constructor - @param model package model containing the package data (PackageModel) - @param x x-coordinate (integer) - @param y y-coordinate (integer) - @param rounded flag indicating a rounded corner (boolean) - @keyparam noModules flag indicating, that no module names should be - shown (boolean) - @keyparam parent reference to the parent object (QGraphicsItem) - @keyparam scene reference to the scene object (QGraphicsScene) + @param model package model containing the package data + @type PackageModel + @param x x-coordinate + @type int + @param y y-coordinate + @type int + @param rounded flag indicating a rounded corner + @type bool + @param noModules flag indicating, that no module names should be + shown + @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) self.noModules = noModules scene.addItem(self) @@ -92,6 +101,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) @@ -103,6 +113,7 @@ else: txt = " " self.modules = QGraphicsSimpleTextItem(self) + self.modules.setBrush(self._colors[0]) self.modules.setFont(self.font) self.modules.setText(txt) self.modules.setPos(x, y)