diff --git a/resources/credentials.enc b/resources/credentials.enc index f74caac..8524cdb 100644 --- a/resources/credentials.enc +++ b/resources/credentials.enc @@ -1 +1 @@ -gAAAAABoRH_Q_Meahpxk7Lunh7m8alx_y11I13YKM8SbTOBFqZrqoZ6pCxNK_RMBDRXwoeJhhDCVppaX-WPMGHljzBrsTQ9mUa9yDS6Sp8t-fvZnYEcKlIoRwdqRd3b1HdyJgBxH_AjD \ No newline at end of file +gAAAAABoRIBdnJ4AJNsIIQDrg28lJYh3WTX0jucvpvIuryz4n8sdPxEkR41zu8vmDBs-R6CRWBXnN6JZk4_-E71UVMRmYNlc3mELmowS8BupUW59BuruBiJgV4iepoWnpyj4NuiBnJjG \ No newline at end of file diff --git a/widgets/__pycache__/pause_edit_popup.cpython-311.pyc b/widgets/__pycache__/pause_edit_popup.cpython-311.pyc index 39a9576..eeae77e 100644 Binary files a/widgets/__pycache__/pause_edit_popup.cpython-311.pyc and b/widgets/__pycache__/pause_edit_popup.cpython-311.pyc differ diff --git a/widgets/pause_edit_popup.py b/widgets/pause_edit_popup.py index da6d9df..6c91b2a 100644 --- a/widgets/pause_edit_popup.py +++ b/widgets/pause_edit_popup.py @@ -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)