Browse Source

tui.c - rename cont_window to win

master
heck 2 years ago
parent
commit
e6ce48123f
  1. 14
      src/tui.c
  2. 2
      src/tui.h

14
src/tui.c

@ -838,7 +838,7 @@ void tui_restart_osc_udp_if_enabled(Tui *tui)
if (did_error)
tui_restart_osc_udp_showerror();
}
void tui_adjust_term_size(Tui *tui, WINDOW **cont_window)
void tui_adjust_term_size(Tui *tui, WINDOW **win)
{
int term_h, term_w;
getmaxyx(stdscr, term_h, term_w);
@ -854,18 +854,18 @@ void tui_adjust_term_size(Tui *tui, WINDOW **cont_window)
content_w -= tui->hardmargin_x * 2;
}
bool remake_window = true;
if (*cont_window) {
if (*win) {
int cwin_y, cwin_x, cwin_h, cwin_w;
getbegyx(*cont_window, cwin_y, cwin_x);
getmaxyx(*cont_window, cwin_h, cwin_w);
getbegyx(*win, cwin_y, cwin_x);
getmaxyx(*win, cwin_h, cwin_w);
remake_window = cwin_y != content_y || cwin_x != content_x || cwin_h != content_h ||
cwin_w != content_w;
}
if (remake_window) {
if (*cont_window)
delwin(*cont_window);
if (*win)
delwin(*win);
wclear(stdscr);
*cont_window = derwin(stdscr, content_h, content_w, content_y, content_x);
*win = derwin(stdscr, content_h, content_w, content_y, content_x);
tui->ged->is_draw_dirty = true;
}
// OK to call this unconditionally -- deriving the sub-window areas is

2
src/tui.h

@ -39,7 +39,7 @@ bool tui_suggest_nice_grid_size(Tui *tui, int win_h, int win_w, Usz *out_grid_h,
void tui_restart_osc_udp_if_enabled(Tui *tui);
void tui_adjust_term_size(Tui *tui, WINDOW **cont_window);
void tui_adjust_term_size(Tui *tui, WINDOW **win);
void tui_try_save(Tui *tui);

Loading…
Cancel
Save