- Apr 28, 2020
- 1,565
- 9,079
I have a screen that looks somewhat like this
Without xfill, vpgrid's content takes about 2/3 of the screen width. so I can still roll back and roll forward if I put my mouse outside of the vpgrid borders. This is understandable.
If I use xfill on the frame like this
the frame background now fills the entire screen, but vpgrid still takes 2/3 of the frame width (since it's aligned to the center you can see the frame background to the right of the scrollbar) and scrolling works the same way. That's also understandable because vpgrid size didn't change and default keymap still works if you add
If I add xfill to vpgrid
the vpgrid's scrollbar, as expected, gets to the right edge of the screen. The content for some reason gets shifted to the left, instead of staying in the middle, but fine, I'll try to figure it out later. It looks like the vpgrid takes all space on the screen, which is what I want. But when I try to scroll somewhere outside of the actual content, which still takes 2/3 of the width, I trigger rollbacks and rollforwards instead of scrolling the vpgrid.
What do I need to do to make a vpgrid take the entire screen space without changing the size of the grid cells? Is it even possible?
Python:
screen my_screen():
predict False
modal True
frame:
xalign 0.5
background "#aaaa"
vpgrid cols cols_number:
xalign 0.5
for i in range(0, number_of_cells):
button:
xsize x_size
ysize y_size
add "icon [i]"
action NullAction()
If I use xfill on the frame like this
Python:
screen my_screen():
predict False
modal True
frame:
xfill True
xalign 0.5
background "#aaaa"
vpgrid cols cols_number:
xalign 0.5
for i in range(0, number_of_cells):
button:
xsize x_size
ysize y_size
add "icon [i]"
action NullAction()
modal True
If I add xfill to vpgrid
Python:
screen my_screen():
predict False
modal True
frame:
xfill True #doesn't seem necessary anymore because the screen looks the same without it
xalign 0.5
background "#aaaa"
vpgrid cols cols_number:
xfill True
xalign 0.5
for i in range(0, number_of_cells):
button:
xsize x_size
ysize y_size
add "icon [i]"
action NullAction()
What do I need to do to make a vpgrid take the entire screen space without changing the size of the grid cells? Is it even possible?