This commit is contained in:
2025-06-07 21:09:59 +03:00
parent fa3a11ee4b
commit 6cac2381cd
3 changed files with 29 additions and 26 deletions

View File

@@ -1 +1 @@
gAAAAABoRH_Q_Meahpxk7Lunh7m8alx_y11I13YKM8SbTOBFqZrqoZ6pCxNK_RMBDRXwoeJhhDCVppaX-WPMGHljzBrsTQ9mUa9yDS6Sp8t-fvZnYEcKlIoRwdqRd3b1HdyJgBxH_AjD
gAAAAABoRIBdnJ4AJNsIIQDrg28lJYh3WTX0jucvpvIuryz4n8sdPxEkR41zu8vmDBs-R6CRWBXnN6JZk4_-E71UVMRmYNlc3mELmowS8BupUW59BuruBiJgV4iepoWnpyj4NuiBnJjG

View File

@@ -203,37 +203,40 @@ def open_pauses_popup(screen_instance, project_name, RESOURCES_FOLDER, on_save_c
file_widgets = []
for fname in files:
row = BoxLayout(orientation='horizontal', size_hint_y=None, height=60, padding=4, spacing=8)
thumb_path = os.path.join(pause_img_folder, fname)
# Create a Button for the row
btn = Button(
size_hint_y=None,
height=60,
background_normal='',
background_color=(0.18, 0.18, 0.22, 1),
color=(1,1,1,1)
)
# Layout for image and label inside the button
box = BoxLayout(orientation='horizontal', spacing=8, padding=4)
img_widget = KivyImage(source=thumb_path, size_hint_x=None, width=60, allow_stretch=True, keep_ratio=True)
label = Label(text=fname, color=(1,1,1,1), size_hint_x=1, halign="left", valign="middle")
label.bind(size=lambda inst, val: setattr(inst, 'text_size', (inst.width, None)))
box.add_widget(img_widget)
box.add_widget(label)
btn.add_widget(box)
row.add_widget(img_widget)
row.add_widget(label)
def make_on_release(btn, fname):
def on_release(instance):
if fname in selected_files:
selected_files.remove(fname)
btn.background_color = (0.18, 0.18, 0.22, 1)
else:
selected_files.add(fname)
btn.background_color = (0.8, 0.1, 0.1, 1)
return on_release
btn.bind(on_release=make_on_release(btn, fname))
# Background color for selection
with row.canvas.before:
from kivy.graphics import Color, Rectangle
row.bg_color = Color(0.18, 0.18, 0.22, 1)
row.bg_rect = Rectangle(pos=row.pos, size=row.size)
def update_bg(instance, value):
row.bg_rect.pos = row.pos
row.bg_rect.size = row.size
row.bind(pos=update_bg, size=update_bg)
file_widgets.append(btn)
file_list_box.add_widget(btn)
# Selection logic
def make_on_touch_down(row, fname):
def on_touch_down(instance, touch):
if row.collide_point(*touch.pos):
if fname in selected_files:
selected_files.remove(fname)
row.bg_color.rgba = (0.18, 0.18, 0.22, 1)
else:
selected_files.add(fname)
row.bg_color.rgba = (0.8, 0.1, 0.1, 1)
return False
return on_touch_down
row.bind(on_touch_down=make_on_touch_down(row, fname))
file_widgets.append(row)
file_list_box.add_widget(row)
scroll = ScrollView(size_hint=(1, 0.7))
scroll.add_widget(file_list_box)