connect color selection and editing signals to main controller; enhance thumbnail loading
This commit is contained in:
@@ -57,6 +57,8 @@ class EditButtonDelegate(QStyledItemDelegate):
|
||||
|
||||
class ColorListWidget(QWidget):
|
||||
editColor = Signal(str)
|
||||
colorSelected = Signal(str)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.colors = None
|
||||
@@ -120,7 +122,8 @@ class ColorListWidget(QWidget):
|
||||
item = self.model.itemFromIndex(source_index)
|
||||
if item:
|
||||
line = item.text()
|
||||
print(f"Kliknięto kolor: {line}")
|
||||
# print(f"Kliknięto kolor: {line}")
|
||||
self.colorSelected.emit(line)
|
||||
return line
|
||||
|
||||
def on_edit_clicked(self, index):
|
||||
@@ -129,5 +132,5 @@ class ColorListWidget(QWidget):
|
||||
item = self.model.itemFromIndex(source_index)
|
||||
if item:
|
||||
line = item.text()
|
||||
print(f"Edycja koloru: {line}")
|
||||
# print(f"Edycja koloru: {line}")
|
||||
self.editColor.emit(line)
|
||||
|
||||
@@ -73,6 +73,7 @@ class ThumbnailListWidget(QWidget):
|
||||
item = QListWidgetItem()
|
||||
item.setSizeHint(QSize(192, 192)) # rozmiar „wiersza”
|
||||
|
||||
print(f"Adding thumbnail: {image_path} with text: {text}")
|
||||
widget = ThumbnailItemWidget(image_path, text)
|
||||
self.list_widget.addItem(item)
|
||||
self.list_widget.setItemWidget(item, widget)
|
||||
|
||||
Reference in New Issue
Block a user