[gnome-flashback] desktop: add gf_monitor_view_select_icons



commit 69f5506d08834c123eb633be92047ef62b2da2e3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Nov 17 21:22:33 2019 +0200

    desktop: add gf_monitor_view_select_icons

 gnome-flashback/libdesktop/gf-monitor-view.c | 25 +++++++++++++++++++++++++
 gnome-flashback/libdesktop/gf-monitor-view.h |  3 +++
 2 files changed, 28 insertions(+)
---
diff --git a/gnome-flashback/libdesktop/gf-monitor-view.c b/gnome-flashback/libdesktop/gf-monitor-view.c
index b245b36..274e2e3 100644
--- a/gnome-flashback/libdesktop/gf-monitor-view.c
+++ b/gnome-flashback/libdesktop/gf-monitor-view.c
@@ -874,3 +874,28 @@ gf_monitor_view_find_next_icon (GfMonitorView    *self,
 
   return find_next_icon (self, next_to, direction);
 }
+
+void
+gf_monitor_view_select_icons (GfMonitorView *self,
+                              GdkRectangle  *rect)
+{
+  GList *children;
+  GList *l;
+
+  children = gtk_container_get_children (GTK_CONTAINER (self));
+
+  for (l = children; l != NULL; l = l->next)
+    {
+      GtkWidget *icon;
+      GtkAllocation allocation;
+
+      icon = l->data;
+
+      gtk_widget_get_allocation (icon, &allocation);
+
+      if (gdk_rectangle_intersect (&allocation, rect, NULL))
+        gf_icon_set_selected (GF_ICON (icon), TRUE);
+    }
+
+  g_list_free (children);
+}
diff --git a/gnome-flashback/libdesktop/gf-monitor-view.h b/gnome-flashback/libdesktop/gf-monitor-view.h
index 51abd0c..c7d1785 100644
--- a/gnome-flashback/libdesktop/gf-monitor-view.h
+++ b/gnome-flashback/libdesktop/gf-monitor-view.h
@@ -55,6 +55,9 @@ GfIcon     *gf_monitor_view_find_next_icon (GfMonitorView    *self,
                                             GfIcon           *next_to,
                                             GtkDirectionType  direction);
 
+void        gf_monitor_view_select_icons   (GfMonitorView    *self,
+                                            GdkRectangle     *rect);
+
 G_END_DECLS
 
 #endif


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