[gimp] app: add a description label to the GEGL tool dialog



commit b2f318de570980216996f74a379cafc68970f35d
Author: Michael Natterer <mitch gimp org>
Date:   Mon May 20 17:42:32 2013 +0200

    app: add a description label to the GEGL tool dialog

 app/tools/gimpgegltool.c |   21 +++++++++++++++++++++
 app/tools/gimpgegltool.h |    1 +
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpgegltool.c b/app/tools/gimpgegltool.c
index efaecbc..5ff2128 100644
--- a/app/tools/gimpgegltool.c
+++ b/app/tools/gimpgegltool.c
@@ -344,6 +344,13 @@ gimp_gegl_tool_dialog (GimpImageMapTool *image_map_tool)
 
   tool->operation_combo = combo;
 
+  tool->description_label = gtk_label_new ("");
+  gtk_label_set_line_wrap (GTK_LABEL (tool->description_label), TRUE);
+  gtk_misc_set_alignment (GTK_MISC (tool->description_label), 0.0, 0.0);
+  gtk_box_pack_start (GTK_BOX (main_vbox), tool->description_label,
+                      FALSE, FALSE, 0);
+  gtk_box_reorder_child (GTK_BOX (main_vbox), tool->description_label, 1);
+
   /*  The options vbox  */
   o_tool->options_table =
     gtk_label_new (_("Select an operation from the list above"));
@@ -375,6 +382,20 @@ gimp_gegl_tool_operation_changed (GtkWidget    *widget,
 
   if (operation)
     {
+      const gchar *description;
+
+      description = gegl_operation_get_key (operation, "description");
+
+      if (description)
+        {
+          gtk_label_set_text (GTK_LABEL (tool->description_label), description);
+          gtk_widget_show (tool->description_label);
+        }
+      else
+        {
+          gtk_widget_hide (tool->description_label);
+        }
+
       gimp_operation_tool_set_operation (GIMP_OPERATION_TOOL (tool),
                                          operation, NULL);
       g_free (operation);
diff --git a/app/tools/gimpgegltool.h b/app/tools/gimpgegltool.h
index 0cee344..4e11676 100644
--- a/app/tools/gimpgegltool.h
+++ b/app/tools/gimpgegltool.h
@@ -39,6 +39,7 @@ struct _GimpGeglTool
 
   /* dialog */
   GtkWidget         *operation_combo;
+  GtkWidget         *description_label;
 };
 
 struct _GimpGeglToolClass


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