Revision: 43599
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43599
Author:   aligorith
Date:     2012-01-22 06:10:21 +0000 (Sun, 22 Jan 2012)
Log Message:
-----------
Patch [#28608] Add search match colour to theme settings
Submitted by Shane Ambler (sambler)

>From patch description:
As a follow on from #23443 - committed in r40066 I have added the outliner
filter match highlight colour to the theme settings.

Default colour is a light green matching what was originally hard coded.

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40066

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/UI_resources.h
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/source/blender/editors/include/UI_resources.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_resources.h 2012-01-22 
05:45:56 UTC (rev 43598)
+++ trunk/blender/source/blender/editors/include/UI_resources.h 2012-01-22 
06:10:21 UTC (rev 43599)
@@ -193,8 +193,10 @@
        TH_STITCH_PREVIEW_VERT,
        TH_STITCH_PREVIEW_STITCHABLE,
        TH_STITCH_PREVIEW_UNSTITCHABLE,
-       TH_STITCH_PREVIEW_ACTIVE
+       TH_STITCH_PREVIEW_ACTIVE,
 
+       TH_MATCH,                       /* highlight color for search matches */
+       TH_SELECT_HIGHLIGHT     /* highlight color for selected outliner item */
 };
 /* XXX WARNING: previous is saved in file, so do not change order! */
 

Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c  2012-01-22 
05:45:56 UTC (rev 43598)
+++ trunk/blender/source/blender/editors/interface/resources.c  2012-01-22 
06:10:21 UTC (rev 43599)
@@ -452,6 +452,14 @@
                                cp= ts->camera_path; break;
                        case TH_LOCK_MARKER:
                                cp= ts->lock_marker; break;
+                       
+                       case TH_MATCH:
+                               cp= ts->match;
+                               break;
+                               
+                       case TH_SELECT_HIGHLIGHT:
+                               cp= ts->selected_highlight;
+                               break;
                        }
                }
        }
@@ -792,6 +800,9 @@
        btheme->toops= btheme->tv3d;
        SETCOLF(btheme->toops.back,     0.45, 0.45, 0.45, 1.0);
        
+       SETCOLF(btheme->toops.match,    0.2, 0.5, 0.2, 0.3);    /* highlighting 
search match - soft green*/
+       SETCOLF(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
+
        /* space info */
        btheme->tinfo= btheme->tv3d;
        SETCOLF(btheme->tinfo.back,     0.45, 0.45, 0.45, 1.0);
@@ -1696,17 +1707,17 @@
                        BLI_addtail(&U.addons, baddon);
                }
        }
-
+       
        if (bmain->versionfile < 260 || (bmain->versionfile == 260 && 
bmain->subversionfile < 5)) {
                bTheme *btheme;
-
+               
                for(btheme= U.themes.first; btheme; btheme= btheme->next) {
                        SETCOL(btheme->tui.panel.header, 0, 0, 0, 25);
                        btheme->tui.icon_alpha= 1.0;
                }
        }
-
-       if (bmain->versionfile < 262){
+       
+       if (bmain->versionfile < 261 || (bmain->versionfile == 261 && 
bmain->subversionfile < 4)) {
                bTheme *btheme;
                for(btheme= U.themes.first; btheme; btheme= btheme->next) {
                        SETCOLF(btheme->tima.preview_stitch_face, 0.071, 0.259, 
0.694, 0.150);
@@ -1715,10 +1726,14 @@
                        SETCOLF(btheme->tima.preview_stitch_stitchable, 0.0, 
1.0, 0.0, 1.0);
                        SETCOLF(btheme->tima.preview_stitch_unstitchable, 1.0, 
0.0, 0.0, 1.0);
                        SETCOLF(btheme->tima.preview_stitch_active, 0.886, 
0.824, 0.765, 0.140);
+                       
+                       SETCOLF(btheme->toops.match, 0.2, 0.5, 0.2, 0.3);
+                       SETCOLF(btheme->toops.selected_highlight, 0.51, 0.53, 
0.55, 0.3);
                }
+               
                U.use_16bit_textures = 0;
        }
-       
+
        /* GL Texture Garbage Collection (variable abused above!) */
        if (U.textimeout == 0) {
                U.texcollectrate = 60;

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_draw.c 
2012-01-22 05:45:56 UTC (rev 43598)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_draw.c 
2012-01-22 06:10:21 UTC (rev 43599)
@@ -1258,8 +1258,10 @@
                if ( (SEARCHING_OUTLINER(soops) || 
(soops->outlinevis==SO_DATABLOCKS && soops->search_string[0]!=0)) && 
                         (tselem->flag & TSE_SEARCHMATCH)) 
                {
-                       /* TODO - add search highlight color to theme? */
-                       glColor4f(0.2f, 0.5f, 0.2f, 0.3f);
+                       char col[4];
+                       UI_GetThemeColorType4ubv(TH_MATCH, SPACE_OUTLINER, col);
+                       col[3]=100;
+                       glColor4ubv((GLubyte *)col);
                        glRecti(startx, *starty+1, ar->v2d.cur.xmax, 
*starty+UI_UNIT_Y-1);
                }
 
@@ -1513,8 +1515,8 @@
        }
        
        /* always draw selection fill before hierarchy */
-       UI_GetThemeColor3fv(TH_BACK, col);
-       glColor3f(col[0]+0.06f, col[1]+0.08f, col[2]+0.10f);
+       UI_GetThemeColor3fv(TH_SELECT_HIGHLIGHT, col);
+       glColor3fv(col);
        starty= (int)ar->v2d.tot.ymax-UI_UNIT_Y-OL_Y_OFFSET;
        outliner_draw_selection(ar, soops, &soops->tree, &starty);
        

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h   2012-01-22 
05:45:56 UTC (rev 43598)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h   2012-01-22 
06:10:21 UTC (rev 43599)
@@ -258,6 +258,9 @@
        char preview_stitch_stitchable[4];
        char preview_stitch_unstitchable[4];
        char preview_stitch_active[4];
+       
+       char match[4];                          /* outliner - filter match */
+       char selected_highlight[4];     /* outliner - selected item */
 } ThemeSpace;
 
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c  2012-01-22 
05:45:56 UTC (rev 43598)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c  2012-01-22 
06:10:21 UTC (rev 43599)
@@ -1312,6 +1312,7 @@
 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
 {
        StructRNA *srna;
+       PropertyRNA *prop;
 
        /* space_outliner */
 
@@ -1321,6 +1322,16 @@
        RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the 
Outliner");
 
        rna_def_userdef_theme_spaces_main(srna);
+
+       prop= RNA_def_property(srna, "match", PROP_FLOAT, PROP_COLOR_GAMMA);
+       RNA_def_property_array(prop, 3);
+       RNA_def_property_ui_text(prop, "Filter Match", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+       prop= RNA_def_property(srna, "selected_highlight", PROP_FLOAT, 
PROP_COLOR_GAMMA);
+       RNA_def_property_array(prop, 3);
+       RNA_def_property_ui_text(prop, "Selected Highlight", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
 }
 
 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to