diff options
author | John Stebbins <[email protected]> | 2018-04-19 12:16:18 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2018-04-19 12:16:18 -0700 |
commit | 3932f559303edd80fb7be32ac0b6b128b2137458 (patch) | |
tree | 8002cc01fbaadd5c99dd75a9703c162192cd17ed /gtk/src/audiohandler.c | |
parent | 2967fbd87cecaccdc6ddfe7b2995c2a652fc4dff (diff) |
LinGui: start adding Gtk4 support
Gtk4 drops support for a number of widget properties and APIs.
Fortunately these were all pretty much duplicate functionality that
could be replaced by other existing properties and APIs.
Building with Gtk4 is currently disabled due to several bugs in libgtk4.
Diffstat (limited to 'gtk/src/audiohandler.c')
-rw-r--r-- | gtk/src/audiohandler.c | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index d21ff28d7..d4994463f 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -1716,7 +1716,6 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) GtkLabel *label; GtkRadioButton *radio; GtkButton *button; - GtkImage *image; box = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); @@ -1729,10 +1728,12 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(button), "add_button"); gtk_widget_hide(GTK_WIDGET(button)); g_signal_connect(button, "clicked", (GCallback)audio_def_setting_add_cb, ud); - gtk_box_pack_start(box, GTK_WIDGET(button), FALSE, FALSE, 0); + ghb_box_pack_start(box, GTK_WIDGET(button)); // Hidden widgets box box2 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); + gtk_widget_set_hexpand(GTK_WIDGET(box2), TRUE); + gtk_widget_set_halign(GTK_WIDGET(box2), GTK_ALIGN_FILL); gtk_widget_set_name(GTK_WIDGET(box2), "settings_box"); // Audio Encoder ComboBox @@ -1748,7 +1749,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(combo), "AudioEncoder"); gtk_widget_show(GTK_WIDGET(combo)); g_signal_connect(combo, "changed", (GCallback)audio_def_encoder_changed_cb, ud); - gtk_box_pack_start(box2, GTK_WIDGET(combo), FALSE, FALSE, 0); + ghb_box_pack_start(box2, GTK_WIDGET(combo)); box3 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); gtk_widget_set_name(GTK_WIDGET(box3), "br_q_box"); @@ -1760,15 +1761,15 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) radio = GTK_RADIO_BUTTON(gtk_radio_button_new_with_label(NULL, _("Bitrate"))); gtk_widget_set_name(GTK_WIDGET(radio), "AudioTrackBitrateEnable"); gtk_widget_show(GTK_WIDGET(radio)); - gtk_box_pack_start(vbox, GTK_WIDGET(radio), FALSE, FALSE, 0); + ghb_box_pack_start(vbox, GTK_WIDGET(radio)); radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label_from_widget(radio, _("Quality"))); gtk_widget_set_name(GTK_WIDGET(radio), "AudioTrackQualityEnable"); g_signal_connect(radio, "toggled", (GCallback)audio_def_quality_enable_changed_cb, ud); gtk_widget_show(GTK_WIDGET(radio)); - gtk_box_pack_start(vbox, GTK_WIDGET(radio), FALSE, FALSE, 0); + ghb_box_pack_start(vbox, GTK_WIDGET(radio)); gtk_widget_show(GTK_WIDGET(vbox)); - gtk_box_pack_start(box3, GTK_WIDGET(vbox), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(vbox)); // Audio Bitrate ComboBox combo = GTK_COMBO_BOX(gtk_combo_box_new()); @@ -1781,7 +1782,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(combo), "AudioBitrate"); gtk_widget_show(GTK_WIDGET(combo)); g_signal_connect(combo, "changed", (GCallback)audio_def_encode_setting_changed_cb, ud); - gtk_box_pack_start(box3, GTK_WIDGET(combo), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(combo)); GtkBox *qbox; qbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); @@ -1809,7 +1810,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(scale), "AudioTrackQualityX"); gtk_widget_show(GTK_WIDGET(scale)); g_signal_connect(scale, "value-changed", (GCallback)audio_def_quality_changed_cb, ud); - gtk_box_pack_start(qbox, GTK_WIDGET(scale), FALSE, FALSE, 0); + ghb_box_pack_start(qbox, GTK_WIDGET(scale)); // Audio Quality Label label = GTK_LABEL(gtk_label_new("0.00")); @@ -1818,10 +1819,10 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackQualityValue"); gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(qbox, GTK_WIDGET(label), FALSE, FALSE, 0); + ghb_box_pack_start(qbox, GTK_WIDGET(label)); gtk_widget_hide(GTK_WIDGET(qbox)); - gtk_box_pack_start(box3, GTK_WIDGET(qbox), FALSE, FALSE, 0); - gtk_box_pack_start(box2, GTK_WIDGET(box3), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(qbox)); + ghb_box_pack_start(box2, GTK_WIDGET(box3)); // Audio Mix ComboBox combo = GTK_COMBO_BOX(gtk_combo_box_new()); @@ -1834,7 +1835,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(combo), "AudioMixdown"); gtk_widget_show(GTK_WIDGET(combo)); g_signal_connect(combo, "changed", (GCallback)audio_def_encode_setting_changed_cb, ud); - gtk_box_pack_start(box2, GTK_WIDGET(combo), FALSE, FALSE, 0); + ghb_box_pack_start(box2, GTK_WIDGET(combo)); // Audio Sample Rate ComboBox combo = GTK_COMBO_BOX(gtk_combo_box_new()); @@ -1847,7 +1848,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(combo), "AudioSamplerate"); gtk_widget_show(GTK_WIDGET(combo)); g_signal_connect(combo, "changed", (GCallback)audio_def_encode_setting_changed_cb, ud); - gtk_box_pack_start(box2, GTK_WIDGET(combo), FALSE, FALSE, 0); + ghb_box_pack_start(box2, GTK_WIDGET(combo)); box3 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); gtk_widget_set_name(GTK_WIDGET(box3), "gain_box"); @@ -1871,7 +1872,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(scale), "AudioTrackGainSlider"); gtk_widget_show(GTK_WIDGET(scale)); g_signal_connect(scale, "value-changed", (GCallback)audio_def_gain_changed_cb, ud); - gtk_box_pack_start(box3, GTK_WIDGET(scale), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(scale)); // Audio Gain Label label = GTK_LABEL(gtk_label_new(_("0dB"))); @@ -1880,8 +1881,8 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackGainValue"); gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(box3, GTK_WIDGET(label), FALSE, FALSE, 0); - gtk_box_pack_start(box2, GTK_WIDGET(box3), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(label)); + ghb_box_pack_start(box2, GTK_WIDGET(box3)); box3 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); gtk_widget_set_name(GTK_WIDGET(box3), "drc_box"); @@ -1906,7 +1907,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(scale), "AudioTrackDRCSlider"); gtk_widget_show(GTK_WIDGET(scale)); g_signal_connect(scale, "value-changed", (GCallback)audio_def_drc_changed_cb, ud); - gtk_box_pack_start(box3, GTK_WIDGET(scale), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(scale)); // Audio DRC Label label = GTK_LABEL(gtk_label_new(_("Off"))); @@ -1915,14 +1916,14 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER); gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackDRCValue"); gtk_widget_show(GTK_WIDGET(label)); - gtk_box_pack_start(box3, GTK_WIDGET(label), FALSE, FALSE, 0); - gtk_box_pack_start(box2, GTK_WIDGET(box3), FALSE, FALSE, 0); + ghb_box_pack_start(box3, GTK_WIDGET(label)); + ghb_box_pack_start(box2, GTK_WIDGET(box3)); // Remove button - image = GTK_IMAGE(gtk_image_new_from_icon_name("hb-remove", - GTK_ICON_SIZE_BUTTON)); button = GTK_BUTTON(gtk_button_new()); - gtk_button_set_image(button, GTK_WIDGET(image)); + gtk_widget_set_hexpand(GTK_WIDGET(button), TRUE); + gtk_widget_set_halign(GTK_WIDGET(button), GTK_ALIGN_FILL); + ghb_button_set_icon_name(button, "hb-remove"); gtk_widget_set_tooltip_markup(GTK_WIDGET(button), _("Remove this audio encoder")); gtk_button_set_relief(button, GTK_RELIEF_NONE); @@ -1931,10 +1932,10 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) gtk_widget_set_name(GTK_WIDGET(button), "remove_button"); gtk_widget_show(GTK_WIDGET(button)); g_signal_connect(button, "clicked", (GCallback)audio_def_setting_remove_cb, ud); - gtk_box_pack_start(box2, GTK_WIDGET(button), TRUE, TRUE, 0); + ghb_box_pack_start(box2, GTK_WIDGET(button)); gtk_widget_show(GTK_WIDGET(box2)); - gtk_box_pack_start(box, GTK_WIDGET(box2), TRUE, TRUE, 0); + ghb_box_pack_start(box, GTK_WIDGET(box2)); gtk_widget_show(GTK_WIDGET(box)); @@ -1942,28 +1943,28 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud) int width; widget = find_widget(GTK_WIDGET(box), "AudioEncoder"); - gtk_widget_get_preferred_width(widget, NULL, &width); + ghb_widget_get_preferred_width(widget, NULL, &width); widget = GHB_WIDGET(ud->builder, "audio_defaults_encoder_label"); gtk_widget_set_size_request(widget, width, -1); widget = find_widget(GTK_WIDGET(box), "br_q_box"); - gtk_widget_get_preferred_width(widget, NULL, &width); + ghb_widget_get_preferred_width(widget, NULL, &width); widget = GHB_WIDGET(ud->builder, "audio_defaults_bitrate_label"); gtk_widget_set_size_request(widget, width, -1); widget = find_widget(GTK_WIDGET(box), "AudioMixdown"); - gtk_widget_get_preferred_width(widget, NULL, &width); + ghb_widget_get_preferred_width(widget, NULL, &width); widget = GHB_WIDGET(ud->builder, "audio_defaults_mixdown_label"); gtk_widget_set_size_request(widget, width, -1); widget = find_widget(GTK_WIDGET(box), "AudioSamplerate"); - gtk_widget_get_preferred_width(widget, NULL, &width); + ghb_widget_get_preferred_width(widget, NULL, &width); widget = GHB_WIDGET(ud->builder, "audio_defaults_samplerate_label"); gtk_widget_set_size_request(widget, width, -1); widget = find_widget(GTK_WIDGET(box), "gain_box"); - gtk_widget_get_preferred_width(widget, NULL, &width); + ghb_widget_get_preferred_width(widget, NULL, &width); widget = GHB_WIDGET(ud->builder, "audio_defaults_gain_label"); gtk_widget_set_size_request(widget, width, -1); widget = find_widget(GTK_WIDGET(box), "drc_box"); - gtk_widget_get_preferred_width(widget, NULL, &width); + ghb_widget_get_preferred_width(widget, NULL, &width); widget = GHB_WIDGET(ud->builder, "audio_defaults_drc_label"); gtk_widget_set_size_request(widget, width, -1); |