UI: add NLA track and channel theme color
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 2 Oct 2019 16:36:51 +0000 (18:36 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 2 Oct 2019 16:56:34 +0000 (18:56 +0200)
Patch contributed by Paul (Thirio).

Differential Revision: https://developer.blender.org/D5967

release/datafiles/userdef/userdef_default_theme.c
source/blender/blenloader/intern/versioning_userdef.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/resources.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 80bed03debf89815773fb9d4751745dcce5f17c1..0b9e8beccc1d9de8a70d3eee0d656d4966b1a2a4 100644 (file)
@@ -585,6 +585,7 @@ const bTheme U_theme_default = {
     .anim_preview_range = RGBA(0xa14d0066),
     .nla_tweaking = RGBA(0x4df31a4d),
     .nla_tweakdupli = RGBA(0xd90000ff),
+    .nla_track = RGBA(0x424242ff),
     .nla_transition = RGBA(0x1c2630ff),
     .nla_transition_sel = RGBA(0x2e75dbff),
     .nla_meta = RGBA(0x332642ff),
@@ -746,12 +747,12 @@ const bTheme U_theme_default = {
       .back = RGBA(0x333333b3),
       .sub_back = RGBA(0x0000003e),
     },
+    .active = RGBA(0x3b5689ff),
     .vertex_size = 3,
     .outline_width = 1,
     .facedot_size = 4,
     .match = RGBA(0x337f334c),
     .selected_highlight = RGBA(0x223a5bff),
-    .active = RGBA(0x3b5689ff),
     .selected_object = RGBA(0xe96a00ff),
     .active_object = RGBA(0xffaf29ff),
     .edited_object = RGBA(0x00806266),
index bbae1c8e85e76399d731bd5ba565eb4ca5e45719..e769e72d8e1c9ced9b596ecbbd6e687c838f2404 100644 (file)
@@ -154,6 +154,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
     FROM_DEFAULT_V4_UCHAR(tui.icon_folder);
     FROM_DEFAULT_V4_UCHAR(space_clip.path_keyframe_before);
     FROM_DEFAULT_V4_UCHAR(space_clip.path_keyframe_after);
+    copy_v4_v4_uchar(btheme->space_nla.nla_track, btheme->space_nla.header);
   }
 
 #undef FROM_DEFAULT_V4_UCHAR
index d80b96f0d7416caa951ceb0a782abb7ee8189374..8951677b32ff5cac640b9c43d4bb646075b00f76 100644 (file)
@@ -3411,7 +3411,7 @@ static void acf_nlatrack_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, flo
   }
 
   /* set color for nla track */
-  UI_GetThemeColorShade3fv(TH_HEADER, ((nonSolo == false) ? 20 : -20), r_color);
+  UI_GetThemeColorShade3fv(TH_NLA_TRACK, ((nonSolo == false) ? 20 : -20), r_color);
 }
 
 /* name for nla track entries */
index 76ab4a53eb83a7e3d7e395adac82c4043fde919f..89579b88d2478ab0f479fdcf2874b31a7be1f76f 100644 (file)
@@ -283,6 +283,7 @@ typedef enum ThemeColorID {
   TH_NLA_TWEAK,       /* 'tweaking' track in NLA */
   TH_NLA_TWEAK_DUPLI, /* error/warning flag for other strips referencing dupli strip */
 
+  TH_NLA_TRACK,
   TH_NLA_TRANSITION,
   TH_NLA_TRANSITION_SEL,
   TH_NLA_META,
index 8a570933a3303e385270545c21d876267d4140e4..c9bfafbe764c9d4a2a627dce06f7f5fa86c6654d 100644 (file)
@@ -841,6 +841,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
           cp = ts->nla_tweakdupli;
           break;
 
+        case TH_NLA_TRACK:
+          cp = ts->nla_track;
+          break;
         case TH_NLA_TRANSITION:
           cp = ts->nla_transition;
           break;
index f36802d33b357fca11a24bbd011573012279815e..75f29695eb365a58d81c52ea30967d5c3e904961 100644 (file)
@@ -394,6 +394,8 @@ typedef struct ThemeSpace {
   /** NLA - warning color for duplicate instances of tweaking strip. */
   unsigned char nla_tweakdupli[4];
 
+  /** NLA "Track" */
+  unsigned char nla_track[4];
   /** NLA "Transition" strips. */
   unsigned char nla_transition[4], nla_transition_sel[4];
   /** NLA "Meta" strips. */
@@ -414,7 +416,6 @@ typedef struct ThemeSpace {
   unsigned char metadatabg[4];
   unsigned char metadatatext[4];
 
-  char _pad2[4];
 } ThemeSpace;
 
 /* set of colors for use as a custom color set for Objects/Bones wire drawing */
index 078af30e36cd6d36cd12196de35160c50c03059e..f08a3ce93a10d440f7c3a5e7f53ad0b679c119ad 100644 (file)
@@ -3201,6 +3201,18 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "View Sliders", "");
   RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
 
+  prop = RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "ds_channel");
+  RNA_def_property_array(prop, 3);
+  RNA_def_property_ui_text(prop, "Channel", "Nonlinear Animation Channel");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
+  prop = RNA_def_property(srna, "nla_track", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "nla_track");
+  RNA_def_property_array(prop, 3);
+  RNA_def_property_ui_text(prop, "Track", "Nonlinear Animation Track");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
   prop = RNA_def_property(srna, "active_action", PROP_FLOAT, PROP_COLOR_GAMMA);
   RNA_def_property_float_sdna(prop, NULL, "anim_active");
   RNA_def_property_array(prop, 4);