[Bf-blender-cvs] [68c12c80e50] master: Theme: add color difference for every other row

Campbell Barton noreply at git.blender.org
Thu May 16 04:08:34 CEST 2019


Commit: 68c12c80e501803f88b62f5f6f0f6a56bb53f303
Author: Campbell Barton
Date:   Thu May 16 11:54:50 2019 +1000
Branches: master
https://developer.blender.org/rB68c12c80e501803f88b62f5f6f0f6a56bb53f303

Theme: add color difference for every other row

D4862 by @CandleComet with minor edits.

===================================================================

M	release/datafiles/userdef/userdef_default_theme.c
M	release/scripts/presets/interface_theme/blender_light.xml
M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/resources.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 3347d9b3df8..2326b4652a9 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -749,6 +749,7 @@ const bTheme U_theme_default = {
     .facedot_size = 4,
     .match = RGBA(0x337f334c),
     .selected_highlight = RGBA(0x314e784c),
+    .row_alternate = RGBA(0x91919110),
   },
   .space_node = {
     .back = RGBA(0x23232300),
diff --git a/release/scripts/presets/interface_theme/blender_light.xml b/release/scripts/presets/interface_theme/blender_light.xml
index d2d68d3fa60..766c91cb45c 100644
--- a/release/scripts/presets/interface_theme/blender_light.xml
+++ b/release/scripts/presets/interface_theme/blender_light.xml
@@ -983,6 +983,7 @@
       <ThemeOutliner
         match="#337f33"
         selected_highlight="#314e78"
+        row_alternate="#3f3f3f1a"
         >
         <space>
           <ThemeSpaceGeneric
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index a36ead4630e..ccf760d891e 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -27,7 +27,7 @@
  * \note Use #STRINGIFY() rather than defining with quotes.
  */
 #define BLENDER_VERSION 280
-#define BLENDER_SUBVERSION 64
+#define BLENDER_SUBVERSION 65
 /** Several breakages with 280, e.g. collections vs layers. */
 #define BLENDER_MINVERSION 280
 #define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 909334ae26f..574f708764f 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -134,6 +134,10 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
     FROM_DEFAULT_V4_UCHAR(space_clip.scrubbing_background);
   }
 
+  if (!USER_VERSION_ATLEAST(280, 65)) {
+    FROM_DEFAULT_V4_UCHAR(space_outliner.row_alternate);
+  }
+
   /**
    * Include next version bump.
    */
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 7abc27c5b37..7a88cf02679 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -255,6 +255,7 @@ typedef enum ThemeColorID {
 
   TH_MATCH,            /* highlight color for search matches */
   TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
+  TH_ROW_ALTERNATE,    /* overlay on every other row */
 
   TH_SKIN_ROOT,
 
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 14fad2f3072..9f64643a4f0 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -795,6 +795,10 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
           cp = ts->selected_highlight;
           break;
 
+        case TH_ROW_ALTERNATE:
+          cp = ts->row_alternate;
+          break;
+
         case TH_SKIN_ROOT:
           cp = ts->skin_root;
           break;
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 6547b46a6e6..9801eba872c 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3198,7 +3198,10 @@ static void outliner_back(ARegion *ar)
   uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
 
   immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-  immUniformThemeColorShade(TH_BACK, 6);
+
+  float col_alternating[4];
+  UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating);
+  immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]);
 
   const float x1 = 0.0f, x2 = ar->v2d.cur.xmax;
   float y1 = ystart, y2;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 2247ec2e6ee..43191ec97d7 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -363,6 +363,8 @@ typedef struct ThemeSpace {
   char match[4];
   /** Outliner - selected item. */
   char selected_highlight[4];
+  /** Outliner - row color difference. */
+  char row_alternate[4];
 
   /** Skin modifier root color. */
   char skin_root[4];
@@ -374,7 +376,6 @@ typedef struct ThemeSpace {
   char anim_non_active[4];
   /** Preview range overlay. */
   char anim_preview_range[4];
-  char _pad2[4];
 
   /** NLA 'Tweaking' action/strip. */
   char nla_tweaking[4];
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 38877ba6fdd..367d0af1078 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2235,6 +2235,11 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
   RNA_def_property_array(prop, 3);
   RNA_def_property_ui_text(prop, "Selected Highlight", "");
   RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
+  prop = RNA_def_property(srna, "row_alternate", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_array(prop, 4);
+  RNA_def_property_ui_text(prop, "Alternate Rows", "Overlay color on every other row");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
 }
 
 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)



More information about the Bf-blender-cvs mailing list