1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 08:26:45 +02:00

improve window alert functionality

This commit is contained in:
Jfreegman
2013-11-28 19:45:28 -05:00
parent 2057e7bc4f
commit a98ec22fd6
8 changed files with 50 additions and 31 deletions

View File

@ -107,11 +107,16 @@ bool timed_out(uint64_t timestamp, uint64_t curtime, uint64_t timeout)
return timestamp + timeout <= curtime;
}
/* Beeps and makes window tab blink */
void alert_window(ToxWindow *self)
/* Colours the window tab according to type. Beeps if is_beep is true */
void alert_window(ToxWindow *self, int type, bool is_beep)
{
self->blink = true;
beep();
if (type == WINDOW_ALERT_1)
self->alert1 = true;
else if(type == WINDOW_ALERT_2)
self->alert2 = true;
if (is_beep)
beep();
}
/* case-insensitive string compare function for use with qsort - same return logic as strcmp */