Commit f0d32a86 authored by Cedric Roux's avatar Cedric Roux

smaller event selector window

parent 98c46f70
......@@ -102,7 +102,7 @@ event_selector *setup_event_selector(gui *g, void *database, int socket,
red = new_color(g, "#c93535");
green = new_color(g, "#2f9e2a");
win = new_toplevel_window(g, 610, 800, "event selector");
win = new_toplevel_window(g, 470, 300, "event selector");
main_container = new_container(g, VERTICAL);
widget_add_child(g, win, main_container, -1);
......@@ -124,8 +124,8 @@ event_selector *setup_event_selector(gui *g, void *database, int socket,
widget_add_child(g, left, new_label(g, "Events"), -1);
widget_add_child(g, right, new_label(g, "Groups"), -1);
events = new_text_list(g, 300, 10, new_color(g, "#b3c1e1"));
groups = new_text_list(g, 300, 10, new_color(g, "#edd6cb"));
events = new_text_list(g, 235, 10, new_color(g, "#b3c1e1"));
groups = new_text_list(g, 235, 10, new_color(g, "#edd6cb"));
widget_add_child(g, left, events, -1);
widget_add_child(g, right, groups, -1);
......
......@@ -47,7 +47,7 @@ static void _event(void *p, event e)
switch(l->f[i].type) {
case INSTRING: PUTS(&l->o, l->f[i].s); break;
case INT: PUTI(&l->o, e.e[l->f[i].event_arg].i); break;
case STRING: PUTS(&l->o, e.e[l->f[i].event_arg].s); break;
case STRING: PUTS_CLEAN(&l->o, e.e[l->f[i].event_arg].s); break;
case BUFFER:
PUTS(&l->o, "{buffer size:");
PUTI(&l->o, e.e[l->f[i].event_arg].bsize);
......
......@@ -4,6 +4,7 @@
#include <pthread.h>
#include <time.h>
#include <unistd.h>
#include <ctype.h>
void new_thread(void *(*f)(void *), void *data)
{
......@@ -97,6 +98,17 @@ void PUTS(OBUF *o, char *s)
while (*s) PUTC(o, *s++);
}
static int clean(char c)
{
if (!isprint(c)) c = ' ';
return c;
}
void PUTS_CLEAN(OBUF *o, char *s)
{
while (*s) PUTC(o, clean(*s++));
}
void PUTI(OBUF *o, int i)
{
char s[64];
......
......@@ -34,6 +34,7 @@ typedef struct {
void PUTC(OBUF *o, char c);
void PUTS(OBUF *o, char *s);
void PUTS_CLEAN(OBUF *o, char *s);
void PUTI(OBUF *o, int i);
#endif /* _UTILS_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment