Skip to content

Commit

Permalink
new message circles
Browse files Browse the repository at this point in the history
  • Loading branch information
notsecure committed Jul 1, 2014
1 parent d0070ce commit 1644201
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions friend.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ void friend_setname(FRIEND *f, char_t *name, uint16_t length)
void friend_addmessage(FRIEND *f, void *data)
{
message_add(&messages_friend, data, &f->msg);

if(sitem->data != f) {
f->notify = 1;
}
}

void friend_addid(uint8_t *id, char_t *msg, uint16_t msg_length)
Expand Down
2 changes: 1 addition & 1 deletion friend.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef struct {
} FILE_T;

struct friend {
_Bool online, typing;
_Bool online, typing, notify;
uint8_t calling, status;
int32_t callid;

Expand Down
5 changes: 5 additions & 0 deletions list.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ static void drawitem(ITEM *i, int x, int y)

uint8_t status = f->online ? f->status : 3;
drawalpha(BM_ONLINE + status, LIST_RIGHT - SCALE * 12, y + ITEM_HEIGHT / 2 - BM_STATUS_WIDTH / 2, BM_STATUS_WIDTH, BM_STATUS_WIDTH, status_color[status]);
if(f->notify) {
drawalpha(BM_STATUS_NOTIFY, LIST_RIGHT - SCALE * 13, y + ITEM_HEIGHT / 2 - BM_STATUS_NOTIFY_WIDTH / 2, BM_STATUS_NOTIFY_WIDTH, BM_STATUS_NOTIFY_WIDTH, status_color[status]);
}
break;
}

Expand Down Expand Up @@ -165,6 +168,8 @@ static void selectitem(ITEM *i)

f->msg.id = f - friend;

f->notify = 0;

edit_msg.current = f->current;
edit_msg.next = f->next;
edit_msg.last = f->last;
Expand Down
2 changes: 1 addition & 1 deletion main.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ enum
BM_AWAY,
BM_BUSY,
BM_OFFLINE,
BM_NMSG,
BM_STATUS_NOTIFY,

BM_ADD,
BM_GROUPS,
Expand Down
6 changes: 6 additions & 0 deletions svg.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ _Bool svg_draw(_Bool needmemory)

size = SCROLL_WIDTH * SCROLL_WIDTH + BM_STATUSAREA_WIDTH * BM_STATUSAREA_HEIGHT + BM_ADD_WIDTH * BM_ADD_WIDTH * 4 +
BM_CONTACT_WIDTH * BM_CONTACT_WIDTH * 2 + BM_LBICON_WIDTH * BM_LBICON_HEIGHT * 3 + BM_STATUS_WIDTH * BM_STATUS_WIDTH * 4 +
BM_STATUS_NOTIFY_WIDTH * BM_STATUS_NOTIFY_WIDTH +
BM_LBUTTON_WIDTH * BM_LBUTTON_HEIGHT + BM_SBUTTON_WIDTH * BM_SBUTTON_HEIGHT + BM_FT_WIDTH * BM_FT_HEIGHT +
BM_FTM_WIDTH * BM_FT_HEIGHT + (BM_FTB_WIDTH * (BM_FTB_HEIGHT + SCALE) + BM_FTB_WIDTH * BM_FTB_HEIGHT) +
BM_FB_WIDTH * BM_FB_HEIGHT * 3;
Expand Down Expand Up @@ -488,6 +489,11 @@ _Bool svg_draw(_Bool needmemory)
loadalpha(BM_OFFLINE, p, BM_STATUS_WIDTH, BM_STATUS_WIDTH);
p += s;

drawcircle(p, BM_STATUS_NOTIFY_WIDTH);
drawsubcircle(p, BM_STATUS_NOTIFY_WIDTH, BM_STATUS_NOTIFY_WIDTH, 0.5 * BM_STATUS_NOTIFY_WIDTH, 0.5 * BM_STATUS_NOTIFY_WIDTH, 6 * SCALE);
loadalpha(BM_STATUS_NOTIFY, p, BM_STATUS_NOTIFY_WIDTH, BM_STATUS_NOTIFY_WIDTH);
p += BM_STATUS_NOTIFY_WIDTH * BM_STATUS_NOTIFY_WIDTH;

drawrectrounded(p, BM_LBUTTON_WIDTH, BM_LBUTTON_HEIGHT, SCALE * 2);
loadalpha(BM_LBUTTON, p, BM_LBUTTON_WIDTH, BM_LBUTTON_HEIGHT);
p += BM_LBUTTON_WIDTH * BM_LBUTTON_HEIGHT;
Expand Down
1 change: 1 addition & 0 deletions svg.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define _BM_ADD_WIDTH 9
#define BM_ADD_WIDTH (9 * SCALE)
#define BM_STATUS_WIDTH (5 * SCALE)
#define BM_STATUS_NOTIFY_WIDTH (7 * SCALE)
#define BM_NMSG_WIDTH (9 * SCALE)

#define BM_LBUTTON_WIDTH (26 * SCALE)
Expand Down

0 comments on commit 1644201

Please sign in to comment.