[Xfce4-commits] <thunar:nick/desktop> Modify the dialog layout a bit.

Nick Schermer noreply at xfce.org
Mon Feb 4 15:54:01 CET 2013


Updating branch refs/heads/nick/desktop
         to 58a3c6c6caef9f1aeb6a09922f20ebf0841c20b8 (commit)
       from 77d6cc6ada8e9e888cf8e7fdc32e9ebab256dd19 (commit)

commit 58a3c6c6caef9f1aeb6a09922f20ebf0841c20b8
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Feb 4 10:27:14 2013 +0100

    Modify the dialog layout a bit.

 thunar/thunar-desktop-background.c         |    2 +-
 thunar/thunar-desktop-preferences-dialog.c |   54 +++++++++++++++++----------
 2 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/thunar/thunar-desktop-background.c b/thunar/thunar-desktop-background.c
index 7df3f13..df2acc0 100644
--- a/thunar/thunar-desktop-background.c
+++ b/thunar/thunar-desktop-background.c
@@ -425,7 +425,7 @@ thunar_desktop_background_paint_color_fill (cairo_t                    *cr,
       y1 = area->y + area->height / 2;
       radius = MAX (area->width, area->height) / 2;
 
-      pattern = cairo_pattern_create_radial (x1, y1, radius, x1, y1, 0);
+      pattern = cairo_pattern_create_radial (x1, y1, 0, x1, y1, radius);
       goto paint_gradient;
       break;
     }
diff --git a/thunar/thunar-desktop-preferences-dialog.c b/thunar/thunar-desktop-preferences-dialog.c
index 5335e9a..2dfe3d5 100644
--- a/thunar/thunar-desktop-preferences-dialog.c
+++ b/thunar/thunar-desktop-preferences-dialog.c
@@ -66,6 +66,26 @@ struct _ThunarDesktopPreferencesDialog
   GtkWidget     *color_end;
 };
 
+typedef struct
+{
+  guint        seconds;
+  const gchar *name;
+}
+Autochange;
+
+static const Autochange auto_change_options[] =
+{
+  { 0,         N_("Disabled")         },
+  { 1,         N_("During Log In")    },
+  { 10       , N_("Every 10 seconds") },
+  { 60       , N_("Every minute")     },
+  { 60 * 5   , N_("Every 5 minutes")  },
+  { 60 * 15  , N_("Every 15 minutes") },
+  { 60 * 30  , N_("Every 30 minutes") },
+  { 3600     , N_("Every hour")       },
+  { 3600 * 24, N_("Every day")        },
+};
+
 
 
 G_DEFINE_TYPE (ThunarDesktopPreferencesDialog, thunar_desktop_preferences_dialog, XFCE_TYPE_TITLED_DIALOG)
@@ -101,7 +121,6 @@ thunar_desktop_preferences_dialog_init (ThunarDesktopPreferencesDialog *dialog)
   GtkWidget    *hbox;
   GtkWidget    *combo;
   GtkWidget    *button;
-  GtkWidget    *button2;
   GEnumClass   *klass;
   guint         n;
   GtkSizeGroup *size_group;
@@ -111,7 +130,7 @@ thunar_desktop_preferences_dialog_init (ThunarDesktopPreferencesDialog *dialog)
   /* configure the dialog properties */
   gtk_window_set_icon_name (GTK_WINDOW (dialog), "preferences-desktop-wallpaper");
   gtk_window_set_title (GTK_WINDOW (dialog), _("Desktop Preferences"));
-  gtk_window_set_default_size (GTK_WINDOW (dialog), 900, 700);
+  gtk_window_set_default_size (GTK_WINDOW (dialog), 700, 500);
 
   /* add "Help" and "Close" buttons */
   gtk_dialog_add_buttons (GTK_DIALOG (dialog),
@@ -188,8 +207,6 @@ thunar_desktop_preferences_dialog_init (ThunarDesktopPreferencesDialog *dialog)
   gtk_size_group_add_widget (size_group, label);
   gtk_widget_show (label);
 
-  g_object_unref (size_group);
-
   combo = gtk_combo_box_text_new ();
   gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, TRUE, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
@@ -219,27 +236,24 @@ thunar_desktop_preferences_dialog_init (ThunarDesktopPreferencesDialog *dialog)
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
   gtk_widget_show (hbox);
 
-  button = gtk_check_button_new_with_mnemonic (_("Ch_ange picture"));
-  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
-  gtk_widget_show (button);
+  label = gtk_label_new_with_mnemonic (_("Automatically ch_ange background:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+  //gtk_size_group_add_widget (size_group, label);
+  gtk_widget_show (label);
 
   combo = gtk_combo_box_text_new ();
-  g_object_bind_property (button, "active", combo, "sensitive", G_BINDING_SYNC_CREATE);
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
   gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, TRUE, 0);
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("During login"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every 10 seconds"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every minute"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every 5 minutes"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every 15 minutes"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every 30 minutes"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every hour"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Every day"));
+  for (n = 0; n < G_N_ELEMENTS (auto_change_options); n++)
+    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(auto_change_options[n].name));
   gtk_widget_show (combo);
 
-  button2 = gtk_check_button_new_with_mnemonic (_("_Random order"));
-  g_object_bind_property (button, "active", button2, "sensitive", G_BINDING_SYNC_CREATE);
-  gtk_box_pack_start (GTK_BOX (hbox), button2, FALSE, TRUE, 0);
-  gtk_widget_show (button2);
+  button = gtk_check_button_new_with_mnemonic (_("_Random order"));
+  g_object_bind_property (combo, "active", button, "sensitive", G_BINDING_SYNC_CREATE);
+  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
+  gtk_widget_show (button);
+
+  g_object_unref (size_group);
 }
 
 


More information about the Xfce4-commits mailing list