mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -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);
|
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)
|
void inp_bar_print_message(char *msg)
|
||||||
{
|
{
|
||||||
mvwprintw(inp_bar, 0, 9, msg);
|
mvwprintw(inp_bar, 0, 9, msg);
|
||||||
@ -46,3 +52,9 @@ void inp_bar_update_time(void)
|
|||||||
wrefresh(inp_bar);
|
wrefresh(inp_bar);
|
||||||
inp_put_back();
|
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);
|
inp_win = newwin(1, cols, rows-1, 0);
|
||||||
keypad(inp_win, TRUE);
|
keypad(inp_win, TRUE);
|
||||||
|
wmove(inp_win, 0, 1);
|
||||||
wrefresh(inp_win);
|
wrefresh(inp_win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void inp_get_command_str(char *cmd)
|
void inp_get_command_str(char *cmd)
|
||||||
{
|
{
|
||||||
wmove(inp_win, 0, 0);
|
wmove(inp_win, 0, 1);
|
||||||
wgetstr(inp_win, cmd);
|
wgetstr(inp_win, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void inp_clear(void)
|
void inp_clear(void)
|
||||||
{
|
{
|
||||||
wclear(inp_win);
|
wclear(inp_win);
|
||||||
wmove(inp_win, 0, 0);
|
wmove(inp_win, 0, 1);
|
||||||
wrefresh(inp_win);
|
wrefresh(inp_win);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +79,10 @@ void inp_get_password(char *passwd)
|
|||||||
{
|
{
|
||||||
wclear(inp_win);
|
wclear(inp_win);
|
||||||
noecho();
|
noecho();
|
||||||
mvwgetstr(inp_win, 0, 0, passwd);
|
mvwgetstr(inp_win, 0, 1, passwd);
|
||||||
|
wmove(inp_win, 0, 1);
|
||||||
echo();
|
echo();
|
||||||
|
inp_bar_clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void inp_put_back(void)
|
void inp_put_back(void)
|
||||||
|
@ -103,7 +103,7 @@ static int handle_start_command(char *cmd)
|
|||||||
char *user;
|
char *user;
|
||||||
user = strndup(cmd+9, strlen(cmd)-9);
|
user = strndup(cmd+9, strlen(cmd)-9);
|
||||||
|
|
||||||
inp_bar_print_message("Enter password:");
|
inp_bar_get_password();
|
||||||
char passwd[20];
|
char passwd[20];
|
||||||
inp_get_password(passwd);
|
inp_get_password(passwd);
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ void create_input_bar(void);
|
|||||||
void create_input_window(void);
|
void create_input_window(void);
|
||||||
|
|
||||||
// input bar actions
|
// input bar actions
|
||||||
|
void inp_bar_clear(void);
|
||||||
|
void inp_bar_get_password(void);
|
||||||
void inp_bar_print_message(char *msg);
|
void inp_bar_print_message(char *msg);
|
||||||
void inp_bar_inactive(int win);
|
void inp_bar_inactive(int win);
|
||||||
void inp_bar_active(int win);
|
void inp_bar_active(int win);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user