Updating branch refs/heads/master
         to 5369a8e17dcab5d6431a290552a50fc966d45fa4 (commit)
       from 69ea8a3321eb316642873441df7386b6ca02320e (commit)

commit 5369a8e17dcab5d6431a290552a50fc966d45fa4
Author: Guido Berhoerster <guido+x...@berhoerster.name>
Date:   Thu Sep 27 16:31:09 2012 +0200

    Improve usability of the mixer and plugin configuration dialog
    
    Add mnemonics for all tabs and the soud card combob box of the mixer main 
window.
    Add labels with mnemonics for the soud card and track combo boxes of the 
plugin configuration dialog.
    Improve the wording of the message shown when no controls are visible and 
visually follow the layout of an alert popup.

 NEWS                               |    6 ++++
 panel-plugin/xfce-plugin-dialog.c  |   46 +++++++++++------------------------
 xfce4-mixer/xfce-mixer-container.c |   29 +++++++++++++++++++---
 xfce4-mixer/xfce-mixer-window.c    |    7 +----
 4 files changed, 48 insertions(+), 40 deletions(-)

diff --git a/NEWS b/NEWS
index 9b0940e..1c6733c 100644
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,12 @@
   left and right of them.
 - Default to unlocked state if the volume differs between the channels of a
   track.
+- Add mnemonics for all tabs and the soud card combob box of the mixer main
+  window.
+- Add labels with mnemonics for the soud card and track combo boxes of the
+  plugin configuration dialog.
+- Improve the wording of the message shown when no controls are visible and
+  visually follow the layout of an alert popup.
 
 
 4.8.0
diff --git a/panel-plugin/xfce-plugin-dialog.c 
b/panel-plugin/xfce-plugin-dialog.c
index 1680834..f89f872 100644
--- a/panel-plugin/xfce-plugin-dialog.c
+++ b/panel-plugin/xfce-plugin-dialog.c
@@ -142,11 +142,9 @@ xfce_plugin_dialog_new (XfcePanelPlugin *plugin)
 static void
 xfce_plugin_dialog_create_contents (XfcePluginDialog *dialog)
 {
-  GtkWidget     *alignment;
-  GtkWidget     *vbox;
+  GtkWidget     *table;
   GtkWidget     *button;
   GtkWidget     *label;
-  gchar         *title;
 
   gtk_window_set_icon_name (GTK_WINDOW (dialog), "multimedia-volume-control");
   gtk_window_set_title (GTK_WINDOW (dialog), _("Audio Mixer Plugin"));
@@ -157,43 +155,29 @@ xfce_plugin_dialog_create_contents (XfcePluginDialog 
*dialog)
   gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, 
GTK_RESPONSE_CLOSE);
   gtk_widget_show (button);
 
-  vbox = gtk_vbox_new (FALSE, 6);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
-  gtk_widget_show (vbox);
+  table = gtk_table_new (2, 2, FALSE);
+  gtk_table_set_row_spacings (GTK_TABLE (table), 12);
+  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+  gtk_container_set_border_width (GTK_CONTAINER (table), 6);
+  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
+  gtk_widget_show (table);
 
-  label = gtk_label_new (NULL);
-  title = g_strdup_printf ("<span weight='bold'>%s</span>", _("Sound card"));
-  gtk_label_set_markup (GTK_LABEL (label), title);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+  label = gtk_label_new_with_mnemonic (_("Sound _card:"));
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_SHRINK, 
GTK_SHRINK, 0, 0);
   gtk_widget_show (label);
-  g_free (title);
-
-  alignment = gtk_alignment_new (0.0, 0.0, 1, 1);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 6, 12, 0);
-  gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0);
-  gtk_widget_show (alignment);
 
   dialog->card_combo = xfce_mixer_card_combo_new (NULL);
-  gtk_container_add (GTK_CONTAINER (alignment), dialog->card_combo);
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->card_combo);
+  gtk_table_attach (GTK_TABLE (table), dialog->card_combo, 1, 2, 0, 1, 
GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
   gtk_widget_show (dialog->card_combo);
 
-  label = gtk_label_new (NULL);
-  title = g_strdup_printf ("<span weight='bold'>%s</span>", _("Mixer track"));
-  gtk_label_set_markup (GTK_LABEL (label), title);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+  label = gtk_label_new_with_mnemonic (_("Mixer _track:"));
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->track_combo);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_SHRINK, 
GTK_SHRINK, 0, 0);
   gtk_widget_show (label);
-  g_free (title);
-
-  alignment = gtk_alignment_new (0.0, 0.0, 1, 1);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 6, 12, 0);
-  gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0);
-  gtk_widget_show (alignment);
 
   dialog->track_combo = xfce_mixer_track_combo_new (NULL, NULL);
-  gtk_container_add (GTK_CONTAINER (alignment), dialog->track_combo);
+  gtk_table_attach (GTK_TABLE (table), dialog->track_combo, 1, 2, 1, 2, 
GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
   gtk_widget_show (dialog->track_combo);
 
   /* Hack to initialize the widget state */
diff --git a/xfce4-mixer/xfce-mixer-container.c 
b/xfce4-mixer/xfce-mixer-container.c
index d20f949..d59240a 100644
--- a/xfce4-mixer/xfce-mixer-container.c
+++ b/xfce4-mixer/xfce-mixer-container.c
@@ -215,7 +215,7 @@ xfce_mixer_container_create_contents (XfceMixerContainer 
*mixer_container)
   XfceMixerTrackType    type;
   GstMixerTrack        *track;
   const GList          *iter;
-  const gchar          *titles[4] = { N_("Playback"), N_("Capture"), 
N_("Switches"), N_("Options") };
+  const gchar          *titles[4] = { N_("_Playback"), N_("C_apture"), 
N_("S_witches"), N_("_Options") };
   GtkWidget            *label_alignment;
   GtkWidget            *option_alignment;
   GtkWidget            *track_widget;
@@ -224,8 +224,11 @@ xfce_mixer_container_create_contents (XfceMixerContainer 
*mixer_container)
   GtkWidget            *scrollwins[4];
   GtkWidget            *views[4];
   GtkWidget            *last_separator[4] = { NULL, NULL, NULL, NULL };
+  GtkWidget            *alignment;
+  GtkWidget            *vbox;
   GtkWidget            *label1;
   GtkWidget            *label2;
+  GtkWidget            *label3;
   const gchar          *track_label;
   gchar                *option_track_label;
   guint                 num_children[4] = { 0, 0, 0, 0 };
@@ -239,7 +242,7 @@ xfce_mixer_container_create_contents (XfceMixerContainer 
*mixer_container)
   /* Create widgets for all four tabs */
   for (i = 0; i < 4; ++i)
     {
-      labels[i] = gtk_label_new (_(titles[i]));
+      labels[i] = gtk_label_new_with_mnemonic (_(titles[i]));
       scrollwins[i] = gtk_scrolled_window_new (NULL, NULL);
       gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW 
(scrollwins[i]), GTK_SHADOW_IN);
       gtk_container_set_border_width (GTK_CONTAINER (scrollwins[i]), 6);
@@ -387,12 +390,30 @@ xfce_mixer_container_create_contents (XfceMixerContainer 
*mixer_container)
       label1 = gtk_label_new (_("No controls visible"));
       gtk_widget_show (label1);
 
+      alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
+      gtk_widget_show (alignment);
+
+      vbox = gtk_vbox_new (6, FALSE);
+      gtk_container_add (GTK_CONTAINER (alignment), vbox);
+      gtk_widget_show (vbox);
+
       label2 = gtk_label_new (NULL);
-      gtk_label_set_markup (GTK_LABEL (label2), _("No controls are marked as 
visible. Please open the <span size='large'><b>Select Controls</b></span> 
dialog to select some."));
+      gtk_label_set_markup (GTK_LABEL (label2), _("<span weight=\"bold\" 
size=\"larger\">No controls visible</span>"));
+      gtk_label_set_max_width_chars (GTK_LABEL (label2), 80);
       gtk_label_set_line_wrap (GTK_LABEL (label2), TRUE);
+      gtk_misc_set_alignment (GTK_MISC (label2), 0.0, 0.5);
+      gtk_box_pack_start (GTK_BOX (vbox), label2, FALSE, TRUE, 0);
       gtk_widget_show (label2);
 
-      gtk_notebook_append_page (GTK_NOTEBOOK (mixer_container), label2, 
label1);
+      label3 = gtk_label_new (NULL);
+      gtk_label_set_markup (GTK_LABEL (label3), _("In order to toggle the 
visibility of mixer controls, open the <b>\"Select Controls\"</b> dialog."));
+      gtk_label_set_max_width_chars (GTK_LABEL (label3), 80);
+      gtk_label_set_line_wrap (GTK_LABEL (label3), TRUE);
+      gtk_misc_set_alignment (GTK_MISC (label3), 0.0, 0.5);
+      gtk_box_pack_start (GTK_BOX (vbox), label3, FALSE, TRUE, 0);
+      gtk_widget_show (label3);
+
+      gtk_notebook_append_page (GTK_NOTEBOOK (mixer_container), alignment, 
label1);
     }
 
   g_object_unref (preferences);
diff --git a/xfce4-mixer/xfce-mixer-window.c b/xfce4-mixer/xfce-mixer-window.c
index 540a185..7f9a9e9 100644
--- a/xfce4-mixer/xfce-mixer-window.c
+++ b/xfce4-mixer/xfce-mixer-window.c
@@ -124,7 +124,6 @@ xfce_mixer_window_init (XfceMixerWindow *window)
   GtkWidget     *bbox;
   gchar         *card_name;
   GstElement    *card;
-  gchar         *title;
   guint          i;
   gint           width;
   gint           height;
@@ -183,16 +182,14 @@ xfce_mixer_window_init (XfceMixerWindow *window)
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
   gtk_widget_show (hbox);
 
-  label = gtk_label_new (NULL);
-  title = g_strdup_printf ("<span weight='bold' size='large'>%s</span>", 
_("Sound card:"));
-  gtk_label_set_markup (GTK_LABEL (label), title);
-  g_free (title);
+  label = gtk_label_new_with_mnemonic (_("Sound _card:"));
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
 
   window->soundcard_combo = xfce_mixer_card_combo_new (card);
   g_signal_connect (G_OBJECT (window->soundcard_combo), "soundcard-changed", 
G_CALLBACK (xfce_mixer_window_soundcard_changed), window);
   gtk_container_add (GTK_CONTAINER (hbox), window->soundcard_combo);
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), window->soundcard_combo);
   gtk_widget_show (window->soundcard_combo);
 
   window->mixer_frame = gtk_frame_new (NULL);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to