Sequence Editor Themes:
authorThomas Dinges <blender@dingto.org>
Fri, 23 Mar 2012 20:50:38 +0000 (20:50 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 23 Mar 2012 20:50:38 +0000 (20:50 +0000)
* Preview Background is now themeable. Patch by Pablo Vazquez (venomgfx).

source/blender/editors/include/UI_resources.h
source/blender/editors/interface/resources.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/makesrna/intern/rna_userdef.c

index c470b13aa690ac734d287af8dff45113c70e0ac3..1531ade5ba39496c7aead15a87de196448744d98 100644 (file)
@@ -158,6 +158,7 @@ enum {
        TH_SEQ_PLUGIN,
        TH_SEQ_TRANSITION,
        TH_SEQ_META,
+       TH_SEQ_PREVIEW,
        
        TH_EDGE_SHARP,
        TH_EDITMESH_ACTIVE,
index 124ce77325b5184ed36f193d684e33a763884007..a534fe1185606a1c027a1ef9e10b824a28644516 100644 (file)
@@ -384,6 +384,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
                                cp= ts->transition; break;
                        case TH_SEQ_META:
                                cp= ts->meta; break;
+                       case TH_SEQ_PREVIEW:
+                               cp= ts->preview_back; break;
                                
                        case TH_CONSOLE_OUTPUT:
                                cp= ts->console_output; break;
@@ -770,7 +772,7 @@ void ui_theme_init_default(void)
        rgba_char_args_set(btheme->tseq.plugin,         126, 126, 80, 255);
        rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
        rgba_char_args_set(btheme->tseq.meta,   109, 145, 131, 255);
-       
+       rgba_char_args_set(btheme->tseq.preview_back,   0, 0, 0, 255);
 
        /* space image */
        btheme->tima= btheme->tv3d;
index 99888ba4a3711d2438e0c3bbc48e675a9bca6e7e..d0659cfc01d01b5fb3692ae4784cebb83d279147 100644 (file)
@@ -778,6 +778,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
        float viewrectx, viewrecty;
        float render_size = 0.0;
        float proxy_size = 100.0;
+       float col[3];
        GLuint texid;
        GLuint last_texid;
        SeqRenderData context;
@@ -805,8 +806,8 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
        }
 
        if(frame_ofs == 0) {
-               /* XXX TODO: take color from theme */
-               glClearColor(0.0, 0.0, 0.0, 0.0);
+               UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col);
+               glClearColor(col[0], col[1], col[2], 0.0);
                glClear(GL_COLOR_BUFFER_BIT);
        }
 
index 8e4ebe0b22ecd84c74e499ef4b4df93f7a4ad914..360f82226190543a4b95f3a1f3eb42db1a7d9977 100644 (file)
@@ -1799,6 +1799,12 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
        RNA_def_property_array(prop, 3);
        RNA_def_property_ui_text(prop, "Draw Action", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
+       
+       prop = RNA_def_property(srna, "preview_back", PROP_FLOAT, PROP_COLOR_GAMMA);
+       RNA_def_property_float_sdna(prop, NULL, "preview_back");
+       RNA_def_property_array(prop, 3);
+       RNA_def_property_ui_text(prop, "Preview Background", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
 }
 
 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)