Increasing project resolution - How to keep things organized?

I was running a 480x270 display. We are now increasing to 480x320

So i managed to increase my current project’s resolution, but there is a 25 pixel white bar above and below the project. This is a bit annoying as i could make use of a whole 50 pixel extra space but don’t want to shift all existing objects 25 pixels up.

Long story short ; How do i keep it all snapped to the top instead of being in the middle of the new , larger frame?

Purely theoretically, on the spur of the moment.
First, you need to replace the dimensions when creating the display.

lv_display_create(WIDTH, HEIGHT);

Or in the project properties: File->Project Settings
Then change the alignment in source code (or in Inspect SquareLine editor)

lv_obj_set_align(obj, LV_ALIGN_CENTER);

onto

lv_obj_set_align(obj, LV_ALIGN_TOP_MID);

where necessary.

1 Like

What do you mean Inspect Squareline editor?

Seems this would work, just not quite sure how to do it.

Hello @Lyonaut,

If you wrap the current elements (widgets) in a container, you won’t have to realign them one by one. Look at this picture as a reference:

1 Like

Thanks. As it is, since i only gained 25 pixels above and below, i figured i’d just stretch my background and leave the empty space for cleanliness.

The container trick seems to be the way to go. I imagine the reason why it’s like this is because the studio uses the center of the screen as a start point rather than top left as Y0,X0

1 Like