[gimp] Add new codes for title bar: '%e' for offsets, '%r' for rotation



commit 2746544328052989829a79343c90cb3ee57567f6
Author: Joao S. O. Bueno <gwidion gmail com>
Date:   Thu Jan 29 11:05:23 2015 -0200

    Add new codes for title bar: '%e' for offsets, '%r' for rotation

 app/display/gimpdisplayshell-title.c |   16 ++++++++++++++++
 app/display/gimpdisplayshell.c       |    5 +++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c
index 6ff4e3f..653d17c 100644
--- a/app/display/gimpdisplayshell-title.c
+++ b/app/display/gimpdisplayshell-title.c
@@ -468,6 +468,22 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
               }
               break;
 
+            case 'e': /* display's offsets in pixels */
+              {
+                gdouble scale = gimp_zoom_model_get_factor (shell->zoom);
+                gdouble offset_x = shell->offset_x / scale;
+                gdouble offset_y = shell->offset_y / scale;
+                i += print (title, title_len, i,
+                            scale >= 0.15 ? "%.0fx%.0f" : "%.2fx%.2f", offset_x, offset_y);
+              }
+            break;
+
+            case 'r': /* view rotation angle in degrees */
+              {
+                i += print (title, title_len, i, "%.1f", shell->rotate_angle);
+              }
+            break;
+
             case '\xc3': /* utf-8 extended char */
               {
                 format ++;
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 18a6193..384eff1 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -1084,11 +1084,14 @@ gimp_display_shell_real_scrolled (GimpDisplayShell *shell)
   if (! shell->display)
     return;
 
+  gimp_display_shell_title_update (shell);
+
   user_context = gimp_get_user_context (shell->display->gimp);
 
   if (shell->display == gimp_context_get_display (user_context))
     {
       gimp_display_shell_set_priority_viewport (shell);
+
     }
 }
 
@@ -1100,6 +1103,8 @@ gimp_display_shell_real_rotated (GimpDisplayShell *shell)
   if (! shell->display)
     return;
 
+  gimp_display_shell_title_update (shell);
+
   user_context = gimp_get_user_context (shell->display->gimp);
 
   if (shell->display == gimp_context_get_display (user_context))


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