Stopped listing pane from scrolling indefinately down or to the right.
This commit is contained in:
parent
d488d2f952
commit
aea15f18ef
1 changed files with 10 additions and 1 deletions
11
vigil
11
vigil
|
|
@ -689,7 +689,16 @@ class Screen:
|
|||
dx, dy = vector
|
||||
selected_widget = self._summary.get_selection()
|
||||
x, y = selected_widget.scroll_position
|
||||
selected_widget.scroll_position = max(x + dx, 0), max(y + dy, 0)
|
||||
if dy < 0 or dx < 0: # up or left
|
||||
x, y = max(x + dx, 0), max(y + dy, 0)
|
||||
else: # down or right
|
||||
widget_width, widget_height = fill3.appearance_dimensions(
|
||||
selected_widget.result.appearance_min())
|
||||
listing_width, listing_height = (self._listing.widget.
|
||||
last_dimensions)
|
||||
x = min(x + dx, max(widget_width - listing_width, 0))
|
||||
y = min(y + dy, max(widget_height - listing_height, 0))
|
||||
selected_widget.scroll_position = x, y
|
||||
|
||||
def _page_listing(self, vector):
|
||||
dx, dy = vector
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue