[Xfce4-commits] [apps/ristretto] 01/01: Add icons to "Close", "Apply", "OK" buttons

noreply at xfce.org noreply at xfce.org
Wed Jul 31 20:26:54 CEST 2019


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/ristretto.

commit 7f501db87f00d6bda29d3f95e3ca980610328994
Author: Igor <f2404 at yandex.ru>
Date:   Wed Jul 31 14:26:26 2019 -0400

    Add icons to "Close", "Apply", "OK" buttons
---
 src/gnome_wallpaper_manager.c | 24 ++++++++++---------
 src/main_window.c             | 56 ++++++++++++++++++++++++-------------------
 src/xfce_wallpaper_manager.c  | 26 +++++++++++---------
 3 files changed, 59 insertions(+), 47 deletions(-)

diff --git a/src/gnome_wallpaper_manager.c b/src/gnome_wallpaper_manager.c
index 660363c..658bcca 100644
--- a/src/gnome_wallpaper_manager.c
+++ b/src/gnome_wallpaper_manager.c
@@ -221,6 +221,7 @@ rstto_gnome_wallpaper_manager_init (GObject *object)
     GtkWidget *image_prop_grid = gtk_grid_new ();
     GtkWidget *style_label = gtk_label_new (_("Style:"));
     GtkWidget *vbox;
+    GtkWidget *button;
 
     GdkDisplay *display = gdk_display_get_default ();
     gint n_monitors = gdk_display_get_n_monitors (display);
@@ -229,17 +230,18 @@ rstto_gnome_wallpaper_manager_init (GObject *object)
 
     manager->priv = g_new0 (RsttoGnomeWallpaperManagerPriv, 1);
 
-    manager->priv->dialog = gtk_dialog_new_with_buttons (
-            _("Set as wallpaper"),
-            NULL,
-            0,
-            _("_Cancel"),
-            GTK_RESPONSE_CANCEL,
-            _("_Apply"),
-            GTK_RESPONSE_APPLY,
-            _("_OK"),
-            GTK_RESPONSE_OK,
-            NULL);
+    manager->priv->dialog = gtk_dialog_new ();
+    gtk_window_set_title (GTK_WINDOW (manager->priv->dialog), _("Set as wallpaper"));
+
+    button = xfce_gtk_button_new_mixed ("gtk-cancel", _("_Cancel"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (manager->priv->dialog), button, GTK_RESPONSE_CANCEL);
+    gtk_widget_show (button);
+    button = xfce_gtk_button_new_mixed ("gtk-apply", _("_Apply"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (manager->priv->dialog), button, GTK_RESPONSE_APPLY);
+    gtk_widget_show (button);
+    button = xfce_gtk_button_new_mixed ("gtk-ok", _("_OK"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (manager->priv->dialog), button, GTK_RESPONSE_OK);
+    gtk_widget_show (button);
 
     vbox = gtk_dialog_get_content_area (GTK_DIALOG (manager->priv->dialog));
 
diff --git a/src/main_window.c b/src/main_window.c
index 31c57bc..638a433 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -2241,6 +2241,7 @@ cb_rstto_main_window_set_as_wallpaper (GtkWidget *widget, RsttoMainWindow *windo
     GtkWidget *content_area = NULL;
     GtkWidget *behaviour_desktop_lbl;
     GtkWidget *choose_desktop_combo_box;
+    GtkWidget *button;
 
     if (window->priv->iter)
     {
@@ -2256,20 +2257,22 @@ cb_rstto_main_window_set_as_wallpaper (GtkWidget *widget, RsttoMainWindow *windo
          * used. -- Ask the user which method he wants ristretto to
          * apply to set the desktop wallpaper.
          */
-        dialog = gtk_dialog_new_with_buttons (
-                _("Choose 'set wallpaper' method"),
-                GTK_WINDOW(window),
-                GTK_DIALOG_DESTROY_WITH_PARENT,
-                _("_OK"),
-                GTK_RESPONSE_OK,
-                _("_Cancel"),
-                GTK_RESPONSE_CANCEL,
-                NULL);
+        dialog = gtk_dialog_new ();
+        gtk_window_set_title (GTK_WINDOW (dialog), _("Choose 'set wallpaper' method"));
+        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+        gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+
+        button = xfce_gtk_button_new_mixed ("gtk-cancel", _("_Cancel"));
+        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CANCEL);
+        gtk_widget_show (button);
+        button = xfce_gtk_button_new_mixed ("gtk-ok", _("_OK"));
+        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);
+        gtk_widget_show (button);
 
         /* Populate the dialog */
-        content_area = gtk_dialog_get_content_area (GTK_DIALOG(dialog));
+        content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 
-        behaviour_desktop_lbl = gtk_label_new(NULL);
+        behaviour_desktop_lbl = gtk_label_new (NULL);
         gtk_label_set_markup (
                 GTK_LABEL (behaviour_desktop_lbl),
                 _("Configure which system is currently managing your desktop.\n"
@@ -2288,8 +2291,7 @@ cb_rstto_main_window_set_as_wallpaper (GtkWidget *widget, RsttoMainWindow *windo
                 FALSE,
                 0);
 
-        choose_desktop_combo_box =
-                gtk_combo_box_text_new ();
+        choose_desktop_combo_box = gtk_combo_box_text_new ();
         gtk_box_pack_start (
                 GTK_BOX (content_area),
                 choose_desktop_combo_box,
@@ -2318,7 +2320,7 @@ cb_rstto_main_window_set_as_wallpaper (GtkWidget *widget, RsttoMainWindow *windo
 
 
         /* Show the dialog */
-        response = gtk_dialog_run (GTK_DIALOG(dialog));
+        response = gtk_dialog_run (GTK_DIALOG (dialog));
 
         /* If the response was 'OK', the user has made a choice */
         if ( GTK_RESPONSE_OK == response )
@@ -4065,6 +4067,7 @@ rstto_main_window_launch_editor_chooser (
     GtkWidget *vbox;
     GtkWidget *image;
     GtkWidget *label;
+    GtkWidget *button;
     GtkWidget *check_button;
     GtkWidget *treeview;
     GtkWidget *scrolled_window;
@@ -4081,22 +4084,25 @@ rstto_main_window_launch_editor_chooser (
     const GdkPixbuf *pixbuf = NULL;
     GIcon *g_icon = NULL;
 
-    dialog = gtk_dialog_new_with_buttons (
-            _("Edit with"),
-            GTK_WINDOW (window),
-            GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
-            _("_Cancel"),
-            GTK_RESPONSE_CANCEL,
-            _("_OK"),
-            GTK_RESPONSE_OK,
-            NULL);
+    dialog = gtk_dialog_new ();
+    gtk_window_set_title (GTK_WINDOW (dialog), _("Edit with"));
+    gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+    gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+    gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+
+    button = xfce_gtk_button_new_mixed ("gtk-cancel", _("_Cancel"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CANCEL);
+    gtk_widget_show (button);
+    button = xfce_gtk_button_new_mixed ("gtk-ok", _("_OK"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_OK);
+    gtk_widget_show (button);
 
     content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
     vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
     hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 
     g_icon = g_content_type_get_icon (content_type);
-    image = gtk_image_new_from_gicon (g_icon,   GTK_ICON_SIZE_DIALOG);
+    image = gtk_image_new_from_gicon (g_icon, GTK_ICON_SIZE_DIALOG);
     g_object_unref (g_icon);
 
     label_text = g_strdup_printf (
@@ -4106,7 +4112,7 @@ rstto_main_window_launch_editor_chooser (
     label = gtk_label_new (label_text);
     g_free (label_text);
 
-    check_button = gtk_check_button_new_with_mnemonic(_("Use as _default for this kind of file"));
+    check_button = gtk_check_button_new_with_mnemonic (_("Use as _default for this kind of file"));
 
     scrolled_window = gtk_scrolled_window_new (NULL, NULL);
     gtk_scrolled_window_set_policy (
diff --git a/src/xfce_wallpaper_manager.c b/src/xfce_wallpaper_manager.c
index a821c60..d770885 100644
--- a/src/xfce_wallpaper_manager.c
+++ b/src/xfce_wallpaper_manager.c
@@ -24,6 +24,7 @@
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 #include <xfconf/xfconf.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4util/libxfce4util.h>
 #include <gio/gio.h>
 
@@ -403,6 +404,7 @@ rstto_xfce_wallpaper_manager_init (GObject *object)
     gint n_monitors = gdk_display_get_n_monitors (display);
     GdkRectangle monitor_geometry;
     GtkWidget *vbox;
+    GtkWidget *button;
     GtkWidget *style_label = gtk_label_new (_("Style:"));
     GtkWidget *image_prop_grid = gtk_grid_new ();
 
@@ -420,17 +422,19 @@ rstto_xfce_wallpaper_manager_init (GObject *object)
             SINGLE_WORKSPACE_MODE,
             TRUE);
 
-    manager->priv->dialog = gtk_dialog_new_with_buttons (
-            _("Set as wallpaper"),
-            NULL,
-            0,
-            _("_Cancel"),
-            GTK_RESPONSE_CANCEL,
-            _("_Apply"),
-            GTK_RESPONSE_APPLY,
-            _("_OK"),
-            GTK_RESPONSE_OK,
-            NULL);
+    manager->priv->dialog = gtk_dialog_new ();
+    gtk_window_set_title (GTK_WINDOW (manager->priv->dialog), _("Set as wallpaper"));
+
+    button = xfce_gtk_button_new_mixed ("gtk-cancel", _("_Cancel"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (manager->priv->dialog), button, GTK_RESPONSE_CANCEL);
+    gtk_widget_show (button);
+    button = xfce_gtk_button_new_mixed ("gtk-apply", _("_Apply"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (manager->priv->dialog), button, GTK_RESPONSE_APPLY);
+    gtk_widget_show (button);
+    button = xfce_gtk_button_new_mixed ("gtk-ok", _("_OK"));
+    gtk_dialog_add_action_widget (GTK_DIALOG (manager->priv->dialog), button, GTK_RESPONSE_OK);
+    gtk_widget_show (button);
+
     vbox = gtk_dialog_get_content_area (GTK_DIALOG (manager->priv->dialog));
 
     manager->priv->monitor_chooser = rstto_monitor_chooser_new ();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list