Merge lp:~larsu/unity-control-center/sound-panel-ui-cleanup into lp:unity-control-center

Proposed by Lars Karlitski
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 12708
Merged at revision: 12721
Proposed branch: lp:~larsu/unity-control-center/sound-panel-ui-cleanup
Merge into: lp:unity-control-center
Diff against target: 419 lines (+118/-64)
6 files modified
configure.ac (+1/-1)
debian/control (+3/-2)
panels/sound/gvc-channel-bar.c (+43/-25)
panels/sound/gvc-channel-bar.h (+3/-0)
panels/sound/gvc-combo-box.c (+1/-1)
panels/sound/gvc-mixer-dialog.c (+67/-35)
To merge this branch: bzr merge lp:~larsu/unity-control-center/sound-panel-ui-cleanup
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+207494@code.launchpad.net

Commit message

sound: various UI tweaks

Most importantly, add a "allow louder than 100%" checkbox (feeding from a key in com.canonical.indicator.sound) that controls whether output volume can be amplified.

Description of the change

sound: various UI tweaks

Most importantly, add a "allow louder than 100%" checkbox (feeding from a key in com.canonical.indicator.sound) that controls whether output volume can be amplified.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, looks good to me! Could you change debian/control to update the libgtk-3-dev build depends to 3.10, to match configure?

review: Needs Fixing
12707. By Lars Karlitski

Bump gtk build dependency to match configure

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:12706
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~larsu/unity-control-center/sound-panel-ui-cleanup/+merge/207494/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-control-center-ci/31/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-control-center-trusty-amd64-ci/31
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-control-center-trusty-armhf-ci/31
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-control-center-trusty-i386-ci/32

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity-control-center-ci/31/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

could you rebase/pre-require https://code.launchpad.net/~laney/unity-control-center/schemas-depends-not-build-depends/+merge/207512 ? that one is a previous landing and is likely going to conflict with your control change

12708. By Lars Karlitski

Merge lp:~laney/unity-control-center/schemas-depends-not-build-depends

[ Eleni Maria Stea ]
* Add a slider that can change the fonts-scale-factor gsetting (per
  monitor text scaling factor)
[ Robert Ancell ]
* Fix various compile warnings.
* Stop using deprecated GtkStock.
* Stop using deprecated GdkColor.
* Use appropriate GSettings API for checking existence of schemas.
* Backport Wacom panel from GNOME Control Center 3.8
* Add option to toggle username in session indicator (LP: #1116497)
[ Sebastian Bacher ]
* debian/control.in:
  - Build-Depends on dh-migrations
* debian/unity-control-center.migrations, debian/ucc-unity-launcher.py:
  - script to migration the g-c-c Unity's launcher entry to u-c-c
* debian/rules:
  - clean some leftover references to g-c-c
  - use dh_migrations.
* Merge in datetime panel from indicator-datetime
* Backport commit to fix notebook spacing issues.
* Let the launcher icons be scaled down to 16. (LP: #1168409).
* keyboard: wrap information label in the shortcuts panel. (LP: #1276119).
* debian/control:
  - Run with either gnome-settings-daemon or unity-settings-daemon
    (LP: #1277487)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2014-02-19 02:24:52 +0000
+++ configure.ac 2014-02-20 18:08:31 +0000
@@ -102,7 +102,7 @@
102dnl ==============================================102dnl ==============================================
103103
104GLIB_REQUIRED_VERSION=2.31.2104GLIB_REQUIRED_VERSION=2.31.2
105GTK_REQUIRED_VERSION=3.5.13105GTK_REQUIRED_VERSION=3.10.0
106PA_REQUIRED_VERSION=2.0106PA_REQUIRED_VERSION=2.0
107CANBERRA_REQUIRED_VERSION=0.13107CANBERRA_REQUIRED_VERSION=0.13
108GDKPIXBUF_REQUIRED_VERSION=2.23.0108GDKPIXBUF_REQUIRED_VERSION=2.23.0
109109
=== modified file 'debian/control'
--- debian/control 2014-02-20 10:43:41 +0000
+++ debian/control 2014-02-20 18:08:31 +0000
@@ -13,7 +13,6 @@
13 gnome-pkg-tools (>= 0.10),13 gnome-pkg-tools (>= 0.10),
14 gnome-settings-daemon-dev (>= 3.8.4),14 gnome-settings-daemon-dev (>= 3.8.4),
15 gsettings-desktop-schemas-dev (>= 3.7.2.2),15 gsettings-desktop-schemas-dev (>= 3.7.2.2),
16 gsettings-ubuntu-schemas (>= 0.0.1+14.04.20140219),
17 hardening-wrapper,16 hardening-wrapper,
18 intltool (>= 0.37.1),17 intltool (>= 0.37.1),
19 libcanberra-gtk3-dev,18 libcanberra-gtk3-dev,
@@ -30,7 +29,7 @@
30 libgnomekbd-dev,29 libgnomekbd-dev,
31 libgoa-1.0-dev (>= 3.5.90),30 libgoa-1.0-dev (>= 3.5.90),
32 libgstreamer-plugins-base0.10-dev,31 libgstreamer-plugins-base0.10-dev,
33 libgtk-3-dev (>= 3.5.13),32 libgtk-3-dev (>= 3.10.0),
34 libgtop2-dev,33 libgtop2-dev,
35 libibus-1.0-dev (>= 1.5.0),34 libibus-1.0-dev (>= 1.5.0),
36 libnm-glib-dev (>= 0.9) [linux-any],35 libnm-glib-dev (>= 0.9) [linux-any],
@@ -71,6 +70,8 @@
71 gnome-menus (>= 2.12.0),70 gnome-menus (>= 2.12.0),
72 gnome-settings-daemon (>= 3.8.4) | unity-settings-daemon,71 gnome-settings-daemon (>= 3.8.4) | unity-settings-daemon,
73 gsettings-desktop-schemas (>= 3.5.91),72 gsettings-desktop-schemas (>= 3.5.91),
73 gsettings-ubuntu-schemas (>= 0.0.1+14.04.20140219),
74 indicator-sound (>= 12.10.2+14.04.20140220),
74Recommends: cups-pk-helper,75Recommends: cups-pk-helper,
75 gnome-session-bin,76 gnome-session-bin,
76 ubuntu-system-service,77 ubuntu-system-service,
7778
=== modified file 'panels/sound/gvc-channel-bar.c'
--- panels/sound/gvc-channel-bar.c 2014-02-18 04:27:04 +0000
+++ panels/sound/gvc-channel-bar.c 2014-02-20 18:08:31 +0000
@@ -54,7 +54,7 @@
54 GtkWidget *scale;54 GtkWidget *scale;
55 GtkWidget *high_image;55 GtkWidget *high_image;
56 GtkWidget *mute_box;56 GtkWidget *mute_box;
57 GtkWidget *mute_switch;57 GtkWidget *mute_check;
58 GtkAdjustment *adjustment;58 GtkAdjustment *adjustment;
59 GtkAdjustment *zero_adjustment;59 GtkAdjustment *zero_adjustment;
60 gboolean show_mute;60 gboolean show_mute;
@@ -68,6 +68,7 @@
68 gboolean click_lock;68 gboolean click_lock;
69 gboolean is_amplified;69 gboolean is_amplified;
70 guint32 base_volume;70 guint32 base_volume;
71 GtkPositionType mark_position;
71};72};
7273
73enum74enum
@@ -522,14 +523,14 @@
522}523}
523524
524static void525static void
525update_mute_switch (GvcChannelBar *bar)526update_mute (GvcChannelBar *bar)
526{527{
527 if (bar->priv->show_mute) {528 if (bar->priv->show_mute) {
528 gtk_widget_show (bar->priv->mute_switch);529 gtk_widget_show (bar->priv->mute_check);
529 gtk_switch_set_active (GTK_SWITCH (bar->priv->mute_switch),530 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bar->priv->mute_check),
530 !bar->priv->is_muted);531 bar->priv->is_muted);
531 } else {532 } else {
532 gtk_widget_hide (bar->priv->mute_switch);533 gtk_widget_hide (bar->priv->mute_check);
533 }534 }
534535
535 if (bar->priv->is_muted) {536 if (bar->priv->is_muted) {
@@ -564,7 +565,7 @@
564 /* Update our internal state before telling the565 /* Update our internal state before telling the
565 * front-end about our changes */566 * front-end about our changes */
566 bar->priv->is_muted = is_muted;567 bar->priv->is_muted = is_muted;
567 update_mute_switch (bar);568 update_mute (bar);
568 g_object_notify (G_OBJECT (bar), "is-muted");569 g_object_notify (G_OBJECT (bar), "is-muted");
569 }570 }
570}571}
@@ -585,7 +586,7 @@
585 if (show_mute != bar->priv->show_mute) {586 if (show_mute != bar->priv->show_mute) {
586 bar->priv->show_mute = show_mute;587 bar->priv->show_mute = show_mute;
587 g_object_notify (G_OBJECT (bar), "show-mute");588 g_object_notify (G_OBJECT (bar), "show-mute");
588 update_mute_switch (bar);589 update_mute (bar);
589 }590 }
590}591}
591592
@@ -612,24 +613,30 @@
612 if (bar->priv->base_volume == ADJUSTMENT_MAX_NORMAL) {613 if (bar->priv->base_volume == ADJUSTMENT_MAX_NORMAL) {
613 str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));614 str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));
614 gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), ADJUSTMENT_MAX_NORMAL,615 gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), ADJUSTMENT_MAX_NORMAL,
615 GTK_POS_BOTTOM, str);616 bar->priv->mark_position, str);
616 } else {617 } else {
617 str = g_strdup_printf ("<small>%s</small>", C_("volume", "Unamplified"));618 str = g_strdup_printf ("<small>%s</small>", C_("volume", "Unamplified"));
618 gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), bar->priv->base_volume,619 gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), bar->priv->base_volume,
619 GTK_POS_BOTTOM, str);620 bar->priv->mark_position, str);
620 /* Only show 100% if it's higher than the base volume */621 /* Only show 100% if it's higher than the base volume */
621 if (bar->priv->base_volume < ADJUSTMENT_MAX_NORMAL) {622 if (bar->priv->base_volume < ADJUSTMENT_MAX_NORMAL) {
622 str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));623 str = g_strdup_printf ("<small>%s</small>", C_("volume", "100%"));
623 gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), ADJUSTMENT_MAX_NORMAL,624 gtk_scale_add_mark (GTK_SCALE (bar->priv->scale), ADJUSTMENT_MAX_NORMAL,
624 GTK_POS_BOTTOM, str);625 bar->priv->mark_position, str);
625 }626 }
626 }627 }
627628
628 g_free (str);629 g_free (str);
629 gtk_alignment_set (GTK_ALIGNMENT (bar->priv->mute_box), 0.5, 0, 0, 0);630 gtk_alignment_set (GTK_ALIGNMENT (bar->priv->mute_box), 0.5, 0, 0, 0);
630 gtk_misc_set_alignment (GTK_MISC (bar->priv->low_image), 0.5, 0.15);
631 gtk_misc_set_alignment (GTK_MISC (bar->priv->high_image), 0.5, 0.15);
632 gtk_misc_set_alignment (GTK_MISC (bar->priv->label), 0, 0);631 gtk_misc_set_alignment (GTK_MISC (bar->priv->label), 0, 0);
632 if (bar->priv->mark_position == GTK_POS_TOP) {
633 gtk_misc_set_alignment (GTK_MISC (bar->priv->low_image), 0.5, 1.0);
634 gtk_misc_set_alignment (GTK_MISC (bar->priv->high_image), 0.5, 1.0);
635 }
636 else {
637 gtk_misc_set_alignment (GTK_MISC (bar->priv->low_image), 0.5, 0.0);
638 gtk_misc_set_alignment (GTK_MISC (bar->priv->high_image), 0.5, 0.0);
639 }
633 } else {640 } else {
634 gtk_alignment_set (GTK_ALIGNMENT (bar->priv->mute_box), 0.5, 0.5, 0, 0);641 gtk_alignment_set (GTK_ALIGNMENT (bar->priv->mute_box), 0.5, 0.5, 0, 0);
635 gtk_misc_set_alignment (GTK_MISC (bar->priv->low_image), 0.5, 0.5);642 gtk_misc_set_alignment (GTK_MISC (bar->priv->low_image), 0.5, 0.5);
@@ -776,7 +783,7 @@
776783
777 self = GVC_CHANNEL_BAR (object);784 self = GVC_CHANNEL_BAR (object);
778785
779 update_mute_switch (self);786 update_mute (self);
780787
781 return object;788 return object;
782}789}
@@ -867,13 +874,15 @@
867}874}
868875
869static void876static void
870on_mute_switch_toggled (GtkSwitch *sw,877on_mute_check_toggled (GObject *object,
871 GParamSpec *pspec,878 GParamSpec *pspec,
872 GvcChannelBar *bar)879 gpointer user_data)
873{880{
874 gboolean is_muted;881 GvcChannelBar *bar = user_data;
875 is_muted = gtk_switch_get_active (sw);882 gboolean is_muted;
876 gvc_channel_bar_set_is_muted (bar, !is_muted);883
884 is_muted = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (object));
885 gvc_channel_bar_set_is_muted (bar, is_muted);
877}886}
878887
879static void888static void
@@ -886,6 +895,7 @@
886 bar->priv->base_volume = ADJUSTMENT_MAX_NORMAL;895 bar->priv->base_volume = ADJUSTMENT_MAX_NORMAL;
887 bar->priv->low_icon_name = g_strdup ("audio-volume-low-symbolic");896 bar->priv->low_icon_name = g_strdup ("audio-volume-low-symbolic");
888 bar->priv->high_icon_name = g_strdup ("audio-volume-high-symbolic");897 bar->priv->high_icon_name = g_strdup ("audio-volume-high-symbolic");
898 bar->priv->mark_position = GTK_POS_BOTTOM;
889899
890 bar->priv->orientation = GTK_ORIENTATION_VERTICAL;900 bar->priv->orientation = GTK_ORIENTATION_VERTICAL;
891 bar->priv->adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0,901 bar->priv->adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0,
@@ -909,14 +919,14 @@
909 G_CALLBACK (on_zero_adjustment_value_changed),919 G_CALLBACK (on_zero_adjustment_value_changed),
910 bar);920 bar);
911921
912 bar->priv->mute_switch = gtk_switch_new ();922 bar->priv->mute_check = gtk_check_button_new_with_label (_("Mute"));
913 gtk_widget_set_no_show_all (bar->priv->mute_switch, TRUE);923 gtk_widget_set_no_show_all (bar->priv->mute_check, TRUE);
914 g_signal_connect (bar->priv->mute_switch,924 g_signal_connect (bar->priv->mute_check,
915 "notify::active",925 "notify::active",
916 G_CALLBACK (on_mute_switch_toggled),926 G_CALLBACK (on_mute_check_toggled),
917 bar);927 bar);
918 bar->priv->mute_box = gtk_alignment_new (0.5, 0.5, 0, 0);928 bar->priv->mute_box = gtk_alignment_new (0.5, 0.5, 0, 0);
919 gtk_container_add (GTK_CONTAINER (bar->priv->mute_box), bar->priv->mute_switch);929 gtk_container_add (GTK_CONTAINER (bar->priv->mute_box), bar->priv->mute_check);
920930
921 bar->priv->low_image = gtk_image_new_from_icon_name ("audio-volume-low-symbolic",931 bar->priv->low_image = gtk_image_new_from_icon_name ("audio-volume-low-symbolic",
922 GTK_ICON_SIZE_MENU);932 GTK_ICON_SIZE_MENU);
@@ -973,3 +983,11 @@
973 NULL);983 NULL);
974 return GTK_WIDGET (bar);984 return GTK_WIDGET (bar);
975}985}
986
987void
988gvc_channel_bar_set_mark_position (GvcChannelBar *bar,
989 GtkPositionType position)
990{
991 bar->priv->mark_position = position;
992 gvc_channel_bar_set_is_amplified (bar, bar->priv->is_amplified);
993}
976994
=== modified file 'panels/sound/gvc-channel-bar.h'
--- panels/sound/gvc-channel-bar.h 2012-06-25 12:41:31 +0000
+++ panels/sound/gvc-channel-bar.h 2014-02-20 18:08:31 +0000
@@ -84,6 +84,9 @@
84gboolean gvc_channel_bar_scroll (GvcChannelBar *bar,84gboolean gvc_channel_bar_scroll (GvcChannelBar *bar,
85 GdkEventScroll *event);85 GdkEventScroll *event);
8686
87void gvc_channel_bar_set_mark_position (GvcChannelBar *bar,
88 GtkPositionType position);
89
87G_END_DECLS90G_END_DECLS
8891
89#endif /* __GVC_CHANNEL_BAR_H */92#endif /* __GVC_CHANNEL_BAR_H */
9093
=== modified file 'panels/sound/gvc-combo-box.c'
--- panels/sound/gvc-combo-box.c 2014-02-18 04:27:04 +0000
+++ panels/sound/gvc-combo-box.c 2014-02-20 18:08:31 +0000
@@ -346,7 +346,7 @@
346346
347347
348 combo_box->priv->end_box = ebox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);348 combo_box->priv->end_box = ebox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
349 gtk_box_pack_start (GTK_BOX (box), ebox, FALSE, FALSE, 0);349 gtk_box_pack_start (GTK_BOX (box), ebox, TRUE, FALSE, 0);
350350
351 if (combo_box->priv->size_group != NULL) {351 if (combo_box->priv->size_group != NULL) {
352 gtk_size_group_add_widget (combo_box->priv->size_group, sbox);352 gtk_size_group_add_widget (combo_box->priv->size_group, sbox);
353353
=== modified file 'panels/sound/gvc-mixer-dialog.c'
--- panels/sound/gvc-mixer-dialog.c 2014-02-18 22:42:43 +0000
+++ panels/sound/gvc-mixer-dialog.c 2014-02-20 18:08:31 +0000
@@ -904,8 +904,6 @@
904 bar_set_stream (dialog, dialog->priv->output_bar, stream);904 bar_set_stream (dialog, dialog->priv->output_bar, stream);
905 gvc_channel_bar_set_base_volume (GVC_CHANNEL_BAR (dialog->priv->output_bar),905 gvc_channel_bar_set_base_volume (GVC_CHANNEL_BAR (dialog->priv->output_bar),
906 gvc_mixer_stream_get_base_volume (stream));906 gvc_mixer_stream_get_base_volume (stream));
907 gvc_channel_bar_set_is_amplified (GVC_CHANNEL_BAR (dialog->priv->output_bar),
908 gvc_mixer_stream_get_can_decibel (stream));
909 /* Update the adjustment in case the previous bar wasn't decibel907 /* Update the adjustment in case the previous bar wasn't decibel
910 * capable, and we clipped it */908 * capable, and we clipped it */
911 adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (dialog->priv->output_bar)));909 adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (dialog->priv->output_bar)));
@@ -962,7 +960,7 @@
962960
963 if (dialog->priv->size_group != NULL) {961 if (dialog->priv->size_group != NULL) {
964 gvc_combo_box_set_size_group (GVC_COMBO_BOX (dialog->priv->output_profile_combo),962 gvc_combo_box_set_size_group (GVC_COMBO_BOX (dialog->priv->output_profile_combo),
965 dialog->priv->size_group, FALSE);963 dialog->priv->size_group, TRUE);
966 }964 }
967965
968 active_profile = gvc_mixer_ui_device_get_active_profile (active_output);966 active_profile = gvc_mixer_ui_device_get_active_profile (active_output);
@@ -1718,6 +1716,20 @@
1718 gtk_widget_destroy (d);1716 gtk_widget_destroy (d);
1719}1717}
17201718
1719static void
1720allow_amplify_check_changed (GObject *object,
1721 GParamSpec *pspec,
1722 gpointer user_data)
1723{
1724 const gchar *label;
1725 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (object)))
1726 label = (_("Allow louder than 100% (may distort sound)"));
1727 else
1728 label = (_("Allow louder than 100%"));
1729
1730 gtk_button_set_label (GTK_BUTTON (object), label);
1731}
1732
1721static GObject *1733static GObject *
1722gvc_mixer_dialog_constructor (GType type,1734gvc_mixer_dialog_constructor (GType type,
1723 guint n_construct_properties,1735 guint n_construct_properties,
@@ -1740,6 +1752,8 @@
1740 GvcMixerStream *stream;1752 GvcMixerStream *stream;
1741 GvcMixerCard *card;1753 GvcMixerCard *card;
1742 GtkTreeSelection *selection;1754 GtkTreeSelection *selection;
1755 GtkWidget *mute_check;
1756 GtkWidget *allow_amplify_check;
17431757
1744 object = G_OBJECT_CLASS (gvc_mixer_dialog_parent_class)->constructor (type, n_construct_properties, construct_params);1758 object = G_OBJECT_CLASS (gvc_mixer_dialog_parent_class)->constructor (type, n_construct_properties, construct_params);
17451759
@@ -1750,13 +1764,51 @@
17501764
1751 gtk_container_set_border_width (GTK_CONTAINER (self), 3);1765 gtk_container_set_border_width (GTK_CONTAINER (self), 3);
17521766
1753 self->priv->output_stream_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);1767 // Output volume
1754 alignment = gtk_alignment_new (0, 0, 1, 1);1768 self->priv->output_bar = create_bar (self, FALSE, TRUE);
1755 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 0, 0);1769 gvc_channel_bar_set_show_mute (GVC_CHANNEL_BAR (self->priv->output_bar), FALSE);
1756 gtk_container_add (GTK_CONTAINER (alignment), self->priv->output_stream_box);1770 gvc_channel_bar_set_mark_position (GVC_CHANNEL_BAR (self->priv->output_bar), GTK_POS_TOP);
1771 gtk_widget_set_sensitive (self->priv->output_bar, FALSE);
1772 gtk_widget_set_valign (self->priv->output_bar, GTK_ALIGN_END);
1773 gtk_widget_set_size_request (self->priv->output_bar, 400, -1);
1774 g_settings_bind (self->priv->indicator_settings, "allow-amplified-volume",
1775 self->priv->output_bar, "is-amplified", G_SETTINGS_BIND_DEFAULT);
1776
1777 label = gtk_label_new_with_mnemonic (_("_Output volume:"));
1778 gtk_widget_set_valign (label, GTK_ALIGN_END);
1779 gtk_widget_set_margin_top (label, 30);
1780
1781 mute_check = gtk_check_button_new_with_label (_("Mute"));
1782 gtk_widget_set_halign (mute_check, GTK_ALIGN_START);
1783 g_object_bind_property (mute_check, "active", self->priv->output_bar, "is-muted",
1784 G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
1785
1786 /* TRANSLATORS: This label is used in a checkbox close to volume
1787 * slider. Please keep it brief. */
1788 allow_amplify_check = gtk_check_button_new_with_label (_("Allow louder than 100%"));
1789 gtk_widget_set_halign (allow_amplify_check, GTK_ALIGN_START);
1790 gtk_widget_set_hexpand (allow_amplify_check, TRUE);
1791 g_signal_connect (allow_amplify_check, "notify::active",
1792 G_CALLBACK (allow_amplify_check_changed), NULL);
1793 g_settings_bind (self->priv->indicator_settings, "allow-amplified-volume",
1794 allow_amplify_check, "active", G_SETTINGS_BIND_DEFAULT);
1795
1796 self->priv->output_stream_box = gtk_grid_new ();
1797 gtk_widget_set_halign (self->priv->output_stream_box, GTK_ALIGN_CENTER);
1798 gtk_grid_set_column_spacing (GTK_GRID (self->priv->output_stream_box), 6);
1799 gtk_grid_set_row_spacing (GTK_GRID (self->priv->output_stream_box), 6);
1800 gtk_grid_attach (GTK_GRID (self->priv->output_stream_box),
1801 label, 0, 0, 1, 1);
1802 gtk_grid_attach (GTK_GRID (self->priv->output_stream_box),
1803 self->priv->output_bar, 1, 0, 2, 1);
1804 gtk_grid_attach (GTK_GRID (self->priv->output_stream_box),
1805 mute_check, 1, 1, 1, 1);
1806 gtk_grid_attach (GTK_GRID (self->priv->output_stream_box),
1807 allow_amplify_check, 2, 1, 1, 1);
1808
1757 gtk_box_pack_start (GTK_BOX (main_vbox),1809 gtk_box_pack_start (GTK_BOX (main_vbox),
1758 alignment,1810 self->priv->output_stream_box,
1759 FALSE, FALSE, 0);1811 FALSE, TRUE, 0);
17601812
1761 self->priv->notebook = gtk_notebook_new ();1813 self->priv->notebook = gtk_notebook_new ();
1762 gtk_box_pack_start (GTK_BOX (main_vbox),1814 gtk_box_pack_start (GTK_BOX (main_vbox),
@@ -1810,8 +1862,8 @@
18101862
1811 gtk_box_pack_start (GTK_BOX (self->priv->output_box),1863 gtk_box_pack_start (GTK_BOX (self->priv->output_box),
1812 settings_box,1864 settings_box,
1813 FALSE,1865 TRUE,
1814 FALSE,1866 TRUE,
1815 0);1867 0);
1816 gtk_box_pack_start (GTK_BOX (settings_box),1868 gtk_box_pack_start (GTK_BOX (settings_box),
1817 self->priv->selected_output_label,1869 self->priv->selected_output_label,
@@ -1870,10 +1922,6 @@
1870 sbox,1922 sbox,
1871 FALSE, FALSE, 0);1923 FALSE, FALSE, 0);
18721924
1873 label = gtk_label_new (_("Test:"));
1874 gtk_box_pack_start (GTK_BOX (sbox),
1875 label,
1876 FALSE, FALSE, 0);
1877 if (self->priv->size_group != NULL)1925 if (self->priv->size_group != NULL)
1878 gtk_size_group_add_widget (self->priv->size_group, sbox);1926 gtk_size_group_add_widget (self->priv->size_group, sbox);
18791927
@@ -1883,7 +1931,7 @@
1883 * Here 8 works fine, not sure why. */1931 * Here 8 works fine, not sure why. */
1884 gtk_box_pack_start (GTK_BOX (test_sound_box),1932 gtk_box_pack_start (GTK_BOX (test_sound_box),
1885 self->priv->test_output_button,1933 self->priv->test_output_button,
1886 TRUE, TRUE, 8);1934 FALSE, FALSE, 8);
18871935
1888 /* Is this needed */1936 /* Is this needed */
1889 if (self->priv->size_group != NULL)1937 if (self->priv->size_group != NULL)
@@ -1936,8 +1984,8 @@
1936 self->priv->input_settings_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);1984 self->priv->input_settings_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
1937 gtk_box_pack_start (GTK_BOX (self->priv->input_box),1985 gtk_box_pack_start (GTK_BOX (self->priv->input_box),
1938 self->priv->input_settings_box,1986 self->priv->input_settings_box,
1939 FALSE,1987 TRUE,
1940 FALSE,1988 TRUE,
1941 0);1989 0);
1942 gtk_box_pack_start (GTK_BOX (self->priv->input_settings_box),1990 gtk_box_pack_start (GTK_BOX (self->priv->input_settings_box),
1943 self->priv->selected_input_label,1991 self->priv->selected_input_label,
@@ -2030,23 +2078,6 @@
2030 self->priv->no_apps_label,2078 self->priv->no_apps_label,
2031 TRUE, TRUE, 0);2079 TRUE, TRUE, 0);
20322080
2033 self->priv->output_stream_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
2034 alignment = gtk_alignment_new (0, 0, 1, 1);
2035 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 0, 0, 0);
2036 gtk_container_add (GTK_CONTAINER (alignment), self->priv->output_stream_box);
2037 gtk_box_pack_start (GTK_BOX (main_vbox),
2038 alignment,
2039 FALSE, FALSE, 0);
2040 // Output volume
2041 self->priv->output_bar = create_bar (self, FALSE, TRUE);
2042 gvc_channel_bar_set_name (GVC_CHANNEL_BAR (self->priv->output_bar),
2043 _("_Output volume:"));
2044 gtk_widget_set_sensitive (self->priv->output_bar, FALSE);
2045 gtk_widget_set_size_request (self->priv->output_bar, 460, -1);
2046
2047 gtk_box_pack_start (GTK_BOX (self->priv->output_stream_box),
2048 self->priv->output_bar, TRUE, FALSE, 12);
2049
2050 gtk_widget_show_all (main_vbox);2081 gtk_widget_show_all (main_vbox);
20512082
2052 g_signal_connect (self->priv->mixer_control,2083 g_signal_connect (self->priv->mixer_control,
@@ -2149,6 +2180,7 @@
2149 dialog->priv = GVC_MIXER_DIALOG_GET_PRIVATE (dialog);2180 dialog->priv = GVC_MIXER_DIALOG_GET_PRIVATE (dialog);
2150 dialog->priv->bars = g_hash_table_new (NULL, NULL);2181 dialog->priv->bars = g_hash_table_new (NULL, NULL);
2151 dialog->priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);2182 dialog->priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
2183 dialog->priv->indicator_settings = g_settings_new ("com.canonical.indicator.sound");
2152}2184}
21532185
2154static void2186static void

Subscribers

People subscribed via source and target branches