1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Added larger occupants pad size

This commit is contained in:
James Booth 2014-10-08 00:34:26 +01:00
parent d5b0a11444
commit ef62104d63
3 changed files with 9 additions and 8 deletions

View File

@ -52,7 +52,8 @@
#include "xmpp/xmpp.h"
#define INP_WIN_MAX 1000
#define OCCUPANT_WIN_SIZE 5
#define OCCUPANT_WIN_RATIO 5
#define OCCUPANT_WIN_WIDTH 100
void ui_init_module(void);
void console_init_module(void);

View File

@ -61,10 +61,10 @@ win_create(const char * const title, int cols, win_type_t type)
new_win->from = strdup(title);
if (type == WIN_MUC) {
new_win->win = newpad(PAD_SIZE, (cols/OCCUPANT_WIN_SIZE) * (OCCUPANT_WIN_SIZE-1));
new_win->win = newpad(PAD_SIZE, (cols/OCCUPANT_WIN_RATIO) * (OCCUPANT_WIN_RATIO-1));
wbkgd(new_win->win, COLOUR_TEXT);
new_win->subwin = newpad(PAD_SIZE, cols/OCCUPANT_WIN_SIZE);
new_win->subwin = newpad(PAD_SIZE, OCCUPANT_WIN_WIDTH);
wbkgd(new_win->subwin, COLOUR_TEXT);
} else {
new_win->win = newpad(PAD_SIZE, (cols));
@ -108,8 +108,8 @@ win_update_virtual(ProfWin *window)
getmaxyx(stdscr, rows, cols);
if (window->type == WIN_MUC) {
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, ((cols/OCCUPANT_WIN_SIZE) * (OCCUPANT_WIN_SIZE-1)) -1);
pnoutrefresh(window->subwin, window->sub_y_pos, 0, 1, (cols/OCCUPANT_WIN_SIZE) * (OCCUPANT_WIN_SIZE-1), rows-3, cols-1);
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, ((cols/OCCUPANT_WIN_RATIO) * (OCCUPANT_WIN_RATIO-1)) -1);
pnoutrefresh(window->subwin, window->sub_y_pos, 0, 1, (cols/OCCUPANT_WIN_RATIO) * (OCCUPANT_WIN_RATIO-1), rows-3, cols-1);
} else {
pnoutrefresh(window->win, window->y_pos, 0, 1, 0, rows-3, cols-1);
}

View File

@ -295,7 +295,7 @@ wins_resize_all(void)
while (curr != NULL) {
ProfWin *window = curr->data;
if (window->type == WIN_MUC) {
wresize(window->win, PAD_SIZE, (cols/OCCUPANT_WIN_SIZE) * (OCCUPANT_WIN_SIZE-1));
wresize(window->win, PAD_SIZE, (cols/OCCUPANT_WIN_RATIO) * (OCCUPANT_WIN_RATIO-1));
} else {
wresize(window->win, PAD_SIZE, cols);
}
@ -306,8 +306,8 @@ wins_resize_all(void)
ProfWin *current_win = wins_get_current();
if (current_win->type == WIN_MUC) {
pnoutrefresh(current_win->win, current_win->y_pos, 0, 1, 0, rows-3, ((cols/OCCUPANT_WIN_SIZE) * (OCCUPANT_WIN_SIZE-1)) -1);
pnoutrefresh(current_win->subwin, current_win->sub_y_pos, 0, 1, (cols/OCCUPANT_WIN_SIZE) * (OCCUPANT_WIN_SIZE-1), rows-3, cols-1);
pnoutrefresh(current_win->win, current_win->y_pos, 0, 1, 0, rows-3, ((cols/OCCUPANT_WIN_RATIO) * (OCCUPANT_WIN_RATIO-1)) -1);
pnoutrefresh(current_win->subwin, current_win->sub_y_pos, 0, 1, (cols/OCCUPANT_WIN_RATIO) * (OCCUPANT_WIN_RATIO-1), rows-3, cols-1);
} else {
pnoutrefresh(current_win->win, current_win->y_pos, 0, 1, 0, rows-3, cols-1);
}