mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: always center grid when fullscreened or maximized
This commit is contained in:
parent
fa01bf2b75
commit
c114afadbd
2 changed files with 7 additions and 1 deletions
|
|
@ -83,6 +83,8 @@
|
|||
* `smm` now disables private mode 1036 (_"send ESC when Meta modifies
|
||||
a key"_), and enables private mode 1034 (_"8-bit Meta mode"_). `rmm`
|
||||
does the opposite ([#1584][1584]).
|
||||
* Grid is now always centered in the window, when either fullscreened
|
||||
or maximized.
|
||||
|
||||
[1526]: https://codeberg.org/dnkl/foot/issues/1526
|
||||
[1528]: https://codeberg.org/dnkl/foot/issues/1528
|
||||
|
|
|
|||
6
render.c
6
render.c
|
|
@ -4060,7 +4060,11 @@ render_resize(struct terminal *term, int width, int height, uint8_t opts)
|
|||
const int total_x_pad = term->width - grid_width;
|
||||
const int total_y_pad = term->height - grid_height;
|
||||
|
||||
if (term->conf->center && !term->window->is_resizing) {
|
||||
const bool centered_padding = term->conf->center
|
||||
|| term->window->is_fullscreen
|
||||
|| term->window->is_maximized;
|
||||
|
||||
if (centered_padding && !term->window->is_resizing) {
|
||||
term->margins.left = total_x_pad / 2;
|
||||
term->margins.top = total_y_pad / 2;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue