php-school / cli-menu

🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.
http://www.phpschool.io
MIT License
1.94k stars 106 forks source link

Add option to change the newlines before and after the menu is drawn #280

Open Zhigalin opened 10 months ago

Zhigalin commented 10 months ago

This feature is useful because it allows you to either reduce or set to zero the vertical margins in cases of a small terminal window (my case for which I made this feature) or a very large menu and you have to use every inch to fit it into the terminal, or you can increment it to move or center the menu vertically.

AydinHassan commented 10 months ago

What is the difference between this and the top/bottom padding?

Zhigalin commented 9 months ago

What is the difference between this and the top/bottom padding?

If you want to decrement the number of lines the difference is that these 4 lines are not part of the padding number and as such cannot be removed and the space occupied by these lines cannot be used even if we set the padding to 0.

If you want to increment it the difference is in the color. In the screenshot to the left we use the padding and to the right we use the new setting to align the menu vertically Screenshot_term

Zhigalin commented 4 months ago

@AydinHassan could you take another look at this PR? Thank you