[gnome-photos] Drop GdHeaderToggleButton



commit d8b22a9cf82e5f8c60a78215be9cf54724381eee
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jul 29 14:39:28 2014 +0200

    Drop GdHeaderToggleButton
    
    A GdHeaderToggleButton is a GtkToggleButton that either has a 16px
    icon, tooltop text and the image-button style class; or a label and
    the text-button style class.
    
    Fixes: https://bugzilla.gnome.org/733850

 src/photos-main-toolbar.c        |    8 +++++---
 src/photos-preview-nav-buttons.c |    7 +++----
 src/photos-selection-toolbar.c   |    8 ++++----
 3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 9a99eb2..a66fdd1 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -267,11 +267,13 @@ photos_main_toolbar_add_remote_display_button (PhotosMainToolbar *self)
 static GtkWidget *
 photos_main_toolbar_add_search_button (PhotosMainToolbar *self)
 {
+  GtkWidget *image;
   GtkWidget *search_button;
 
-  search_button = gd_header_toggle_button_new ();
-  gd_header_button_set_label (GD_HEADER_BUTTON (search_button), _("Search"));
-  gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (search_button), PHOTOS_ICON_EDIT_FIND_SYMBOLIC);
+  image = gtk_image_new_from_icon_name (PHOTOS_ICON_EDIT_FIND_SYMBOLIC, GTK_ICON_SIZE_BUTTON);
+  search_button = gtk_toggle_button_new ();
+  gtk_widget_set_tooltip_text (search_button, _("Search"));
+  gtk_button_set_image (GTK_BUTTON (search_button), image);
   gtk_actionable_set_action_name (GTK_ACTIONABLE (search_button), "app.search");
   gtk_header_bar_pack_end (GTK_HEADER_BAR (self->priv->toolbar), search_button);
 
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index fabf559..f0410b4 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -27,7 +27,6 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <libgd/gd.h>
 
 #include "photos-enums.h"
 #include "photos-icons.h"
@@ -458,9 +457,9 @@ photos_preview_nav_buttons_constructed (GObject *object)
                             G_CALLBACK (photos_preview_nav_buttons_leave_notify),
                             self);
 
-  priv->favorite_button = gd_header_toggle_button_new ();
-  gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (priv->favorite_button),
-                                           PHOTOS_ICON_FAVORITE_SYMBOLIC);
+  image = gtk_image_new_from_icon_name (PHOTOS_ICON_FAVORITE_SYMBOLIC, GTK_ICON_SIZE_BUTTON);
+  priv->favorite_button = gtk_toggle_button_new ();
+  gtk_button_set_image (GTK_BUTTON (priv->favorite_button), image);
   gtk_action_bar_pack_end (GTK_ACTION_BAR (toolbar), priv->favorite_button);
   g_signal_connect_swapped (priv->favorite_button,
                             "clicked",
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index e21ee3d..9304be9 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -28,7 +28,6 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <libgd/gd.h>
 
 #include "photos-base-item.h"
 #include "photos-delete-notification.h"
@@ -433,6 +432,7 @@ static void
 photos_selection_toolbar_init (PhotosSelectionToolbar *self)
 {
   PhotosSelectionToolbarPrivate *priv;
+  GtkWidget *image;
   GtkWidget *toolbar;
 
   self->priv = photos_selection_toolbar_get_instance_private (self);
@@ -443,9 +443,9 @@ photos_selection_toolbar_init (PhotosSelectionToolbar *self)
   toolbar = gtk_action_bar_new ();
   gtk_container_add (GTK_CONTAINER (self), toolbar);
 
-  priv->toolbar_favorite = gd_header_toggle_button_new ();
-  gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (priv->toolbar_favorite),
-                                           PHOTOS_ICON_FAVORITE_SYMBOLIC);
+  image = gtk_image_new_from_icon_name (PHOTOS_ICON_FAVORITE_SYMBOLIC, GTK_ICON_SIZE_BUTTON);
+  priv->toolbar_favorite = gtk_toggle_button_new ();
+  gtk_button_set_image (GTK_BUTTON (priv->toolbar_favorite), image);
   gtk_action_bar_pack_start (GTK_ACTION_BAR (toolbar), priv->toolbar_favorite);
   g_signal_connect (priv->toolbar_favorite,
                     "clicked",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]