mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-04 22:25:39 +00:00
Fixed bug. Scroll when is enough space for all items
This commit is contained in:
@@ -74,19 +74,20 @@ class ListView():
|
||||
self.move_to(1)
|
||||
|
||||
def move_to(self, direction):
|
||||
if direction == 1:
|
||||
self.current_item += self.max_rows
|
||||
if self.current_item + self.max_rows > self.list_size:
|
||||
self.current_item = self.list_size - self.max_rows
|
||||
self.load_new_item_position(self.current_item)
|
||||
self.screen_objects.get_touch_object("scrollbar").set_item(self.current_item)
|
||||
elif direction == -1:
|
||||
self.current_item -= self.max_rows
|
||||
if self.current_item < 0:
|
||||
self.current_item = 0
|
||||
self.load_new_item_position(self.current_item)
|
||||
self.screen_objects.get_touch_object("scrollbar").set_item(self.current_item)
|
||||
self.set_selected(self.selected)
|
||||
if self.scrollbar:
|
||||
if direction == 1:
|
||||
self.current_item += self.max_rows
|
||||
if self.current_item + self.max_rows > self.list_size:
|
||||
self.current_item = self.list_size - self.max_rows
|
||||
self.load_new_item_position(self.current_item)
|
||||
self.screen_objects.get_touch_object("scrollbar").set_item(self.current_item)
|
||||
elif direction == -1:
|
||||
self.current_item -= self.max_rows
|
||||
if self.current_item < 0:
|
||||
self.current_item = 0
|
||||
self.load_new_item_position(self.current_item)
|
||||
self.screen_objects.get_touch_object("scrollbar").set_item(self.current_item)
|
||||
self.set_selected(self.selected)
|
||||
|
||||
def set_selected(self, selected):
|
||||
for number in self.selected:
|
||||
|
||||
Reference in New Issue
Block a user