main
parent
f2669c59b1
commit
e77dd66b2f
10
main.py
10
main.py
|
@ -434,7 +434,7 @@ def render_albums():
|
||||||
return album
|
return album
|
||||||
|
|
||||||
if delete_mode:
|
if delete_mode:
|
||||||
albums_to_delete = delete_albums_mode(album, y, album_rect, current_hovered_index, hover_index)
|
albums_to_delete = delete_albums_mode(y, album_rect, current_hovered_index, hover_index)
|
||||||
|
|
||||||
y += cons[0]
|
y += cons[0]
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ def handle_album_interaction(album_hover, album):
|
||||||
|
|
||||||
albums_to_delete = []
|
albums_to_delete = []
|
||||||
|
|
||||||
def delete_albums_mode(album, y, album_rect, current_hovered_index, hover_index):
|
def delete_albums_mode(y, album_rect, current_hovered_index, hover_index):
|
||||||
global albums_to_delete
|
global albums_to_delete
|
||||||
checkbox_rect = pygame.Rect(cons[2], y + cons[3], checkbox[1], checkbox[1])
|
checkbox_rect = pygame.Rect(cons[2], y + cons[3], checkbox[1], checkbox[1])
|
||||||
checkbox_hover = checkbox_rect.collidepoint(pygame.mouse.get_pos())
|
checkbox_hover = checkbox_rect.collidepoint(pygame.mouse.get_pos())
|
||||||
|
@ -488,16 +488,16 @@ def delete_albums_mode(album, y, album_rect, current_hovered_index, hover_index)
|
||||||
|
|
||||||
if album not in albums_to_delete:
|
if album not in albums_to_delete:
|
||||||
albums_to_delete.append(album)
|
albums_to_delete.append(album)
|
||||||
print(albums_to_delete)
|
|
||||||
|
|
||||||
elif album in albums_to_delete:
|
elif album in albums_to_delete:
|
||||||
albums_to_delete.remove(album)
|
albums_to_delete.remove(album)
|
||||||
print(albums_to_delete)
|
|
||||||
|
|
||||||
return albums_to_delete
|
return albums_to_delete
|
||||||
|
|
||||||
checkbox_image = Image((checkbox[0], 0), (cons[2], y + cons[3]), (checkbox[1], checkbox[1]))
|
checkbox_image = Image((checkbox[0], 0), (cons[2], y + cons[3]), (checkbox[1], checkbox[1]))
|
||||||
if album in albums_to_delete:
|
if list(storage["albums"].keys())[hover_index] in albums_to_delete:
|
||||||
checkbox_image = Image((checkbox[0] + checkbox[1] + 3, 0), (cons[2], y + cons[3]), (checkbox[1], checkbox[1]))
|
checkbox_image = Image((checkbox[0] + checkbox[1] + 3, 0), (cons[2], y + cons[3]), (checkbox[1], checkbox[1]))
|
||||||
checkbox_image.draw(screen)
|
checkbox_image.draw(screen)
|
||||||
return albums_to_delete
|
return albums_to_delete
|
||||||
|
|
|
@ -120,10 +120,6 @@
|
||||||
"00:00:00",
|
"00:00:00",
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"2": {},
|
|
||||||
"3": {},
|
|
||||||
"4": {},
|
|
||||||
"5": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue