[gimp] libgimpbase, app: add abbreviations to gradient enums



commit d3e527a959376763d323818a9c5df6ccfc970fa8
Author: Ell <ell_se yahoo com>
Date:   Thu Nov 30 02:36:22 2017 -0500

    libgimpbase, app: add abbreviations to gradient enums
    
    The value descriptions of GimpGradientColor,
    GimpGradientSegmentColor, and GimpGradientSegmentType enums appear
    in the on-canvas gradient editor UI, as combo-box items in the tool
    GUI overlay.  Since we want to keep the overlay as small as
    possible, we previously used abbreviations for these descriptions
    (e.g., "FG (t)", instead of "Foreground (transparent)").
    
    Replace the abbreviated descriptions with unabbreviated ones, and
    move the abbreviations to the "abbrev" parameter.  This way we get
    the abbreviated version in the combo-box, and the full version in
    the combo-box's menu.

 app/core/core-enums.c       |   12 ++++++++++++
 app/core/core-enums.h       |   10 +++++-----
 libgimpbase/gimpbaseenums.c |   12 ++++++++++++
 libgimpbase/gimpbaseenums.h |   14 +++++++-------
 4 files changed, 36 insertions(+), 12 deletions(-)
---
diff --git a/app/core/core-enums.c b/app/core/core-enums.c
index 645c022..97e3150 100644
--- a/app/core/core-enums.c
+++ b/app/core/core-enums.c
@@ -990,9 +990,21 @@ gimp_gradient_color_get_type (void)
   static const GimpEnumDesc descs[] =
   {
     { GIMP_GRADIENT_COLOR_FIXED, NC_("gradient-color", "Fixed"), NULL },
+    { GIMP_GRADIENT_COLOR_FOREGROUND, NC_("gradient-color", "Foreground"), NULL },
+    /* Translators: this is an abbreviated version of "Foreground".
+       Keep it short. */
     { GIMP_GRADIENT_COLOR_FOREGROUND, NC_("gradient-color", "FG"), NULL },
+    { GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT, NC_("gradient-color", "Foreground (transarent)"), NULL },
+    /* Translators: this is an abbreviated version of "Foreground (transarent)".
+       Keep it short. */
     { GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT, NC_("gradient-color", "FG (t)"), NULL },
+    { GIMP_GRADIENT_COLOR_BACKGROUND, NC_("gradient-color", "Background"), NULL },
+    /* Translators: this is an abbreviated version of "Background".
+       Keep it short. */
     { GIMP_GRADIENT_COLOR_BACKGROUND, NC_("gradient-color", "BG"), NULL },
+    { GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT, NC_("gradient-color", "Background (transparent)"), NULL },
+    /* Translators: this is an abbreviated version of "Background (transparent)".
+       Keep it short. */
     { GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT, NC_("gradient-color", "BG (t)"), NULL },
     { 0, NULL, NULL }
   };
diff --git a/app/core/core-enums.h b/app/core/core-enums.h
index eb7a2ad..b7f6476 100644
--- a/app/core/core-enums.h
+++ b/app/core/core-enums.h
@@ -467,11 +467,11 @@ GType gimp_gradient_color_get_type (void) G_GNUC_CONST;
 
 typedef enum  /*< pdb-skip >*/
 {
-  GIMP_GRADIENT_COLOR_FIXED,                  /*< desc="Fixed"  >*/
-  GIMP_GRADIENT_COLOR_FOREGROUND,             /*< desc="FG"     >*/
-  GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT, /*< desc="FG (t)" >*/
-  GIMP_GRADIENT_COLOR_BACKGROUND,             /*< desc="BG"     >*/
-  GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT  /*< desc="BG (t)" >*/
+  GIMP_GRADIENT_COLOR_FIXED,                  /*< desc="Fixed"                                     >*/
+  GIMP_GRADIENT_COLOR_FOREGROUND,             /*< desc="Foreground",               abbrev="FG"     >*/
+  GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT, /*< desc="Foreground (transarent)",  abbrev="FG (t)" >*/
+  GIMP_GRADIENT_COLOR_BACKGROUND,             /*< desc="Background",               abbrev="BG"     >*/
+  GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT  /*< desc="Background (transparent)", abbrev="BG (t)" >*/
 } GimpGradientColor;
 
 
diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c
index 0c12b93..b64dafb 100644
--- a/libgimpbase/gimpbaseenums.c
+++ b/libgimpbase/gimpbaseenums.c
@@ -642,7 +642,13 @@ gimp_gradient_segment_color_get_type (void)
   static const GimpEnumDesc descs[] =
   {
     { GIMP_GRADIENT_SEGMENT_RGB, NC_("gradient-segment-color", "RGB"), NULL },
+    { GIMP_GRADIENT_SEGMENT_HSV_CCW, NC_("gradient-segment-color", "HSV (counter-clockwise hue)"), NULL },
+    /* Translators: this is an abbreviated version of "HSV (counter-clockwise hue)".
+       Keep it short. */
     { GIMP_GRADIENT_SEGMENT_HSV_CCW, NC_("gradient-segment-color", "HSV (ccw)"), NULL },
+    { GIMP_GRADIENT_SEGMENT_HSV_CW, NC_("gradient-segment-color", "HSV (clockwise hue)"), NULL },
+    /* Translators: this is an abbreviated version of "HSV (clockwise hue)".
+       Keep it short. */
     { GIMP_GRADIENT_SEGMENT_HSV_CW, NC_("gradient-segment-color", "HSV (cw)"), NULL },
     { 0, NULL, NULL }
   };
@@ -678,7 +684,13 @@ gimp_gradient_segment_type_get_type (void)
     { GIMP_GRADIENT_SEGMENT_LINEAR, NC_("gradient-segment-type", "Linear"), NULL },
     { GIMP_GRADIENT_SEGMENT_CURVED, NC_("gradient-segment-type", "Curved"), NULL },
     { GIMP_GRADIENT_SEGMENT_SINE, NC_("gradient-segment-type", "Sinusoidal"), NULL },
+    { GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING, NC_("gradient-segment-type", "Spherical (increasing)"), NULL 
},
+    /* Translators: this is an abbreviated version of "Spherical (increasing)".
+       Keep it short. */
     { GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING, NC_("gradient-segment-type", "Spherical (inc)"), NULL },
+    { GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING, NC_("gradient-segment-type", "Spherical (decreasing)"), NULL 
},
+    /* Translators: this is an abbreviated version of "Spherical (decreasing)".
+       Keep it short. */
     { GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING, NC_("gradient-segment-type", "Spherical (dec)"), NULL },
     { 0, NULL, NULL }
   };
diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h
index 3886e2b..2fb2179 100644
--- a/libgimpbase/gimpbaseenums.h
+++ b/libgimpbase/gimpbaseenums.h
@@ -347,8 +347,8 @@ GType gimp_gradient_segment_color_get_type (void) G_GNUC_CONST;
 typedef enum
 {
   GIMP_GRADIENT_SEGMENT_RGB,      /*< desc="RGB"       >*/
-  GIMP_GRADIENT_SEGMENT_HSV_CCW,  /*< desc="HSV (ccw)" >*/
-  GIMP_GRADIENT_SEGMENT_HSV_CW    /*< desc="HSV (cw)"  >*/
+  GIMP_GRADIENT_SEGMENT_HSV_CCW,  /*< desc="HSV (counter-clockwise hue)", abbrev="HSV (ccw)" >*/
+  GIMP_GRADIENT_SEGMENT_HSV_CW    /*< desc="HSV (clockwise hue)",         abbrev="HSV (cw)"  >*/
 } GimpGradientSegmentColor;
 
 
@@ -358,11 +358,11 @@ GType gimp_gradient_segment_type_get_type (void) G_GNUC_CONST;
 
 typedef enum
 {
-  GIMP_GRADIENT_SEGMENT_LINEAR,             /*< desc="Linear"          >*/
-  GIMP_GRADIENT_SEGMENT_CURVED,             /*< desc="Curved"          >*/
-  GIMP_GRADIENT_SEGMENT_SINE,               /*< desc="Sinusoidal"      >*/
-  GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING,  /*< desc="Spherical (inc)" >*/
-  GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING   /*< desc="Spherical (dec)" >*/
+  GIMP_GRADIENT_SEGMENT_LINEAR,             /*< desc="Linear"                                           >*/
+  GIMP_GRADIENT_SEGMENT_CURVED,             /*< desc="Curved"                                           >*/
+  GIMP_GRADIENT_SEGMENT_SINE,               /*< desc="Sinusoidal"                                       >*/
+  GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING,  /*< desc="Spherical (increasing)", abbrev="Spherical (inc)" >*/
+  GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING   /*< desc="Spherical (decreasing)", abbrev="Spherical (dec)" >*/
 } GimpGradientSegmentType;
 
 


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