Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRed Mser <RedMser>2020-08-27 00:53:58 +0300
committerHans Goudey <h.goudey@me.com>2020-08-27 00:53:58 +0300
commit479ce00809af30167a88525cdc7cddc704ed67ba (patch)
tree485b885c88801d8842e69ae989314b774e9f41ae /source/blender
parent8a9912eaf81bab73a12621a4c0987c37a865fe50 (diff)
UI: Use alternating row theme color in file browser
The outliner already uses the alternating row theme color as an overlay for every other row. This uses the same color for the file browser, instead of a hardcoded shading. The file browser background color is slightly tweaked to match the outliner, and the Blender Light theme is updated to use a lighter background color like the outliner. Reviewed by: Hans Goudey, Julian Eisel Differential Revision: https://developer.blender.org/D8717
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c5
-rw-r--r--source/blender/editors/space_file/file_draw.c4
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c5
3 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 1437d46bd8d..d04907872b7 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -228,6 +228,11 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
*/
{
/* Keep this block, even when empty. */
+
+ /* The new defaults for the file browser theme are the same as
+ * the outliner's, and it's less disruptive to just copy them. */
+ copy_v4_v4_uchar(btheme->space_file.back, btheme->space_outliner.back);
+ copy_v4_v4_uchar(btheme->space_file.row_alternate, btheme->space_outliner.row_alternate);
}
#undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 51e6c99ff39..7039eba7db1 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -441,7 +441,9 @@ static void draw_background(FileLayout *layout, View2D *v2d)
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformThemeColorShade(TH_BACK, -7);
+ float col_alternating[4];
+ UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating);
+ immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]);
/* alternating flat shade background */
for (i = 2; (i <= layout->rows + 1); i += 2) {
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 2cee99cd372..699e08302e7 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2478,6 +2478,11 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected File", "");
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_outliner(BlenderRNA *brna)