[gimp] app: write "Unstable Development Version" across the empty image window



commit 91bb872d2669d4f7c9454d829bed681cd06cf200
Author: Michael Natterer <mitch gimp org>
Date:   Fri Mar 7 11:32:24 2014 +0100

    app: write "Unstable Development Version" across the empty image window

 app/display/gimpdisplayshell-callbacks.c |   37 ++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index a99d32a..427dc32 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -46,6 +46,8 @@
 #include "gimpimagewindow.h"
 #include "gimpnavigationeditor.h"
 
+#include "gimp-intl.h"
+
 
 /*  local function prototypes  */
 
@@ -502,7 +504,42 @@ static void
 gimp_display_shell_canvas_draw_drop_zone (GimpDisplayShell *shell,
                                           cairo_t          *cr)
 {
+  cairo_save (cr);
+
   gimp_display_shell_draw_background (shell, cr);
 
   gimp_cairo_draw_drop_wilber (shell->canvas, cr, shell->blink);
+
+  cairo_restore (cr);
+
+#ifdef GIMP_UNSTABLE
+  {
+    PangoLayout   *layout;
+    GtkAllocation  allocation;
+    gint           width;
+    gint           height;
+    gdouble        scale;
+
+    layout = gtk_widget_create_pango_layout (shell->canvas,
+                                             _("Unstable Development\n"
+                                               "Version"));
+    pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+
+    pango_layout_get_pixel_size (layout, &width, &height);
+    gtk_widget_get_allocation (shell->canvas, &allocation);
+
+    scale = MIN (((gdouble) allocation.width  / 2.0) / (gdouble) width,
+                 ((gdouble) allocation.height / 2.0) / (gdouble) height);
+
+    cairo_move_to (cr,
+                   (allocation.width  - (width  * scale)) / 2,
+                   (allocation.height - (height * scale)) / 2);
+
+    cairo_scale (cr, scale, scale);
+
+    pango_cairo_show_layout (cr, layout);
+
+    g_object_unref (layout);
+  }
+#endif /* GIMP_UNSTABLE */
 }


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