aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-08-01 16:24:17 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-08-01 16:24:17 +0200
commitcbfa96f941723b7288f3b034acadded3815a960c (patch)
tree3c950a54f9afed2ae94e24f0c59dc171b6330471
parent60f3384f6906ed4efac9bb388ce227f07361c41e (diff)
downloadsynthpod-cbfa96f941723b7288f3b034acadded3815a960c.tar.xz
d2tk: alternating list buttonn colors.
-rw-r--r--VERSION2
-rw-r--r--plugins/synthpod_common_d2tk.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index d037c83b..d810e906 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.6077
+0.1.6079
diff --git a/plugins/synthpod_common_d2tk.c b/plugins/synthpod_common_d2tk.c
index 58a659a2..ca50c375 100644
--- a/plugins/synthpod_common_d2tk.c
+++ b/plugins/synthpod_common_d2tk.c
@@ -84,6 +84,8 @@ struct _plughandle_t {
stat_label_t message;
+ d2tk_style_t button_style [2];
+
unsigned nviews;
view_t views [32];
};
@@ -211,6 +213,8 @@ _expose_view(plughandle_t *handle, unsigned iview, const d2tk_rect_t *rect)
const d2tk_id_t id = D2TK_ID_IDX(iview*dn + k);
entry_t *entry = &handle->lplugs[k];
+ d2tk_base_set_style(base, &handle->button_style[k % 2]);
+
if(d2tk_base_button_label_is_changed(base, id,
entry->name.len, entry->name.buf,
D2TK_ALIGN_MIDDLE | D2TK_ALIGN_LEFT, row))
@@ -218,6 +222,8 @@ _expose_view(plughandle_t *handle, unsigned iview, const d2tk_rect_t *rect)
//FIXME
}
}
+
+ d2tk_base_set_style(base, NULL);
}
} break;
case VIEW_TYPE_PRESET_LIST:
@@ -403,6 +409,14 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
handle->message.len = snprintf(handle->message.buf, sizeof(handle->message.buf),
"%s ...", "Scanning for plugins");
+ handle->button_style[0] = *d2tk_base_get_default_style();
+ handle->button_style[0].fill_color[D2TK_TRIPLE_NONE] =
+ handle->button_style[0].fill_color[D2TK_TRIPLE_FOCUS] = 0x4f4f4fff;
+
+ handle->button_style[1] = *d2tk_base_get_default_style();
+ handle->button_style[1].fill_color[D2TK_TRIPLE_NONE] =
+ handle->button_style[1].fill_color[D2TK_TRIPLE_FOCUS] = 0x3f3f3fff;
+
return handle;
}