[gtk+] tooltip: Set icon from texture instead of pixbuf
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tooltip: Set icon from texture instead of pixbuf
- Date: Thu, 30 Nov 2017 04:24:28 +0000 (UTC)
commit 0063145ed8da28daeb3a04089abc45c395384bef
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Nov 29 22:17:59 2017 -0500
tooltip: Set icon from texture instead of pixbuf
Another part of removing GdkPixbuf from APIs.
gtk/gtktooltip.c | 12 ++++++------
gtk/gtktooltip.h | 4 ++--
gtk/gtktooltipwindow.c | 6 +++---
gtk/gtktooltipwindowprivate.h | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 81cba1d..dbca016 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -275,21 +275,21 @@ gtk_tooltip_set_text (GtkTooltip *tooltip,
/**
* gtk_tooltip_set_icon:
* @tooltip: a #GtkTooltip
- * @pixbuf: (allow-none): a #GdkPixbuf, or %NULL
+ * @texture: (allow-none): a #GdkTexture, or %NULL
*
* Sets the icon of the tooltip (which is in front of the text) to be
- * @pixbuf. If @pixbuf is %NULL, the image will be hidden.
+ * @texture. If @texure is %NULL, the image will be hidden.
*
- * Since: 2.12
+ * Since: 3.94
*/
void
gtk_tooltip_set_icon (GtkTooltip *tooltip,
- GdkPixbuf *pixbuf)
+ GdkTexture *texture)
{
g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
- g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
+ g_return_if_fail (texture == NULL || GDK_IS_TEXTURE (texture));
- gtk_tooltip_window_set_image_icon (GTK_TOOLTIP_WINDOW (tooltip->window), pixbuf);
+ gtk_tooltip_window_set_image_icon (GTK_TOOLTIP_WINDOW (tooltip->window), texture);
}
/**
diff --git a/gtk/gtktooltip.h b/gtk/gtktooltip.h
index c6a129f..70091f8 100644
--- a/gtk/gtktooltip.h
+++ b/gtk/gtktooltip.h
@@ -41,9 +41,9 @@ void gtk_tooltip_set_markup (GtkTooltip *tooltip,
GDK_AVAILABLE_IN_ALL
void gtk_tooltip_set_text (GtkTooltip *tooltip,
const gchar *text);
-GDK_AVAILABLE_IN_ALL
+GDK_AVAILABLE_IN_3_94
void gtk_tooltip_set_icon (GtkTooltip *tooltip,
- GdkPixbuf *pixbuf);
+ GdkTexture *texture);
GDK_AVAILABLE_IN_ALL
void gtk_tooltip_set_icon_from_icon_name (GtkTooltip *tooltip,
const gchar *icon_name);
diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c
index a830782..18bcca3 100644
--- a/gtk/gtktooltipwindow.c
+++ b/gtk/gtktooltipwindow.c
@@ -121,12 +121,12 @@ gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,
void
gtk_tooltip_window_set_image_icon (GtkTooltipWindow *window,
- GdkPixbuf *pixbuf)
+ GdkTexture *texture)
{
- if (pixbuf != NULL)
+ if (texture != NULL)
{
- gtk_image_set_from_pixbuf (GTK_IMAGE (window->image), pixbuf);
+ gtk_image_set_from_texture (GTK_IMAGE (window->image), texture);
gtk_widget_show (window->image);
}
else
diff --git a/gtk/gtktooltipwindowprivate.h b/gtk/gtktooltipwindowprivate.h
index 35e9f6e..527c349 100644
--- a/gtk/gtktooltipwindowprivate.h
+++ b/gtk/gtktooltipwindowprivate.h
@@ -42,7 +42,7 @@ void gtk_tooltip_window_set_label_markup (GtkTooltipWindo
void gtk_tooltip_window_set_label_text (GtkTooltipWindow *window,
const char *text);
void gtk_tooltip_window_set_image_icon (GtkTooltipWindow *window,
- GdkPixbuf *pixbuf);
+ GdkTexture *texture);
void gtk_tooltip_window_set_image_icon_from_name (GtkTooltipWindow *window,
const char *icon_name);
void gtk_tooltip_window_set_image_icon_from_gicon (GtkTooltipWindow *window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]