[gnome-flashback] desktop: add gf_icon_get_image



commit ead56f27d4af28952e6802094e4c59dfca1eef64
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Nov 24 16:24:29 2019 +0200

    desktop: add gf_icon_get_image

 gnome-flashback/libdesktop/gf-icon.c | 18 ++++++++++++++----
 gnome-flashback/libdesktop/gf-icon.h |  2 ++
 2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/gnome-flashback/libdesktop/gf-icon.c b/gnome-flashback/libdesktop/gf-icon.c
index ba13e38..9425da8 100644
--- a/gnome-flashback/libdesktop/gf-icon.c
+++ b/gnome-flashback/libdesktop/gf-icon.c
@@ -206,19 +206,19 @@ get_gnome_icon_list (GfIcon *self)
   for (l = selected_icons; l != NULL; l = l->next)
     {
       GfIcon *icon;
-      GfIconPrivate *icon_priv;
+      GtkWidget *image;
       GFile *file;
       char *uri;
       GtkAllocation allocation;
 
       icon = l->data;
-      icon_priv = gf_icon_get_instance_private (icon);
 
+      image = gf_icon_get_image (icon);
       file = gf_icon_get_file (icon);
       uri = g_file_get_uri (file);
 
-      gtk_widget_get_allocation (GTK_WIDGET (icon_priv->image), &allocation);
-      gtk_widget_translate_coordinates (GTK_WIDGET (icon_priv->image),
+      gtk_widget_get_allocation (image, &allocation);
+      gtk_widget_translate_coordinates (image,
                                         GTK_WIDGET (self),
                                         -priv->press_x,
                                         -priv->press_y,
@@ -1439,6 +1439,16 @@ gf_icon_new (GfIconView *icon_view,
                        NULL);
 }
 
+GtkWidget *
+gf_icon_get_image (GfIcon *self)
+{
+  GfIconPrivate *priv;
+
+  priv = gf_icon_get_instance_private (self);
+
+  return priv->image;
+}
+
 void
 gf_icon_set_file (GfIcon *self,
                   GFile  *file)
diff --git a/gnome-flashback/libdesktop/gf-icon.h b/gnome-flashback/libdesktop/gf-icon.h
index d183ba0..dbf97a6 100644
--- a/gnome-flashback/libdesktop/gf-icon.h
+++ b/gnome-flashback/libdesktop/gf-icon.h
@@ -43,6 +43,8 @@ GtkWidget  *gf_icon_new               (GfIconView *icon_view,
                                        GFile      *file,
                                        GFileInfo  *info);
 
+GtkWidget  *gf_icon_get_image         (GfIcon     *self);
+
 void        gf_icon_set_file          (GfIcon     *self,
                                        GFile      *file);
 


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