return NULL;
}
co->data = bu;
+ co->destroyCallback = NULL;
bu->text = strdup(text);
bu->compact = compact;
SLsmg_set_color(NEWT_COLORSET_BUTTON);
if (bu->compact) {
- if (active)
+ if (!active)
SLsmg_set_color(NEWT_COLORSET_COMPACTBUTTON);
- else
+ else if (SLtt_Use_Ansi_Colors)
SLsmg_set_color(NEWT_COLORSET_BUTTON);
+ else
+ SLsmg_set_color(NEWT_COLORSET_ACTBUTTON);
newtGotorc(co->top+ pushed, co->left + 1 + pushed);
SLsmg_write_char('<');
SLsmg_write_string(bu->text);
buttonDrawText(co, active, pushed);
}
+ /* put cursor at beginning of text for better accessibility */
+ newtGotorc(co->top + (bu->compact ? 0 : 1) + pushed, co->left + 1 + pushed + 1);
}
static void buttonDrawText(newtComponent co, int active, int pushed) {
struct eventResult er;
struct button * bu = co->data;
+ er.result = ER_IGNORED;
+
if (ev.when == EV_NORMAL) {
switch (ev.event) {
case EV_FOCUS:
}
break;
}
- } else
- er.result = ER_IGNORED;
+ }
return er;
}