[gtk+/wip/otte/icon-size: 3/20] tooltips: Remove GtkIconSize usage



commit 744d0c66fe594f799286565c0d721d9f2d7512bf
Author: Benjamin Otte <otte redhat com>
Date:   Fri Jan 20 02:02:44 2017 +0100

    tooltips: Remove GtkIconSize usage

 gtk/gtktooltip.c              |   14 ++++----------
 gtk/gtktooltip.h              |    6 ++----
 gtk/gtktooltipwindow.c        |   10 ++++------
 gtk/gtktooltipwindowprivate.h |    6 ++----
 tests/testtooltips.c          |    3 +--
 5 files changed, 13 insertions(+), 26 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 3ac5ed0..8bd68da 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -293,7 +293,6 @@ gtk_tooltip_set_icon (GtkTooltip *tooltip,
  * gtk_tooltip_set_icon_from_icon_name:
  * @tooltip: a #GtkTooltip
  * @icon_name: (allow-none): an icon name, or %NULL
- * @size: (type int): a stock icon size (#GtkIconSize)
  *
  * Sets the icon of the tooltip (which is in front of the text) to be
  * the icon indicated by @icon_name with the size indicated
@@ -303,21 +302,18 @@ gtk_tooltip_set_icon (GtkTooltip *tooltip,
  */
 void
 gtk_tooltip_set_icon_from_icon_name (GtkTooltip  *tooltip,
-                                    const gchar *icon_name,
-                                    GtkIconSize  size)
+                                    const gchar *icon_name)
 {
   g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
 
   gtk_tooltip_window_set_image_icon_from_name (GTK_TOOLTIP_WINDOW (tooltip->window),
-                                               icon_name,
-                                               size);
+                                               icon_name);
 }
 
 /**
  * gtk_tooltip_set_icon_from_gicon:
  * @tooltip: a #GtkTooltip
  * @gicon: (allow-none): a #GIcon representing the icon, or %NULL
- * @size: (type int): a stock icon size (#GtkIconSize)
  *
  * Sets the icon of the tooltip (which is in front of the text)
  * to be the icon indicated by @gicon with the size indicated
@@ -327,14 +323,12 @@ gtk_tooltip_set_icon_from_icon_name (GtkTooltip  *tooltip,
  */
 void
 gtk_tooltip_set_icon_from_gicon (GtkTooltip  *tooltip,
-                                GIcon       *gicon,
-                                GtkIconSize  size)
+                                GIcon       *gicon)
 {
   g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
 
   gtk_tooltip_window_set_image_icon_from_gicon (GTK_TOOLTIP_WINDOW (tooltip->window),
-                                                gicon,
-                                                size);
+                                                gicon);
 }
 
 /**
diff --git a/gtk/gtktooltip.h b/gtk/gtktooltip.h
index 3c4140d..c6a129f 100644
--- a/gtk/gtktooltip.h
+++ b/gtk/gtktooltip.h
@@ -46,12 +46,10 @@ void gtk_tooltip_set_icon                (GtkTooltip         *tooltip,
                                           GdkPixbuf          *pixbuf);
 GDK_AVAILABLE_IN_ALL
 void gtk_tooltip_set_icon_from_icon_name (GtkTooltip         *tooltip,
-                                         const gchar        *icon_name,
-                                         GtkIconSize         size);
+                                         const gchar        *icon_name);
 GDK_AVAILABLE_IN_ALL
 void gtk_tooltip_set_icon_from_gicon     (GtkTooltip         *tooltip,
-                                         GIcon              *gicon,
-                                         GtkIconSize         size);
+                                         GIcon              *gicon);
 GDK_AVAILABLE_IN_ALL
 void gtk_tooltip_set_custom             (GtkTooltip         *tooltip,
                                           GtkWidget          *custom_widget);
diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c
index 6cad754..0b536b4 100644
--- a/gtk/gtktooltipwindow.c
+++ b/gtk/gtktooltipwindow.c
@@ -139,12 +139,11 @@ gtk_tooltip_window_set_image_icon (GtkTooltipWindow *window,
 
 void
 gtk_tooltip_window_set_image_icon_from_name (GtkTooltipWindow *window,
-                                             const char       *icon_name,
-                                             GtkIconSize       icon_size)
+                                             const char       *icon_name)
 {
   if (icon_name)
     {
-      gtk_image_set_from_icon_name (GTK_IMAGE (window->image), icon_name, icon_size);
+      gtk_image_set_from_icon_name (GTK_IMAGE (window->image), icon_name, GTK_ICON_SIZE_MENU);
       gtk_widget_show (window->image);
     }
   else
@@ -155,12 +154,11 @@ gtk_tooltip_window_set_image_icon_from_name (GtkTooltipWindow *window,
 
 void
 gtk_tooltip_window_set_image_icon_from_gicon (GtkTooltipWindow *window,
-                                              GIcon            *gicon,
-                                              GtkIconSize       icon_size)
+                                              GIcon            *gicon)
 {
   if (gicon != NULL)
     {
-      gtk_image_set_from_gicon (GTK_IMAGE (window->image), gicon, icon_size);
+      gtk_image_set_from_gicon (GTK_IMAGE (window->image), gicon, GTK_ICON_SIZE_MENU);
       gtk_widget_show (window->image);
     }
   else
diff --git a/gtk/gtktooltipwindowprivate.h b/gtk/gtktooltipwindowprivate.h
index 5389bfd..35e9f6e 100644
--- a/gtk/gtktooltipwindowprivate.h
+++ b/gtk/gtktooltipwindowprivate.h
@@ -44,11 +44,9 @@ void            gtk_tooltip_window_set_label_text               (GtkTooltipWindo
 void            gtk_tooltip_window_set_image_icon               (GtkTooltipWindow *window,
                                                                  GdkPixbuf        *pixbuf);
 void            gtk_tooltip_window_set_image_icon_from_name     (GtkTooltipWindow *window,
-                                                                 const char       *icon_name,
-                                                                 GtkIconSize       icon_size);
+                                                                 const char       *icon_name);
 void            gtk_tooltip_window_set_image_icon_from_gicon    (GtkTooltipWindow *window,
-                                                                 GIcon            *gicon,
-                                                                 GtkIconSize       icon_size);
+                                                                 GIcon            *gicon);
 void            gtk_tooltip_window_set_custom_widget            (GtkTooltipWindow *window,
                                                                  GtkWidget        *custom_widget);
 
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 1d071e2..e458e20 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -32,8 +32,7 @@ query_tooltip_cb (GtkWidget  *widget,
                  gpointer    data)
 {
   gtk_tooltip_set_markup (tooltip, gtk_button_get_label (GTK_BUTTON (widget)));
-  gtk_tooltip_set_icon_from_icon_name (tooltip, "edit-delete",
-                                       GTK_ICON_SIZE_MENU);
+  gtk_tooltip_set_icon_from_icon_name (tooltip, "edit-delete");
 
   return TRUE;
 }


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