From aa7214450e29ded03730f564ab5a2369a60f0dcb Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Thu, 20 Nov 2014 15:40:51 +0100 Subject: Hide empty input settings to remove extra padding when there is no port switch --- mate-volume-control/gvc-mixer-dialog.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mate-volume-control/gvc-mixer-dialog.c b/mate-volume-control/gvc-mixer-dialog.c index 8f39f25..db20e8e 100644 --- a/mate-volume-control/gvc-mixer-dialog.c +++ b/mate-volume-control/gvc-mixer-dialog.c @@ -563,8 +563,10 @@ update_input_settings (GvcMixerDialog *dialog) /* Get the control currently associated with the input slider */ control = gvc_channel_bar_get_control (GVC_CHANNEL_BAR (dialog->priv->input_bar)); - if (control == NULL) + if (control == NULL) { + gtk_widget_hide (dialog->priv->input_settings_box); return; + } flags = mate_mixer_stream_control_get_flags (control); @@ -577,8 +579,10 @@ update_input_settings (GvcMixerDialog *dialog) /* Get owning stream of the control */ stream = mate_mixer_stream_control_get_stream (control); - if (G_UNLIKELY (stream == NULL)) + if (G_UNLIKELY (stream == NULL)) { + gtk_widget_hide (dialog->priv->input_settings_box); return; + } /* Enable the port selector if the stream has one */ port_switch = find_stream_port_switch (stream); @@ -599,8 +603,10 @@ update_input_settings (GvcMixerDialog *dialog) G_CALLBACK (on_port_switch_active_option_notify), dialog->priv->input_treeview); + gtk_widget_show (dialog->priv->input_settings_box); gtk_widget_show (dialog->priv->input_port_combo); - } + } else + gtk_widget_hide (dialog->priv->input_settings_box); } static void -- cgit v1.2.1