[SCM] calf/master: Rename edit button in JACK host from Show/Hide into Edit (single name).
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:40:09 UTC 2013
The following commit has been merged in the master branch:
commit 4a1d996bfdce94d01921ba3219c7693dd8c3461b
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Wed May 5 00:22:03 2010 +0100
Rename edit button in JACK host from Show/Hide into Edit (single name).
I'm not personally a fan of buttons with changing labels, and the logic
that updated the button state wasn't handling all cases properly (merge
mistake?). The new code is simpler and behaves consistently.
diff --git a/src/main_win.cpp b/src/main_win.cpp
index 7cc3c4f..3a19b93 100644
--- a/src/main_win.cpp
+++ b/src/main_win.cpp
@@ -147,19 +147,8 @@ void main_window::set_window(plugin_ctl_iface *plugin, plugin_gui_window *gui_wi
if (!strip)
return;
strip->gui_win = gui_win;
- if (gui_win)
- {
- if (!is_closed)
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(strip->button), gui_win != NULL);
-
- GtkToggleButton *tb = GTK_TOGGLE_BUTTON(strip->button);
- if (strip->gui_win) {
- gtk_button_set_label(GTK_BUTTON(tb), "Hide");
- } else {
- gtk_button_set_label(GTK_BUTTON(tb), "Show");
- }
- }
-
+ if (!is_closed)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(strip->button), gui_win != NULL);
}
void main_window::refresh_all_presets(bool builtin_too)
@@ -183,10 +172,8 @@ gui_button_pressed(GtkWidget *button, main_window::plugin_strip *strip)
if (strip->gui_win) {
strip->gui_win->close();
strip->gui_win = NULL;
- gtk_button_set_label(GTK_BUTTON(tb), "Show");
} else {
strip->main_win->open_gui(strip->plugin);
- gtk_button_set_label(GTK_BUTTON(tb), "Hide");
}
return TRUE;
}
@@ -259,7 +246,7 @@ main_window::plugin_strip *main_window::create_strip(plugin_ctl_iface *plugin)
gtk_widget_show(title);
// open button
- GtkWidget *label = gtk_toggle_button_new_with_label("Show");
+ GtkWidget *label = gtk_toggle_button_new_with_label("Edit");
strip->button = label;
gtk_widget_set_size_request(GTK_WIDGET(label), 110, -1);
gtk_signal_connect(GTK_OBJECT(label), "toggled", G_CALLBACK(gui_button_pressed),
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list