Commit f2677904 authored by Hanspeter Portner's avatar Hanspeter Portner

beautify UIs a bit.

parent 3ccb82d1
......@@ -92,11 +92,14 @@ _is_expandable(UI *ui, const uint32_t type)
|| (type == ui->forge.Sequence);
}
#define HIL_PRE(VAL) ("<color=#bbb font=Mono style=plain><b>"VAL"</b></color> <color=#b00 font=Mono style=plain>")
#define CODE_PRE "<style=shadow,bottom>"
#define CODE_POST "</style>"
#define HIL_PRE(VAL) ("<color=#bbb font=Mono><b>"VAL"</b></color> <color=#b00 font=Mono>")
#define HIL_POST ("</color>")
#define URI(VAL,TYP) ("<color=#bbb font=Mono style=plain><b>"VAL"</b></color> <color=#fff style=plain>"TYP"</color>")
#define HIL(VAL,TYP) ("<color=#bbb font=Mono style=plain><b>"VAL"</b></color> <color=#b00 font=Mono style=plain>"TYP"</color>")
#define URI(VAL,TYP) ("<color=#bbb font=Mono><b>"VAL"</b></color> <color=#fff font=Default>"TYP"</color>")
#define HIL(VAL,TYP) ("<color=#bbb font=Mono><b>"VAL"</b></color> <color=#b00 font=Mono>"TYP"</color>")
static void
_hash_del(void *data)
......@@ -134,6 +137,8 @@ static char *
_atom_stringify(UI *ui, char *ptr, char *end, int newline, const LV2_Atom *atom)
{
//FIXME check for buffer overflows!!!
sprintf(ptr, CODE_PRE);
ptr += strlen(ptr);
const char *type = _hash_get(ui, atom->type);
sprintf(ptr, URI("type ", "%s (%"PRIu32")"), type, atom->type);
......@@ -375,6 +380,9 @@ _atom_stringify(UI *ui, char *ptr, char *end, int newline, const LV2_Atom *atom)
sprintf(ptr, "</br>");
}
ptr += strlen(ptr);
sprintf(ptr, CODE_POST);
return ptr + strlen(ptr);
}
......
......@@ -189,7 +189,7 @@ _search_controller(uint8_t type)
return bsearch(&type, controllers, CONTROLLERS_NUM, sizeof(midi_msg_t), _cmp_search);
}
#define CODE_PRE "<font=Mono style=plain>"
#define CODE_PRE "<font=Mono style=shadow,bottom>"
#define CODE_POST "</font>"
#define RAW_PRE "<color=#b0b><b>"
......@@ -729,7 +729,7 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
break;
Elm_Object_Item *itm2 = elm_genlist_item_append(ui->list, ui->itc_midi,
ev, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
ev, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
elm_genlist_item_select_mode_set(itm2, ELM_OBJECT_SELECT_MODE_DEFAULT);
// scroll to last item
......
......@@ -64,11 +64,11 @@ struct _UI {
(iter) = lv2_atom_tuple_next(iter))
#endif
#define CODE_PRE ("<font=Mono style=plain>")
#define CODE_PRE ("<font=Mono style=shadow,bottom>")
#define CODE_POST ("</font>")
#define PATH(VAL) ("<color=#b0b><b>"VAL"</b></color>")
#define BUNDLE(VAL) ("<color=#888><b>"VAL"</b></color>")
#define BUNDLE(VAL) ("<color=#b0b><b>"VAL"</b></color>")
#define TYPE(TYP, VAL) ("<color=#0b0><b>"TYP"</b></color><color=#fff>"VAL"</color>")
#define TYPE_PRE(TYP, VAL) ("<color=#0b0><b>"TYP"</b></color><color=#fff>"VAL)
......@@ -798,8 +798,10 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
Elm_Object_Item *itm2 = elm_genlist_item_append(ui->list, ui->itc_packet,
ev, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
elm_genlist_item_select_mode_set(itm2, ELM_OBJECT_SELECT_MODE_DEFAULT);
/*
if(osc_atom_is_bundle(&ui->oforge, obj))
elm_genlist_item_expanded_set(itm2, EINA_TRUE);
*/
// scroll to last item
//elm_genlist_item_show(itm, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
......
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