[gimp] Show a "folder" icon instead of a preview for empty group layers



commit e0d062aa3837d56d08045dd1773d43ec7ec07d90
Author: Michael Natterer <mitch gimp org>
Date:   Thu Aug 27 22:24:53 2009 +0200

    Show a "folder" icon instead of a preview for empty group layers

 app/widgets/gimpviewrendererlayer.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpviewrendererlayer.c b/app/widgets/gimpviewrendererlayer.c
index 35d0963..f070d08 100644
--- a/app/widgets/gimpviewrendererlayer.c
+++ b/app/widgets/gimpviewrendererlayer.c
@@ -27,6 +27,8 @@
 
 #include "widgets-types.h"
 
+#include "core/gimpcontainer.h"
+
 #include "text/gimptextlayer.h"
 
 #include "gimpviewrendererlayer.h"
@@ -69,6 +71,13 @@ gimp_view_renderer_layer_render (GimpViewRenderer *renderer,
     {
       stock_id = gimp_viewable_get_stock_id (renderer->viewable);
     }
+  else
+    {
+      GimpContainer *children = gimp_viewable_get_children (renderer->viewable);
+
+      if (children && gimp_container_get_n_children (children) == 0)
+        stock_id = GTK_STOCK_DIRECTORY;
+    }
 
   if (stock_id)
     gimp_view_renderer_default_render_stock (renderer, widget, stock_id);



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