コード例 #1
0
void
ui_focus_win(ProfWin *window)
{
    assert(window != NULL);

    if (wins_is_current(window)) {
        return;
    }

    ProfWin *old_current = wins_get_current();
    if (old_current->type == WIN_MUC_CONFIG) {
        ProfMucConfWin *confwin = (ProfMucConfWin*)old_current;
        cmd_ac_remove_form_fields(confwin->form);
    }

    if (window->type == WIN_MUC_CONFIG) {
        ProfMucConfWin *confwin = (ProfMucConfWin*)window;
        cmd_ac_add_form_fields(confwin->form);
    }

    int i = wins_get_num(window);
    wins_set_current_by_num(i);

    if (i == 1) {
        title_bar_console();
        rosterwin_roster();
    } else {
        title_bar_switch();
    }
    status_bar_current(i);
    status_bar_active(i);
}
コード例 #2
0
ファイル: titlebar.c プロジェクト: mrshu/profanity
static void
_create_title_bar(void)
{
    int cols = getmaxx(stdscr);

    win = newwin(1, cols, 0, 0);
    wbkgd(win, COLOUR_TITLE_TEXT);
    title_bar_console();
    title_bar_set_presence(CONTACT_OFFLINE);
    wnoutrefresh(win);
    inp_put_back();
}
コード例 #3
0
ファイル: titlebar.c プロジェクト: pasis/profanity
void
create_title_bar(void)
{
    int cols = getmaxx(stdscr);

    int row = screen_titlebar_row();
    win = newwin(1, cols, row, 0);
    wbkgd(win, theme_attrs(THEME_TITLE_TEXT));
    title_bar_console();
    title_bar_set_presence(CONTACT_OFFLINE);
    title_bar_set_tls(FALSE);
    title_bar_set_connected(FALSE);
    wnoutrefresh(win);
    inp_put_back();
}
コード例 #4
0
void
ui_close_win(int index)
{
    ProfWin *window = wins_get_by_num(index);
    if (window && window->type == WIN_MUC_CONFIG) {
        ProfMucConfWin *confwin = (ProfMucConfWin*)window;
        if (confwin->form) {
            cmd_ac_remove_form_fields(confwin->form);
        }
    }

    wins_close_by_num(index);
    title_bar_console();
    status_bar_current(1);
    status_bar_active(1);
}