diff options
author | Matt Ebb <matt@mke3.net> | 2006-12-29 07:46:47 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2006-12-29 07:46:47 +0300 |
commit | 376ee50d3e94c01707ae433e3642ec685e3b25cd (patch) | |
tree | 5c833717be4ef9f7d140d6ac99ddc9171b491fa1 /source/blender/src/resources.c | |
parent | 37c42e2949fc3ed9bdc0e25ab2a79fe8cd573842 (diff) |
* Dynamic icon file loading and themeability
This patch allows icon files (.png) to be loaded into Blender dynamically,
without having to go through the tedious and technical process of compiling
them in. It also makes them part of the theme settings so they can be
attached as part of a theme and saved in the default .B.blend.
Icon files should be stored in $HOME/.blender/icons/ . This really sucks on
Mac since it's hidden in the finder, but it's a separate issue. We need a
better system of finding things like this, python scripts etc, perhaps a
nice wrapped function something like BLI_getresourcedir(), then it's easy to
do platform specific stuff there, like using ~/Library/Application Data on Mac.
More info and docs in the patch tracker @
https://projects.blender.org/tracker/index.php?func=detail&aid=5334&group_id=9&atid=127
Diffstat (limited to 'source/blender/src/resources.c')
-rw-r--r-- | source/blender/src/resources.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index ac12a0df14c..e1146951ea7 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -133,7 +133,10 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) case TH_BUT_DRAWTYPE: cp= &btheme->tui.but_drawtype; break; - + + case TH_ICONFILE: + cp= btheme->tui.iconfile; break; + case TH_REDALERT: cp= alert; break; case TH_CUSTOM: @@ -360,6 +363,8 @@ void BIF_InitTheme(void) SETCOL(btheme->tui.menu_text_hi, 255, 255, 255, 255); btheme->tui.but_drawtype= TH_SHADED; + BLI_strncpy(btheme->tui.iconfile, "", sizeof(btheme->tui.iconfile)); + /* space view3d */ SETCOL(btheme->tv3d.back, 115, 115, 115, 255); SETCOL(btheme->tv3d.text, 0, 0, 0, 255); @@ -547,6 +552,8 @@ char *BIF_ThemeColorsPup(int spacetype) str += sprintf(str, "Menu Text Highlight %%x%d|", TH_MENU_TEXT_HI); str += sprintf(str, "%%l|"); str += sprintf(str, "Drawtype %%x%d|", TH_BUT_DRAWTYPE); + str += sprintf(str, "%%l|"); + str += sprintf(str, "Icon File %%x%d|", TH_ICONFILE); } else { // first defaults for each space |