aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2015-11-23 21:12:32 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2015-11-23 21:12:32 +0100
commit9b9432d1980bedb848af1e2f01bb141604295376 (patch)
treecd9729423946d2030da3e68809881236dc3b49a1
parent4b75933924e4fb2bde7e0fdf5c382891c99e8771 (diff)
downloadsynthpod-9b9432d1980bedb848af1e2f01bb141604295376.tar.xz
embed prev. swallowed icons into theme directly.
* do not use swallow when possible for icon stuff. * embed previously swallowed icons into theme directly. * use nice icons for (un)link and (un)monitor.
-rw-r--r--data/modlist.edc329
-rw-r--r--data/pix/link_off.pngbin0 -> 552 bytes
-rw-r--r--data/pix/link_on.pngbin0 -> 545 bytes
-rw-r--r--data/pix/monitor_off.pngbin0 -> 576 bytes
-rw-r--r--data/pix/monitor_on.pngbin0 -> 418 bytes
-rw-r--r--lib/synthpod_ui.c172
6 files changed, 340 insertions, 161 deletions
diff --git a/data/modlist.edc b/data/modlist.edc
index e89a5bfe..818c6ff3 100644
--- a/data/modlist.edc
+++ b/data/modlist.edc
@@ -19,47 +19,13 @@
images {
image: "icon_arrow_up_right.png" COMP;
+ image: "icon_arrow_up.png" COMP;
+ image: "icon_arrow_right.png" COMP;
image: "icon_close.png" COMP;
-}
-
-group {
- name: "/synthpod/modlist/expand";
-
- parts {
- part {
- name: "ev";
- type: IMAGE;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- fixed: 1 1;
- image {
- normal: "icon_arrow_up_right.png";
- scale_hint: STATIC;
- }
- }
- }
- }
-}
-
-group {
- name: "/synthpod/modlist/close";
-
- parts {
- part {
- name: "ev";
- type: IMAGE;
- mouse_events: 1;
- description {
- state: "default" 0.0;
- fixed: 1 1;
- image {
- normal: "icon_close.png";
- scale_hint: STATIC;
- }
- }
- }
- }
+ image: "monitor_on.png" COMP;
+ image: "monitor_off.png" COMP;
+ image: "link_on.png" COMP;
+ image: "link_off.png" COMP;
}
group {
@@ -93,8 +59,8 @@ group {
description { state: "default" 0.20; fixed: 1 1; color: COL20; }
}
part {
- name: "elm.swallow.icon";
- type: SWALLOW;
+ name: "link";
+ type: IMAGE;
mouse_events: 1;
description {
state: "default" 0.0;
@@ -104,6 +70,13 @@ group {
rel1.relative: 0 0;
rel2.relative: 0 1;
min: 16 16;
+ image.normal: "link_off.png";
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ image.normal: "link_on.png";
}
}
part {
@@ -115,9 +88,9 @@ group {
description {
state: "default" 0.0;
fixed: 1 1;
- rel1.to_x: "elm.swallow.icon";
+ rel1.to_x: "link";
rel1.relative: 1 0;
- rel2.to_x: "elm.swallow.preend";
+ rel2.to_x: "ui";
rel2.relative: 0 1;
text {
text: "";
@@ -129,24 +102,31 @@ group {
}
}
part {
- name: "elm.swallow.preend";
- type: SWALLOW;
+ name: "ui";
+ type: IMAGE;
mouse_events: 1;
description {
state: "default" 0.0;
fixed: 1 1;
align: 1.0 0.5;
aspect: 1.0 1.0;
- rel1.to_x: "elm.swallow.end";
+ rel1.to_x: "close";
rel1.relative: -1 0;
- rel2.to_x: "elm.swallow.end";
+ rel2.to_x: "close";
rel2.relative: 0 1;
min: 16 16;
+ image.normal: "icon_arrow_up_right.png";
+ color: 255 255 255 0;
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
}
}
part {
- name: "elm.swallow.end";
- type: SWALLOW;
+ name: "close";
+ type: IMAGE;
mouse_events: 1;
description {
state: "default" 0.0;
@@ -156,6 +136,13 @@ group {
rel1.relative: 1 0;
rel2.relative: 1 1;
min: 16 16;
+ image.normal: "icon_close.png";
+ color: 255 255 255 0;
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
}
}
}
@@ -182,6 +169,54 @@ group {
program { signal: "col,18"; source: MODLIST_UI; action: STATE_SET "default" 0.18; target: "clip"; }
program { signal: "col,19"; source: MODLIST_UI; action: STATE_SET "default" 0.19; target: "clip"; }
program { signal: "col,20"; source: MODLIST_UI; action: STATE_SET "default" 0.20; target: "clip"; }
+
+ program {
+ signal: "link,on";
+ action: STATE_SET "default" 1.0;
+ target: "link";
+ }
+ program {
+ signal: "link,off";
+ action: STATE_SET "default" 0.0;
+ target: "link";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "link";
+ action: SIGNAL_EMIT "link,toggle" "";
+ }
+
+ program {
+ signal: "close,show";
+ action: STATE_SET "default" 1.0;
+ target: "close";
+ }
+ program {
+ signal: "close,hide";
+ action: STATE_SET "default" 0.0;
+ target: "close";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "close";
+ action: SIGNAL_EMIT "close,click" "";
+ }
+
+ program {
+ signal: "ui,show";
+ action: STATE_SET "default" 1.0;
+ target: "ui";
+ }
+ program {
+ signal: "ui,hide";
+ action: STATE_SET "default" 0.0;
+ target: "ui";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "ui";
+ action: SIGNAL_EMIT "ui,toggle" "";
+ }
}
}
@@ -190,9 +225,36 @@ group {
parts {
part {
- name: "elm.swallow.icon";
- type: SWALLOW;
- mouse_events: 1;
+ name: "clip";
+ type: RECT;
+ mouse_events: 0;
+ description { state: "default" 0.00; fixed: 1 1; color: COL00; }
+ description { state: "default" 0.01; fixed: 1 1; color: COL01; }
+ description { state: "default" 0.02; fixed: 1 1; color: COL02; }
+ description { state: "default" 0.03; fixed: 1 1; color: COL03; }
+ description { state: "default" 0.04; fixed: 1 1; color: COL04; }
+ description { state: "default" 0.05; fixed: 1 1; color: COL05; }
+ description { state: "default" 0.06; fixed: 1 1; color: COL06; }
+ description { state: "default" 0.07; fixed: 1 1; color: COL07; }
+ description { state: "default" 0.08; fixed: 1 1; color: COL08; }
+ description { state: "default" 0.09; fixed: 1 1; color: COL09; }
+ description { state: "default" 0.10; fixed: 1 1; color: COL10; }
+ description { state: "default" 0.11; fixed: 1 1; color: COL11; }
+ description { state: "default" 0.12; fixed: 1 1; color: COL12; }
+ description { state: "default" 0.13; fixed: 1 1; color: COL13; }
+ description { state: "default" 0.14; fixed: 1 1; color: COL14; }
+ description { state: "default" 0.15; fixed: 1 1; color: COL15; }
+ description { state: "default" 0.16; fixed: 1 1; color: COL16; }
+ description { state: "default" 0.17; fixed: 1 1; color: COL17; }
+ description { state: "default" 0.18; fixed: 1 1; color: COL18; }
+ description { state: "default" 0.19; fixed: 1 1; color: COL19; }
+ description { state: "default" 0.20; fixed: 1 1; color: COL20; }
+ }
+ part {
+ name: "sink";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "clip";
description {
state: "default" 0.0;
fixed: 1 1;
@@ -201,22 +263,43 @@ group {
rel1.relative: 0 0;
rel2.relative: 0 1;
min: 16 16;
+ image.normal: "icon_arrow_right.png";
+ color: 255 255 255 0;
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
}
}
part {
- name: "elm.swallow.sink";
- type: SWALLOW;
- mouse_events: 0;
+ name: "link";
+ type: IMAGE;
+ mouse_events: 1;
description {
state: "default" 0.0;
fixed: 1 1;
align: 0.0 0.5;
aspect: 1.0 1.0;
- rel1.to_x: "elm.swallow.icon";
+ rel1.to_x: "sink";
rel1.relative: 1 0;
- rel2.to_x: "elm.swallow.icon";
+ rel2.to_x: "sink";
rel2.relative: 1 1;
min: 16 16;
+ image.normal: "link_off.png";
+ color: 255 255 255 0;
+ }
+ description {
+ state: "default" 0.5;
+ inherit: "default" 0.0;
+ image.normal: "link_off.png";
+ color: 255 255 255 255;
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ image.normal: "link_on.png";
+ color: 255 255 255 255;
}
}
part {
@@ -227,7 +310,7 @@ group {
description {
state: "default" 0.0;
fixed: 1 1;
- rel1.to_x: "elm.swallow.sink";
+ rel1.to_x: "link";
rel1.relative: 1 0;
rel2.relative: 0.4 1;
text {
@@ -245,30 +328,45 @@ group {
state: "default" 0.0;
fixed: 1 1;
rel1.relative: 0.4 0;
- rel2.to_x: "elm.swallow.source";
+ rel2.to_x: "monitor";
rel2.relative: 0 1;
}
}
part {
- name: "elm.swallow.source";
- type: SWALLOW;
- mouse_events: 0;
+ name: "monitor";
+ type: IMAGE;
+ mouse_events: 1;
description {
state: "default" 0.0;
fixed: 1 1;
align: 1.0 0.5;
aspect: 1.0 1.0;
rel1.relative: -1 0;
- rel1.to_x: "elm.swallow.end";
+ rel1.to_x: "source";
rel2.relative: 0 1;
- rel2.to_x: "elm.swallow.end";
+ rel2.to_x: "source";
min: 16 16;
+ image.normal: "monitor_off.png";
+ color: 255 255 255 0;
+ }
+ description {
+ state: "default" 0.5;
+ inherit: "default" 0.0;
+ image.normal: "monitor_off.png";
+ color: 255 255 255 255;
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ image.normal: "monitor_on.png";
+ color: 255 255 255 255;
}
}
part {
- name: "elm.swallow.end";
- type: SWALLOW;
- mouse_events: 1;
+ name: "source";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "clip";
description {
state: "default" 0.0;
fixed: 1 1;
@@ -277,7 +375,102 @@ group {
rel1.relative: 1 0;
rel2.relative: 1 1;
min: 16 16;
+ image.normal: "icon_arrow_up.png";
+ color: 255 255 255 0;
}
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ }
+
+ programs {
+ program { signal: "col,00"; source: MODLIST_UI; action: STATE_SET "default" 0.00; target: "clip"; }
+ program { signal: "col,01"; source: MODLIST_UI; action: STATE_SET "default" 0.01; target: "clip"; }
+ program { signal: "col,02"; source: MODLIST_UI; action: STATE_SET "default" 0.02; target: "clip"; }
+ program { signal: "col,03"; source: MODLIST_UI; action: STATE_SET "default" 0.03; target: "clip"; }
+ program { signal: "col,04"; source: MODLIST_UI; action: STATE_SET "default" 0.04; target: "clip"; }
+ program { signal: "col,05"; source: MODLIST_UI; action: STATE_SET "default" 0.05; target: "clip"; }
+ program { signal: "col,06"; source: MODLIST_UI; action: STATE_SET "default" 0.06; target: "clip"; }
+ program { signal: "col,07"; source: MODLIST_UI; action: STATE_SET "default" 0.07; target: "clip"; }
+ program { signal: "col,08"; source: MODLIST_UI; action: STATE_SET "default" 0.08; target: "clip"; }
+ program { signal: "col,09"; source: MODLIST_UI; action: STATE_SET "default" 0.09; target: "clip"; }
+ program { signal: "col,10"; source: MODLIST_UI; action: STATE_SET "default" 0.10; target: "clip"; }
+ program { signal: "col,11"; source: MODLIST_UI; action: STATE_SET "default" 0.11; target: "clip"; }
+ program { signal: "col,12"; source: MODLIST_UI; action: STATE_SET "default" 0.12; target: "clip"; }
+ program { signal: "col,13"; source: MODLIST_UI; action: STATE_SET "default" 0.13; target: "clip"; }
+ program { signal: "col,14"; source: MODLIST_UI; action: STATE_SET "default" 0.14; target: "clip"; }
+ program { signal: "col,15"; source: MODLIST_UI; action: STATE_SET "default" 0.15; target: "clip"; }
+ program { signal: "col,16"; source: MODLIST_UI; action: STATE_SET "default" 0.16; target: "clip"; }
+ program { signal: "col,17"; source: MODLIST_UI; action: STATE_SET "default" 0.17; target: "clip"; }
+ program { signal: "col,18"; source: MODLIST_UI; action: STATE_SET "default" 0.18; target: "clip"; }
+ program { signal: "col,19"; source: MODLIST_UI; action: STATE_SET "default" 0.19; target: "clip"; }
+ program { signal: "col,20"; source: MODLIST_UI; action: STATE_SET "default" 0.20; target: "clip"; }
+
+ program {
+ signal: "link,hide";
+ action: STATE_SET "default" 0.0;
+ target: "link";
+ }
+ program {
+ signal: "link,on";
+ action: STATE_SET "default" 1.0;
+ target: "link";
+ }
+ program {
+ signal: "link,off";
+ action: STATE_SET "default" 0.5;
+ target: "link";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "link";
+ action: SIGNAL_EMIT "link,toggle" "";
+ }
+
+ program {
+ signal: "monitor,hide";
+ action: STATE_SET "default" 0.0;
+ target: "monitor";
+ }
+ program {
+ signal: "monitor,on";
+ action: STATE_SET "default" 1.0;
+ target: "monitor";
+ }
+ program {
+ signal: "monitor,off";
+ action: STATE_SET "default" 0.5;
+ target: "monitor";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "monitor";
+ action: SIGNAL_EMIT "monitor,toggle" "";
+ }
+
+ program {
+ signal: "source,show";
+ action: STATE_SET "default" 1.0;
+ target: "source";
+ }
+ program {
+ signal: "source,hide";
+ action: STATE_SET "default" 0.0;
+ target: "source";
+ }
+
+ program {
+ signal: "sink,show";
+ action: STATE_SET "default" 1.0;
+ target: "sink";
+ }
+ program {
+ signal: "sink,hide";
+ action: STATE_SET "default" 0.0;
+ target: "sink";
}
}
}
diff --git a/data/pix/link_off.png b/data/pix/link_off.png
new file mode 100644
index 00000000..8d4b8ceb
--- /dev/null
+++ b/data/pix/link_off.png
Binary files differ
diff --git a/data/pix/link_on.png b/data/pix/link_on.png
new file mode 100644
index 00000000..66f76883
--- /dev/null
+++ b/data/pix/link_on.png
Binary files differ
diff --git a/data/pix/monitor_off.png b/data/pix/monitor_off.png
new file mode 100644
index 00000000..365ebe71
--- /dev/null
+++ b/data/pix/monitor_off.png
Binary files differ
diff --git a/data/pix/monitor_on.png b/data/pix/monitor_on.png
new file mode 100644
index 00000000..251219dc
--- /dev/null
+++ b/data/pix/monitor_on.png
Binary files differ
diff --git a/lib/synthpod_ui.c b/lib/synthpod_ui.c
index b5a6cd94..d66319cd 100644
--- a/lib/synthpod_ui.c
+++ b/lib/synthpod_ui.c
@@ -3227,7 +3227,7 @@ _modlist_moved(void *data, Evas_Object *obj, void *event_info)
}
static void
-_modlist_icon_clicked(void *data, Evas_Object *obj, void *event_info)
+_mod_close_click(void *data, Evas_Object *lay, const char *emission, const char *source)
{
mod_t *mod = data;
sp_ui_t *ui = mod->ui;
@@ -3329,7 +3329,7 @@ _full_delete_request(void *data, Evas_Object *obj, void *event_info)
}
static void
-_modlist_toggle_clicked(void *data, Evas_Object *obj, void *event_info)
+_mod_ui_toggle(void *data, Evas_Object *lay, const char *emission, const char *source)
{
mod_t *mod = data;
sp_ui_t *ui = mod->ui;
@@ -3428,12 +3428,14 @@ _modlist_toggle_clicked(void *data, Evas_Object *obj, void *event_info)
}
static void
-_modlist_selected_changed(void *data, Evas_Object *obj, void *event_info)
+_mod_link_toggle(void *data, Evas_Object *lay, const char *emission, const char *source)
{
mod_t *mod = data;
sp_ui_t *ui = mod->ui;
- mod->selected = elm_check_state_get(obj);
+ mod->selected ^= 1; // toggle
+ elm_layout_signal_emit(lay, mod->selected ? "link,on" : "link,off", "");
+
_patches_update(ui);
// signal app
@@ -3469,41 +3471,31 @@ _modlist_content_get(void *data, Evas_Object *obj, const char *part)
sprintf(col, "col,%02i", mod->col);
elm_layout_signal_emit(lay, col, MODLIST_UI);
- Evas_Object *check = elm_check_add(lay);
- if(check)
- {
- elm_check_state_set(check, mod->selected);
- evas_object_smart_callback_add(check, "changed", _modlist_selected_changed, mod);
- evas_object_show(check);
- elm_layout_icon_set(lay, check);
- elm_layout_content_set(lay, "elm.swallow.icon", check);
- }
+ // link
+ elm_layout_signal_callback_add(lay, "link,toggle", "", _mod_link_toggle, mod);
+ elm_layout_signal_emit(lay, mod->selected ? "link,on" : "link,off", "");
+ // close
if(!mod->system.source && !mod->system.sink)
{
- Evas_Object *icon = elm_icon_add(lay);
- if(icon)
- {
- elm_image_file_set(icon, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/synthpod/modlist/close");
- evas_object_smart_callback_add(icon, "clicked", _modlist_icon_clicked, mod);
- evas_object_show(icon);
- elm_layout_content_set(lay, "elm.swallow.end", icon);
- } // icon
+ elm_layout_signal_callback_add(lay, "close,click", "", _mod_close_click, mod);
+ elm_layout_signal_emit(lay, "close,show", "");
+ }
+ else
+ {
+ // system mods cannot be removed
+ elm_layout_signal_emit(lay, "close,hide", "");
}
- // system mods cannot be removed
+ // window
if(mod->show.ui || mod->kx.ui || mod->eo.ui || mod->x11.ui) //TODO also check for descriptor
{
- Evas_Object *icon = elm_icon_add(lay);
- if(icon)
- {
- elm_image_file_set(icon, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/synthpod/modlist/expand");
- evas_object_smart_callback_add(icon, "clicked", _modlist_toggle_clicked, mod);
- evas_object_show(icon);
- elm_layout_content_set(lay, "elm.swallow.preend", icon);
- } // icon
+ elm_layout_signal_callback_add(lay, "ui,toggle", "", _mod_ui_toggle, mod);
+ elm_layout_signal_emit(lay, "ui,show", "");
+ }
+ else
+ {
+ elm_layout_signal_emit(lay, "ui,hide", "");
}
} // lay
@@ -3800,26 +3792,27 @@ _property_content_get(void *data, Evas_Object *obj, const char *part)
evas_object_size_hint_align_set(lay, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(lay);
- Evas_Object *dir = edje_object_add(evas_object_evas_get(lay));
- if(dir)
+ // link
+ elm_layout_signal_emit(lay, "link,hide", ""); //TODO or "link,on"
+
+ // monitor
+ elm_layout_signal_emit(lay, "monitor,hide", ""); //TODO or "monitor,on"
+
+ char col [7];
+ sprintf(col, "col,%02i", mod->col);
+
+ // source/sink
+ elm_layout_signal_emit(lay, col, MODLIST_UI);
+ if(!prop->editable)
{
- edje_object_file_set(dir, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/synthpod/patcher/port");
- char col [7];
- sprintf(col, "col,%02i", mod->col);
- edje_object_signal_emit(dir, col, PATCHER_UI);
- evas_object_show(dir);
- if(!prop->editable)
- {
- edje_object_signal_emit(dir, "source", PATCHER_UI);
- elm_layout_content_set(lay, "elm.swallow.source", dir);
- }
- else
- {
- edje_object_signal_emit(dir, "sink", PATCHER_UI);
- elm_layout_content_set(lay, "elm.swallow.sink", dir);
- }
- } // dir
+ elm_layout_signal_emit(lay, "source,show", "");
+ elm_layout_signal_emit(lay, "sink,hide", "");
+ }
+ else
+ {
+ elm_layout_signal_emit(lay, "source,hide", "");
+ elm_layout_signal_emit(lay, "sink,show", "");
+ }
if(prop->label)
elm_layout_text_set(lay, "elm.text", prop->label);
@@ -3838,8 +3831,6 @@ _property_content_get(void *data, Evas_Object *obj, const char *part)
{
elm_layout_file_set(child, SYNTHPOD_DATA_DIR"/synthpod.edj",
"/synthpod/entry/theme");
- char col [7];
- sprintf(col, "col,%02i", mod->col);
elm_layout_signal_emit(child, col, "/synthpod/entry/ui");
prop->std.entry = elm_entry_add(child);
@@ -4048,13 +4039,15 @@ _group_del(void *data, Evas_Object *obj)
}
static void
-_selected_changed(void *data, Evas_Object *obj, void *event)
+_port_link_toggle(void *data, Evas_Object *lay, const char *emission, const char *source)
{
port_t *port = data;
mod_t *mod = port->mod;
sp_ui_t *ui = mod->ui;
- port->selected = elm_check_state_get(obj);
+ port->selected ^= 1; // toggle
+ elm_layout_signal_emit(lay, port->selected ? "link,on" : "link,off", "");
+
_patches_update(ui);
size_t size = sizeof(transmit_port_selected_t);
@@ -4067,13 +4060,14 @@ _selected_changed(void *data, Evas_Object *obj, void *event)
}
static void
-_monitored_changed(void *data, Evas_Object *obj, void *event)
+_port_monitor_toggle(void *data, Evas_Object *lay, const char *emission, const char *source)
{
port_t *port = data;
mod_t *mod = port->mod;
sp_ui_t *ui = mod->ui;
- port->std.monitored = elm_check_state_get(obj);
+ port->std.monitored ^= 1; // toggle
+ elm_layout_signal_emit(lay, port->std.monitored ? "monitor,on" : "monitor,off", "");
// subsribe or unsubscribe, depending on monitored state
{
@@ -4189,44 +4183,36 @@ _modlist_std_content_get(void *data, Evas_Object *obj, const char *part)
evas_object_event_callback_add(lay, EVAS_CALLBACK_DEL, _modlist_std_del, port);
evas_object_show(lay);
- Evas_Object *patched = elm_check_add(lay);
- if(patched)
+ // link
+ elm_layout_signal_callback_add(lay, "link,toggle", "", _port_link_toggle, port);
+ elm_layout_signal_emit(lay, port->selected ? "link,on" : "link,off", "");
+
+ // monitor
+ if(port->type != PORT_TYPE_ATOM)
+ {
+ elm_layout_signal_callback_add(lay, "monitor,toggle", "", _port_monitor_toggle, port);
+ elm_layout_signal_emit(lay, port->std.monitored ? "monitor,on" : "monitor,off", "");
+ }
+ else
{
- elm_check_state_set(patched, port->selected ? EINA_TRUE : EINA_FALSE);
- evas_object_smart_callback_add(patched, "changed", _selected_changed, port);
- evas_object_show(patched);
- elm_layout_content_set(lay, "elm.swallow.icon", patched);
- } // patched
-
- Evas_Object *monitored = elm_check_add(lay);
- if(monitored && (port->type != PORT_TYPE_ATOM) )
+ elm_layout_signal_emit(lay, "monitor,hide", "");
+ }
+
+ char col [7];
+ sprintf(col, "col,%02i", mod->col);
+
+ // source/sink
+ elm_layout_signal_emit(lay, col, MODLIST_UI);
+ if(port->direction == PORT_DIRECTION_OUTPUT)
{
- elm_check_state_set(monitored, port->std.monitored ? EINA_TRUE : EINA_FALSE);
- evas_object_smart_callback_add(monitored, "changed", _monitored_changed, port);
- evas_object_show(monitored);
- elm_layout_content_set(lay, "elm.swallow.end", monitored);
- } // monitored
-
- Evas_Object *dir = edje_object_add(evas_object_evas_get(lay));
- if(dir)
+ elm_layout_signal_emit(lay, "source,show", "");
+ elm_layout_signal_emit(lay, "sink,hide", "");
+ }
+ else
{
- edje_object_file_set(dir, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/synthpod/patcher/port");
- char col [7];
- sprintf(col, "col,%02i", mod->col);
- edje_object_signal_emit(dir, col, PATCHER_UI);
- evas_object_show(dir);
- if(port->direction == PORT_DIRECTION_OUTPUT)
- {
- edje_object_signal_emit(dir, "source", PATCHER_UI);
- elm_layout_content_set(lay, "elm.swallow.source", dir);
- }
- else
- {
- edje_object_signal_emit(dir, "sink", PATCHER_UI);
- elm_layout_content_set(lay, "elm.swallow.sink", dir);
- }
- } // dir
+ elm_layout_signal_emit(lay, "source,hide", "");
+ elm_layout_signal_emit(lay, "sink,show", "");
+ }
LilvNode *name_node = lilv_port_get_name(mod->plug, port->tar);
if(name_node)
@@ -4917,7 +4903,7 @@ _modlist_clear(sp_ui_t *ui, int clear_system_ports)
if(!clear_system_ports && (mod->system.source || mod->system.sink) )
continue; // skip
- _modlist_icon_clicked(mod, ui->modlist, NULL); //TODO rename
+ _mod_close_click(mod, ui->modlist, NULL, NULL);
}
}