1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 05:33:01 +01:00

various fixes

This commit is contained in:
Jfreegman 2014-06-20 14:27:33 -04:00
parent 034a8f5d8b
commit 3e797db16e
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
3 changed files with 13 additions and 11 deletions

View File

@ -521,14 +521,14 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
}
/* Scroll peerlist up and down one position if list overflows window */
else if (key == T_KEY_C_LB) {
else if (key == T_KEY_C_RB) {
int L = y2 - CHATBOX_HEIGHT - SDBAR_OFST;
if (groupchats[self->num].side_pos < groupchats[self->num].num_peers - L)
++groupchats[self->num].side_pos;
}
else if (key == T_KEY_C_RB) {
else if (key == T_KEY_C_LB) {
if (groupchats[self->num].side_pos > 0)
--groupchats[self->num].side_pos;
}

View File

@ -56,14 +56,15 @@ static void line_info_reset_start(ToxWindow *self, struct history *hst)
getmaxyx(self->window, y2, x2);
struct line_info *line = hst->line_end;
uint16_t lncnt = 0;
int side_offst = self->is_groupchat ? SIDEBAR_WIDTH : 0;
int top_offst = self->is_chat ? 3 : 0;
int top_offst = self->is_chat ? 2 : 0;
int max_y = (y2 - CHATBOX_HEIGHT - top_offst);
while (line->prev && lncnt < max_y) {
lncnt += (1 + line->newlines) +( line->len / (x2 - side_offst));
line = line->prev;
lncnt += (1 + line->len / (x2 - side_offst));
}
hst->line_start = line;
@ -441,11 +442,11 @@ bool line_info_onKey(ToxWindow *self, wint_t key)
switch (key) {
/* TODO: Find good key bindings for all this stuff */
case T_KEY_C_H:
case T_KEY_C_F:
line_info_page_up(self, hst);
break;
case T_KEY_C_B:
case T_KEY_C_V:
line_info_page_down(self, hst);
break;
@ -459,12 +460,12 @@ bool line_info_onKey(ToxWindow *self, wint_t key)
/* case ?:
line_info_goto_root(hst);
break;
case ?:
line_info_reset_start(self, hst);
break; */
case T_KEY_C_H:
line_info_reset_start(self, hst);
break;
default:
match = false;
break;

View File

@ -50,7 +50,8 @@
#define T_KEY_C_A 0x01 /* ctrl-a */
#define T_KEY_C_RB 0x1D /* ctrl-] */
#define T_KEY_C_LB 0x1B /* ctrl-[ */
#define T_KEY_C_B 0x02 /* ctrl-b */
#define T_KEY_C_V 0x16 /* ctrl-v */
#define T_KEY_C_F 0x06 /* ctrl-f */
#define T_KEY_C_H 0x08 /* ctrl-h */
enum {