aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-06-04 17:30:14 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-06-04 17:30:14 +0200
commit2561df64708870e95a215ee377a815ddf654dfd5 (patch)
tree66728e5ef2338669d292483e695ff88b29cf351f
parent1c8aef3d70a616aba0bbef5787635626895a7b5d (diff)
downloadsynthpod-2561df64708870e95a215ee377a815ddf654dfd5.tar.xz
nk: prototype preset origin icon.
-rw-r--r--VERSION2
-rw-r--r--data/CMakeLists.txt3
-rw-r--r--plugins/synthpod_common_nk.c16
3 files changed, 19 insertions, 2 deletions
diff --git a/VERSION b/VERSION
index a735cdfe..5adb7300 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5005
+0.1.5007
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index b9d83c8d..4c17d47d 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -16,3 +16,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pix/automaton.png DESTINATION ${SYNTHP
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/png/plus.png DESTINATION ${SYNTHPOD_DATA_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/png/download.png DESTINATION ${SYNTHPOD_DATA_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/png/cancel.png DESTINATION ${SYNTHPOD_DATA_DIR})
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/png/house.png DESTINATION ${SYNTHPOD_DATA_DIR})
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/png/layers.png DESTINATION ${SYNTHPOD_DATA_DIR})
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/png/user.png DESTINATION ${SYNTHPOD_DATA_DIR})
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index e02d4f2f..c93afd14 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -422,6 +422,10 @@ struct _plughandle_t {
struct nk_image plus;
struct nk_image download;
struct nk_image cancel;
+
+ struct nk_image house;
+ struct nk_image layers;
+ struct nk_image user;
} icon;
};
@@ -3502,7 +3506,11 @@ _expose_main_preset_list_for_bank(plughandle_t *handle, struct nk_context *ctx,
? nk_style_item_color(nk_rgb(40, 40, 40))
: nk_style_item_color(nk_rgb(45, 45, 45))); // NK_COLOR_WINDOW
- if(nk_select_label(ctx, label_str, NK_TEXT_LEFT, nk_false))
+ const bool is_user_preset = !strncmp(lilv_node_as_string(preset), "file://", 7);
+
+ if(nk_select_image_label(ctx,
+ is_user_preset ? handle->icon.house: handle->icon.layers,
+ label_str, NK_TEXT_LEFT, nk_false))
{
_patch_mod_preset_set(handle, handle->module_selector, preset);
}
@@ -5965,6 +5973,9 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
handle->icon.plus = _icon_load(handle, "plus.png");
handle->icon.download = _icon_load(handle, "download.png");
handle->icon.cancel = _icon_load(handle, "cancel.png");
+ handle->icon.house = _icon_load(handle, "house.png");
+ handle->icon.layers = _icon_load(handle, "layers.png");
+ handle->icon.user = _icon_load(handle, "user.png");
return handle;
}
@@ -5987,6 +5998,9 @@ cleanup(LV2UI_Handle instance)
_icon_unload(handle, handle->icon.plus);
_icon_unload(handle, handle->icon.download);
_icon_unload(handle, handle->icon.cancel);
+ _icon_unload(handle, handle->icon.house);
+ _icon_unload(handle, handle->icon.layers);
+ _icon_unload(handle, handle->icon.user);
if(handle->win.cfg.font.face)
free(handle->win.cfg.font.face);