summaryrefslogtreecommitdiff
path: root/mate-volume-control/src
diff options
context:
space:
mode:
Diffstat (limited to 'mate-volume-control/src')
-rw-r--r--mate-volume-control/src/gvc-channel-bar.c1
-rw-r--r--mate-volume-control/src/gvc-mixer-dialog.c19
2 files changed, 19 insertions, 1 deletions
diff --git a/mate-volume-control/src/gvc-channel-bar.c b/mate-volume-control/src/gvc-channel-bar.c
index 3d21119..04f41e7 100644
--- a/mate-volume-control/src/gvc-channel-bar.c
+++ b/mate-volume-control/src/gvc-channel-bar.c
@@ -614,6 +614,7 @@ gvc_channel_bar_set_is_amplified (GvcChannelBar *bar, gboolean amplified)
GTK_POS_BOTTOM, str);
/* Only show 100% if it's higher than the base volume */
if (bar->priv->base_volume < ADJUSTMENT_MAX_NORMAL) {
+ g_free (str);
str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));
gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), ADJUSTMENT_MAX_NORMAL,
GTK_POS_BOTTOM, str);
diff --git a/mate-volume-control/src/gvc-mixer-dialog.c b/mate-volume-control/src/gvc-mixer-dialog.c
index 8db0ebf..0e155e3 100644
--- a/mate-volume-control/src/gvc-mixer-dialog.c
+++ b/mate-volume-control/src/gvc-mixer-dialog.c
@@ -1552,6 +1552,9 @@ on_card_selection_changed (GtkTreeSelection *selection,
GtkTreeModel *model;
GtkTreeIter iter;
const GList *profiles;
+ GSList *sinks;
+ gint card_index;
+ gboolean has_sink = FALSE;
guint id;
GvcMixerCard *card;
GvcMixerCardProfile *current_profile;
@@ -1590,9 +1593,23 @@ on_card_selection_changed (GtkTreeSelection *selection,
gtk_box_pack_start (GTK_BOX (dialog->priv->hw_settings_box),
dialog->priv->hw_profile_combo,
TRUE, TRUE, 6);
+
+ sinks = gvc_mixer_control_get_sinks (dialog->priv->mixer_control);
+ card_index = gvc_mixer_card_get_index (card);
+ while (sinks != NULL) {
+ GvcMixerStream *s = sinks->data;
+
+ if (gvc_mixer_stream_get_card_index (s) == card_index) {
+ has_sink = TRUE;
+ break;
+ }
+ sinks = sinks->next;
+ }
+
g_object_set (G_OBJECT (dialog->priv->hw_profile_combo),
- "show-button", current_profile->n_sinks == 1,
+ "show-button", has_sink,
NULL);
+
gtk_widget_show (dialog->priv->hw_profile_combo);
g_object_set_data (G_OBJECT (dialog->priv->hw_profile_combo), "card", card);