mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-20 01:40:14 -05:00
Add -W,--window-size-chars, and foot.ini:initial-window-size-chars
* Add -W,--window-size-chars command line option * Add initial-window-size-chars foot.ini option * Add -w,--window-size-pixels command line option * Add initial-window-size-pixels foot.ini option * Deprecate -g,--geometry command line option in favor of -w,--window-size-pixels * Deprecate geometry option in foot.ini in favor of initial-window-size-pixels
This commit is contained in:
parent
fa6ad0f030
commit
eb6737ca25
10 changed files with 199 additions and 57 deletions
23
render.c
23
render.c
|
|
@ -2032,13 +2032,24 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
|
|||
width = term->unmaximized_width;
|
||||
height = term->unmaximized_height;
|
||||
} else {
|
||||
width = term->conf->width;
|
||||
height = term->conf->height;
|
||||
switch (term->conf->size.type) {
|
||||
case CONF_SIZE_PX:
|
||||
width = term->conf->size.px.width;
|
||||
height = term->conf->size.px.height;
|
||||
|
||||
if (term->window->use_csd == CSD_YES) {
|
||||
/* Take CSD title bar into account */
|
||||
assert(!term->window->is_fullscreen);
|
||||
height -= term->conf->csd.title_height;
|
||||
if (term->window->use_csd == CSD_YES) {
|
||||
/* Take CSD title bar into account */
|
||||
assert(!term->window->is_fullscreen);
|
||||
height -= term->conf->csd.title_height;
|
||||
}
|
||||
break;
|
||||
|
||||
case CONF_SIZE_CELLS:
|
||||
width = 2 * term->conf->pad_x;
|
||||
height = 2 * term->conf->pad_y;
|
||||
width += term->conf->size.cells.width * term->cell_width;
|
||||
height += term->conf->size.cells.height * term->cell_height;
|
||||
break;
|
||||
}
|
||||
|
||||
width *= scale;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue