From 566d35036961dbe2c786b70a2972ca77055420a6 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 20 Dec 2012 16:50:39 +0000 Subject: UI todo: - Recoded soft shadow drawing for menus, giving better predictable results (and round off nicer on top side, was looking bad still) - Brought it under DPI control - Added Theme setting to control size and strength for it. Max size 24 pix: http://wiki.blender.org/index.php/File:MenuShadow.png --- source/blender/editors/interface/resources.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/blender/editors/interface/resources.c') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 3036961d279..4127c1b9abc 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -677,6 +677,9 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tui.yaxis, 0, 220, 0, 255); rgba_char_args_set(btheme->tui.zaxis, 0, 0, 220, 255); + btheme->tui.menu_shadow_fac = 0.5f; + btheme->tui.menu_shadow_width = 12; + /* Bone Color Sets */ ui_theme_init_boneColorSets(btheme); @@ -1259,6 +1262,12 @@ void UI_ThemeClearColor(int colorid) glClearColor(col[0], col[1], col[2], 0.0); } +int UI_ThemeMenuShadowWidth(void) +{ + bTheme *btheme = UI_GetTheme(); + return (int)(btheme->tui.menu_shadow_width * UI_DPI_FAC); +} + void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], const char axis) { unsigned char col[3]; @@ -2061,6 +2070,17 @@ void init_userdef_do_versions(void) } } + if (bmain->versionfile < 266) { + bTheme *btheme; + + for (btheme = U.themes.first; btheme; btheme = btheme->next) { + /* rna definition limits fac to 0.01 */ + if (btheme->tui.menu_shadow_fac == 0.0f) { + btheme->tui.menu_shadow_fac = 0.5f; + btheme->tui.menu_shadow_width = 12; + } + } + } if (U.pixelsize == 0.0f) U.pixelsize = 1.0f; -- cgit v1.2.3