Skip to content

Commit 8e179b1

Browse files
committed
[UI] Now ImagePack viewer properly set default colors for masks
1 parent 1475690 commit 8e179b1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/preppipe_gui_pyside6/componentwidgets/maskinputwidget.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ def setIsColorOnly(self, is_color_only: bool):
178178
def getIsColorOnly(self) -> bool:
179179
return self.is_color_only
180180

181+
def setDefaultColor(self, color : Color):
182+
self.last_color = QColor(color.r, color.g, color.b)
183+
181184
def showMenu(self):
182185
menu = QMenu(self)
183186
action_color = menu.addAction(self._tr_set_color_fill.get())

src/preppipe_gui_pyside6/toolwidgets/imagepack.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def setData(self, packid : str | None = None, category_kind : ImagePackDescripto
181181
nameLabel = QLabel(trname.get())
182182
self.bind_text(nameLabel.setText, trname)
183183
inputWidget = MaskInputWidget()
184+
inputWidget.setDefaultColor(self.pack.masks[index].mask_color)
184185
match mask.get_param_type():
185186
case ImagePackDescriptor.MaskParamType.IMAGE:
186187
inputWidget.setIsColorOnly(False)

0 commit comments

Comments
 (0)