diff options
author | Ton Roosendaal <ton@blender.org> | 2003-10-20 19:40:20 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-10-20 19:40:20 +0400 |
commit | 7f5d06d638ff24444da942cf91c130d5393818cb (patch) | |
tree | 2b21f227adfb1d7f2004087e60b05c3af230d5ee /source/blender/src/header_buttonswin.c | |
parent | 628b0025836183436ab5b83120497ebe060f89b7 (diff) |
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
Diffstat (limited to 'source/blender/src/header_buttonswin.c')
-rw-r--r-- | source/blender/src/header_buttonswin.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c index ed88dd56516..68e218e33cb 100644 --- a/source/blender/src/header_buttonswin.c +++ b/source/blender/src/header_buttonswin.c @@ -89,9 +89,6 @@ Material matcopybuf; -static void unique_bone_name(Bone *bone, bArmature *arm); -static int bonename_exists(Bone *orig, char *name, ListBase *list); - void clear_matcopybuf(void) { memset(&matcopybuf, 0, sizeof(Material)); @@ -295,6 +292,7 @@ void buttons_active_id(ID **id, ID **idfrom) } } +#if 0 static void validate_bonebutton(void *bonev, void *data2_unused){ Bone *bone= bonev; bArmature *arm; @@ -303,6 +301,7 @@ static void validate_bonebutton(void *bonev, void *data2_unused){ unique_bone_name(bone, arm); } + static int bonename_exists(Bone *orig, char *name, ListBase *list) { Bone *curbone; @@ -360,7 +359,6 @@ static uiBlock *sbuts_context_menu(void *arg_unused) short yco = 0; block= uiNewBlock(&curarea->uiblocks, "context_options", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetCol(block, MENUCOL); /* should be branches from tree */ uiDefIconTextButS(block, BUTM, B_REDR, ICON_SCENE_DEHLT, "Scene|F10", 0, yco-=22, 100, 20, &G.buts->mainb, 0.0, 0.0, 0, 0, ""); @@ -380,7 +378,7 @@ static uiBlock *sbuts_context_menu(void *arg_unused) return block; } - +#endif void buts_buttons(void) { @@ -390,8 +388,10 @@ void buts_buttons(void) char naam[20]; sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin); - uiBlockSetCol(block, BUTGREY); + block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); + + if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); + else uiBlockSetCol(block, TH_HEADERDESEL); curarea->butspacetype= SPACE_BUTS; @@ -411,9 +411,6 @@ void buts_buttons(void) /* mainb menu */ /* (this could be done later with a dynamic tree and branches, also for python) */ - uiBlockSetCol(block, MIDGREY); - // uiBlockSetEmboss(block, UI_EMBOSSMB); // menu but - //{ // char mainbname[8][12]= {" Scene", " Object", " Types", " Shading", " Editing", " Script", " Logic"}; // char mainbicon[8]= {ICON_SCENE_DEHLT, ICON_OBJECT, ICON_BBOX, ICON_MATERIAL_DEHLT, ICON_EDIT, ICON_SCRIPT, ICON_GAME}; @@ -433,7 +430,7 @@ void buts_buttons(void) // if(curarea->headertype==HEADERTOP) t_base= -3; else t_base= 4; /* select the context to be drawn, per contex/tab the actual context is tested */ - uiBlockSetEmboss(block, UI_EMBOSSX); // normal + uiBlockSetEmboss(block, UI_EMBOSS); // normal switch(G.buts->mainb) { case CONTEXT_SCENE: uiDefIconButC(block, ROW, B_REDR, ICON_SCENE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_RENDER, 0, 0, "Render buttons "); |