diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index ab5b8e8..a7fe168 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -248,7 +248,10 @@ enum { TH_DRAWEXTRA_FACEAREA, TH_DRAWEXTRA_FACEANG, - TH_NODE_CURVING + TH_NODE_CURVING, + + TH_MATCH, /* highlight colour for search matches */ + TH_SELECT_HIGHLIGHT /* highlight colour for selected outliner item */ }; /* XXX WARNING: previous is saved in file, so do not change order! */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 9b9237f..6352f5d 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -416,7 +416,15 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case TH_PREVIEW_BACK: cp= ts->preview_back; - break; + break; + + case TH_MATCH: + cp= ts->match; + break; + + case TH_SELECT_HIGHLIGHT: + cp= ts->selected_highlight; + break; } } } @@ -762,7 +770,9 @@ void ui_theme_init_default(void) /* space oops */ 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); @@ -1613,6 +1623,14 @@ void init_userdef_do_versions(void) } } + if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 3)) { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + 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); + } + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 65ce2e7..dc24670 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1248,8 +1248,10 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene if ( (SEARCHING_OUTLINER(soops) || (soops->outlinevis==SO_DATABLOCKS && soops->search_string[0]!=0)) && (tselem->flag & TSE_SEARCHMATCH)) { - /* TODO - add search highlight colour 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); } @@ -1503,8 +1505,8 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio } /* 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); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 05b16f8..616f7f0 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -239,7 +239,10 @@ typedef struct ThemeSpace { char hpad[7]; char preview_back[4]; - + + char match[4]; // outliner - filter match + char selected_highlight[4]; // outliner - selected item + } ThemeSpace; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 44d645f..f56cfef 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1172,6 +1172,7 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna) static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; /* space_outliner */ @@ -1180,6 +1181,16 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner"); rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER); + + 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)