mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 04:56:21 +00:00
@@ -1534,6 +1534,7 @@ cons_show_ui_prefs(void)
|
||||
cons_beep_setting();
|
||||
cons_flash_setting();
|
||||
cons_splash_setting();
|
||||
cons_inputwin_setting();
|
||||
cons_wrap_setting();
|
||||
cons_winstidy_setting();
|
||||
cons_time_setting();
|
||||
@@ -1751,6 +1752,14 @@ cons_inpblock_setting(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cons_inputwin_setting(void)
|
||||
{
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
cons_show("Input window postion (/inputwin) : %s", pos);
|
||||
prefs_free_string(pos);
|
||||
}
|
||||
|
||||
void
|
||||
cons_log_setting(void)
|
||||
{
|
||||
|
||||
@@ -282,7 +282,14 @@ _inp_win_update_virtual(void)
|
||||
{
|
||||
int wrows, wcols;
|
||||
getmaxyx(stdscr, wrows, wcols);
|
||||
pnoutrefresh(inp_win, 0, pad_start, wrows-1, 0, wrows-1, wcols-2);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(inp_win, 0, pad_start, 0, 0, 0, wcols-2);
|
||||
} else {
|
||||
pnoutrefresh(inp_win, 0, pad_start, wrows-1, 0, wrows-1, wcols-2);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -89,7 +89,13 @@ create_status_bar(void)
|
||||
|
||||
int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);
|
||||
|
||||
status_bar = newwin(1, cols, rows-2, 0);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
status_bar = newwin(1, cols, rows-1, 0);
|
||||
} else {
|
||||
status_bar = newwin(1, cols, rows-2, 0);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
wbkgd(status_bar, theme_attrs(THEME_STATUS_TEXT));
|
||||
wattron(status_bar, bracket_attrs);
|
||||
mvwprintw(status_bar, 0, cols - 34, _active);
|
||||
@@ -122,7 +128,13 @@ status_bar_resize(void)
|
||||
|
||||
int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);
|
||||
|
||||
mvwin(status_bar, rows-2, 0);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
mvwin(status_bar, rows-1, 0);
|
||||
} else {
|
||||
mvwin(status_bar, rows-2, 0);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
wresize(status_bar, 1, cols);
|
||||
wbkgd(status_bar, theme_attrs(THEME_STATUS_TEXT));
|
||||
wattron(status_bar, bracket_attrs);
|
||||
|
||||
@@ -67,7 +67,13 @@ create_title_bar(void)
|
||||
{
|
||||
int cols = getmaxx(stdscr);
|
||||
|
||||
win = newwin(1, cols, 0, 0);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
win = newwin(1, cols, 1, 0);
|
||||
} else {
|
||||
win = newwin(1, cols, 0, 0);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
wbkgd(win, theme_attrs(THEME_TITLE_TEXT));
|
||||
title_bar_console();
|
||||
title_bar_set_presence(CONTACT_OFFLINE);
|
||||
@@ -101,6 +107,16 @@ title_bar_resize(void)
|
||||
{
|
||||
int cols = getmaxx(stdscr);
|
||||
|
||||
werase(win);
|
||||
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
mvwin(win, 1, 0);
|
||||
} else {
|
||||
mvwin(win, 0, 0);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
|
||||
wresize(win, 1, cols);
|
||||
wbkgd(win, theme_attrs(THEME_TITLE_TEXT));
|
||||
|
||||
|
||||
@@ -317,6 +317,7 @@ void cons_reconnect_setting(void);
|
||||
void cons_autoping_setting(void);
|
||||
void cons_autoconnect_setting(void);
|
||||
void cons_inpblock_setting(void);
|
||||
void cons_inputwin_setting(void);
|
||||
void cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity);
|
||||
void cons_show_contact_offline(PContact contact, char *resource, char *status);
|
||||
void cons_theme_properties(void);
|
||||
|
||||
@@ -616,13 +616,32 @@ win_update_virtual(ProfWin *window)
|
||||
} else {
|
||||
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);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 2, 0, rows-2, (cols-subwin_cols)-1);
|
||||
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 2, (cols-subwin_cols), rows-2, cols-1);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
} else {
|
||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 1, 0, rows-3, cols-1);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 2, 0, rows-2, cols-1);
|
||||
} else {
|
||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 1, 0, rows-3, cols-1);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
}
|
||||
} else {
|
||||
pnoutrefresh(window->layout->win, window->layout->y_pos, 0, 1, 0, rows-3, cols-1);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(window->layout->win, window->layout->y_pos, 0, 2, 0, rows-2, cols-1);
|
||||
} else {
|
||||
pnoutrefresh(window->layout->win, window->layout->y_pos, 0, 1, 0, rows-3, cols-1);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -633,7 +652,13 @@ win_refresh_without_subwin(ProfWin *window)
|
||||
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);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(window->layout->win, window->layout->y_pos, 0, 2, 0, rows-2, cols-1);
|
||||
} else {
|
||||
pnoutrefresh(window->layout->win, window->layout->y_pos, 0, 1, 0, rows-3, cols-1);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,13 +672,27 @@ win_refresh_with_subwin(ProfWin *window)
|
||||
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);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 2, 0, rows-2, (cols-subwin_cols)-1);
|
||||
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 2, (cols-subwin_cols), rows-2, cols-1);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
} 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);
|
||||
char *pos = prefs_get_string(PREF_INPUTWIN);
|
||||
if (g_strcmp0(pos, "top") == 0) {
|
||||
pnoutrefresh(layout->base.win, layout->base.y_pos, 0, 2, 0, rows-2, (cols-subwin_cols)-1);
|
||||
pnoutrefresh(layout->subwin, layout->sub_y_pos, 0, 2, (cols-subwin_cols), rows-2, cols-1);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
prefs_free_string(pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user