mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Moved refresh subwin logic to window.c
This commit is contained in:
parent
989dde77cd
commit
6b44b988f4
@ -570,6 +570,37 @@ win_update_virtual(ProfWin *window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
win_refresh_without_subwin(ProfWin *window)
|
||||||
|
{
|
||||||
|
int rows, cols;
|
||||||
|
getmaxyx(stdscr, rows, cols);
|
||||||
|
|
||||||
|
if ((window->type == WIN_MUC) || (window->type == WIN_CONSOLE)) {
|
||||||
|
pnoutrefresh(window->layout->win, window->layout->y_pos, 0, 1, 0, rows-3, cols-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
win_refresh_with_subwin(ProfWin *window)
|
||||||
|
{
|
||||||
|
int rows, cols;
|
||||||
|
getmaxyx(stdscr, rows, cols);
|
||||||
|
int subwin_cols = 0;
|
||||||
|
|
||||||
|
if (window->type == WIN_MUC) {
|
||||||
|
ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout;
|
||||||
|
subwin_cols = win_occpuants_cols();
|
||||||
|
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 1, 0, rows-3, (cols-subwin_cols)-1);
|
||||||
|
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 1, (cols-subwin_cols), rows-3, cols-1);
|
||||||
|
} else if (window->type == WIN_CONSOLE) {
|
||||||
|
ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout;
|
||||||
|
subwin_cols = win_roster_cols();
|
||||||
|
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 1, 0, rows-3, (cols-subwin_cols)-1);
|
||||||
|
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 1, (cols-subwin_cols), rows-3, cols-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
win_move_to_end(ProfWin *window)
|
win_move_to_end(ProfWin *window)
|
||||||
{
|
{
|
||||||
|
@ -195,6 +195,9 @@ gboolean win_has_active_subwin(ProfWin *window);
|
|||||||
void win_clear(ProfWin *window);
|
void win_clear(ProfWin *window);
|
||||||
void win_resize(ProfWin *window);
|
void win_resize(ProfWin *window);
|
||||||
|
|
||||||
|
void win_refresh_without_subwin(ProfWin *window);
|
||||||
|
void win_refresh_with_subwin(ProfWin *window);
|
||||||
|
|
||||||
void win_page_up(ProfWin *window);
|
void win_page_up(ProfWin *window);
|
||||||
void win_page_down(ProfWin *window);
|
void win_page_down(ProfWin *window);
|
||||||
void win_sub_page_down(ProfWin *window);
|
void win_sub_page_down(ProfWin *window);
|
||||||
|
@ -480,38 +480,19 @@ wins_resize_all(void)
|
|||||||
void
|
void
|
||||||
wins_hide_subwin(ProfWin *window)
|
wins_hide_subwin(ProfWin *window)
|
||||||
{
|
{
|
||||||
int rows, cols;
|
|
||||||
getmaxyx(stdscr, rows, cols);
|
|
||||||
|
|
||||||
win_hide_subwin(window);
|
win_hide_subwin(window);
|
||||||
|
|
||||||
ProfWin *current_win = wins_get_current();
|
ProfWin *current_win = wins_get_current();
|
||||||
if ((current_win->type == WIN_MUC) || (current_win->type == WIN_CONSOLE)) {
|
win_refresh_without_subwin(current_win);
|
||||||
pnoutrefresh(current_win->layout->win, current_win->layout->y_pos, 0, 1, 0, rows-3, cols-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
wins_show_subwin(ProfWin *window)
|
wins_show_subwin(ProfWin *window)
|
||||||
{
|
{
|
||||||
int rows, cols;
|
|
||||||
getmaxyx(stdscr, rows, cols);
|
|
||||||
int subwin_cols = 0;
|
|
||||||
|
|
||||||
win_show_subwin(window);
|
win_show_subwin(window);
|
||||||
|
|
||||||
ProfWin *current_win = wins_get_current();
|
ProfWin *current_win = wins_get_current();
|
||||||
if (current_win->type == WIN_MUC) {
|
win_refresh_with_subwin(current_win);
|
||||||
ProfLayoutSplit *layout = (ProfLayoutSplit*)current_win->layout;
|
|
||||||
subwin_cols = win_occpuants_cols();
|
|
||||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 1, 0, rows-3, (cols-subwin_cols)-1);
|
|
||||||
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 1, (cols-subwin_cols), rows-3, cols-1);
|
|
||||||
} else if (current_win->type == WIN_CONSOLE) {
|
|
||||||
ProfLayoutSplit *layout = (ProfLayoutSplit*)current_win->layout;
|
|
||||||
subwin_cols = win_roster_cols();
|
|
||||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 1, 0, rows-3, (cols-subwin_cols)-1);
|
|
||||||
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 1, (cols-subwin_cols), rows-3, cols-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfXMLWin *
|
ProfXMLWin *
|
||||||
|
Loading…
Reference in New Issue
Block a user