mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Starting window output in x position 1
This commit is contained in:
parent
4a2ff76059
commit
0e30c795a5
12
input_bar.c
12
input_bar.c
@ -29,6 +29,12 @@ void inp_bar_active(int win)
|
||||
wrefresh(inp_bar);
|
||||
}
|
||||
|
||||
void inp_bar_get_password(void)
|
||||
{
|
||||
mvwprintw(inp_bar, 0, 1, "Enter password:");
|
||||
wrefresh(inp_bar);
|
||||
}
|
||||
|
||||
void inp_bar_print_message(char *msg)
|
||||
{
|
||||
mvwprintw(inp_bar, 0, 9, msg);
|
||||
@ -46,3 +52,9 @@ void inp_bar_update_time(void)
|
||||
wrefresh(inp_bar);
|
||||
inp_put_back();
|
||||
}
|
||||
|
||||
void inp_bar_clear(void)
|
||||
{
|
||||
wclear(inp_bar);
|
||||
wrefresh(inp_bar);
|
||||
}
|
||||
|
@ -10,19 +10,20 @@ void create_input_window(void)
|
||||
|
||||
inp_win = newwin(1, cols, rows-1, 0);
|
||||
keypad(inp_win, TRUE);
|
||||
wmove(inp_win, 0, 1);
|
||||
wrefresh(inp_win);
|
||||
}
|
||||
|
||||
void inp_get_command_str(char *cmd)
|
||||
{
|
||||
wmove(inp_win, 0, 0);
|
||||
wmove(inp_win, 0, 1);
|
||||
wgetstr(inp_win, cmd);
|
||||
}
|
||||
|
||||
void inp_clear(void)
|
||||
{
|
||||
wclear(inp_win);
|
||||
wmove(inp_win, 0, 0);
|
||||
wmove(inp_win, 0, 1);
|
||||
wrefresh(inp_win);
|
||||
}
|
||||
|
||||
@ -78,8 +79,10 @@ void inp_get_password(char *passwd)
|
||||
{
|
||||
wclear(inp_win);
|
||||
noecho();
|
||||
mvwgetstr(inp_win, 0, 0, passwd);
|
||||
mvwgetstr(inp_win, 0, 1, passwd);
|
||||
wmove(inp_win, 0, 1);
|
||||
echo();
|
||||
inp_bar_clear();
|
||||
}
|
||||
|
||||
void inp_put_back(void)
|
||||
|
@ -103,7 +103,7 @@ static int handle_start_command(char *cmd)
|
||||
char *user;
|
||||
user = strndup(cmd+9, strlen(cmd)-9);
|
||||
|
||||
inp_bar_print_message("Enter password:");
|
||||
inp_bar_get_password();
|
||||
char passwd[20];
|
||||
inp_get_password(passwd);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user