aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-09-06 10:09:22 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-09-06 10:09:22 +0200
commitb4753d158c5741847d44780d7fd777f01456da3d (patch)
tree081f325e0ba9548658a2a24d5cf027752275d9fb
parent9f8c376292e0ae37b38e7356a6fef09c7187a687 (diff)
downloadsynthpod-b4753d158c5741847d44780d7fd777f01456da3d.zip
synthpod-b4753d158c5741847d44780d7fd777f01456da3d.tar.gz
synthpod-b4753d158c5741847d44780d7fd777f01456da3d.tar.bz2
synthpod-b4753d158c5741847d44780d7fd777f01456da3d.tar.xz
nk: better button label for single plugin GUIs.
-rw-r--r--VERSION2
-rw-r--r--plugins/synthpod_common_nk.c37
2 files changed, 22 insertions, 17 deletions
diff --git a/VERSION b/VERSION
index 5930029..beb642e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.6127
+0.1.6129
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index 2ef5818..5714fe3 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -7888,6 +7888,8 @@ _expose_main_body(plughandle_t *handle, struct nk_context *ctx, float dh, float
{
nk_layout_row_dynamic(ctx, dy, nuis);
+ const bool single_ui = _hash_size(&mod->uis) == 1;
+
HASH_FOREACH(&mod->uis, mod_ui_itr)
{
mod_ui_t *mod_ui = *mod_ui_itr;
@@ -7895,22 +7897,25 @@ _expose_main_body(plughandle_t *handle, struct nk_context *ctx, float dh, float
const LilvNode *ui_node = lilv_ui_get_uri(ui);
const bool is_running = _mod_ui_is_running(mod_ui);
- const char *label = "UI";
-
- if(lilv_ui_is_a(ui, handle->regs.ui.x11.node))
- label = "X11";
- else if(lilv_ui_is_a(ui, handle->regs.ui.gtk2.node))
- label = "Gtk2";
- else if(lilv_ui_is_a(ui, handle->regs.ui.gtk3.node))
- label = "Gtk3";
- else if(lilv_ui_is_a(ui, handle->regs.ui.qt4.node))
- label = "Qt4";
- else if(lilv_ui_is_a(ui, handle->regs.ui.qt5.node))
- label = "Qt5";
- else if(lilv_ui_is_a(ui, handle->regs.ui.kx_widget.node))
- label = "KX";
- else if(lilv_world_ask(handle->world, ui_node, handle->regs.core.extension_data.node, handle->regs.ui.show_interface.node))
- label = "Show";
+ const char *label = "Show plugin GUI";
+
+ if(!single_ui)
+ {
+ if(lilv_ui_is_a(ui, handle->regs.ui.x11.node))
+ label = "X11";
+ else if(lilv_ui_is_a(ui, handle->regs.ui.gtk2.node))
+ label = "Gtk2";
+ else if(lilv_ui_is_a(ui, handle->regs.ui.gtk3.node))
+ label = "Gtk3";
+ else if(lilv_ui_is_a(ui, handle->regs.ui.qt4.node))
+ label = "Qt4";
+ else if(lilv_ui_is_a(ui, handle->regs.ui.qt5.node))
+ label = "Qt5";
+ else if(lilv_ui_is_a(ui, handle->regs.ui.kx_widget.node))
+ label = "KX";
+ else if(lilv_world_ask(handle->world, ui_node, handle->regs.core.extension_data.node, handle->regs.ui.show_interface.node))
+ label = "Show";
+ }
const bool is_still_running = _toolbar_label(ctx, is_running, 0x0, label);
if(is_still_running != is_running)