diff options
author | Ton Roosendaal <ton@blender.org> | 2004-07-22 17:40:17 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-07-22 17:40:17 +0400 |
commit | 36375b1c292873d323ff994b8be7646295471a16 (patch) | |
tree | 62b8a960500eae8d1c9bd04098b7fcd834bcc02f /source/blender/src/interface.c | |
parent | b453cd0715014b3645d1913ac8a1130d86e97e21 (diff) |
Added colorpicker support for theme editor
Diffstat (limited to 'source/blender/src/interface.c')
-rw-r--r-- | source/blender/src/interface.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 22b7189cc92..3e4f09a6640 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -2262,20 +2262,30 @@ static int ui_do_but_COL(uiBut *but) { uiBlock *block; ListBase listb={NULL, NULL}; - float hsv[3], old[3]; + float hsv[3], old[3], *poin= NULL, colstore[3]; short event; // signal to prevent calling up color picker - if(but->a1 == -1 || but->pointype!=FLO) { + if(but->a1 == -1) { uibut_do_func(but); return but->retval; } + // enable char button too, use temporal colstore for color + if(but->pointype!=FLO) { + if(but->pointype==CHA) { + ui_get_but_vectorf(but, colstore); + poin= colstore; + } + else return but->retval; + } + else poin= (float *)but->poin; + block= uiNewBlock(&listb, "colorpicker", UI_EMBOSSP, UI_HELV, but->win); block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW; block->themecol= TH_BUT_NUM; - uiBlockPickerButtons(block, (float *)but->poin, hsv, old, 't'); + uiBlockPickerButtons(block, poin, hsv, old, 't'); /* and lets go */ block->direction= UI_TOP; @@ -2283,6 +2293,8 @@ static int ui_do_but_COL(uiBut *but) block->win= G.curscreen->mainwin; event= uiDoBlocks(&listb, 0); + if(but->pointype==CHA) ui_set_but_vectorf(but, colstore); + return but->retval; } |