summaryrefslogtreecommitdiffstats
path: root/gtk/src/audiohandler.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-08-04 16:57:23 -0700
committerJohn Stebbins <[email protected]>2017-08-04 17:00:13 -0700
commit9d98250279e5337d3083bd8d33e38d1f88669c9a (patch)
tree1cdba54fd5c6889874da6b0532aacce54d9fce8f /gtk/src/audiohandler.c
parenteb1d99a074e06b336aa1ac0dcad0fa192ac4240e (diff)
LinGui: rework audio/subtitle tabs gtk < 3.16
Add support for older gtk versions
Diffstat (limited to 'gtk/src/audiohandler.c')
-rw-r--r--gtk/src/audiohandler.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 87fe10c13..0a3a01833 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -2446,3 +2446,31 @@ void ghb_init_audio_defaults_ui(signal_user_data_t *ud)
list_box = GTK_LIST_BOX(GHB_WIDGET(ud->builder, "audio_avail_lang"));
ghb_init_lang_list_box(list_box);
}
+
+G_MODULE_EXPORT void
+audio_list_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ GtkToggleButton * selection = GTK_TOGGLE_BUTTON(GHB_WIDGET(ud->builder,
+ "audio_selection_toggle"));
+ gtk_toggle_button_set_active(selection, !active);
+
+ GtkStack * stack;
+ GtkWidget * tab;
+
+ stack = GTK_STACK(GHB_WIDGET(ud->builder, "AudioStack"));
+ if (active)
+ tab = GHB_WIDGET(ud->builder, "audio_list_tab");
+ else
+ tab = GHB_WIDGET(ud->builder, "audio_selection_tab");
+ gtk_stack_set_visible_child(stack, tab);
+}
+
+G_MODULE_EXPORT void
+audio_selection_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ GtkToggleButton * list = GTK_TOGGLE_BUTTON(GHB_WIDGET(ud->builder,
+ "audio_list_toggle"));
+ gtk_toggle_button_set_active(list, !active);
+}