connect color selection and editing signals to main controller; enhance thumbnail loading

This commit is contained in:
2025-09-07 20:00:38 +02:00
parent cfea46c653
commit 2072cd8c93
3 changed files with 34 additions and 3 deletions

View File

@@ -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)

View File

@@ -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)