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:
authorTon Roosendaal <ton@blender.org>2005-08-15 23:46:09 +0400
committerTon Roosendaal <ton@blender.org>2005-08-15 23:46:09 +0400
commitf1609dde1151c8b5645cf142be99a349b0482753 (patch)
tree2d0ab2c3dd0aa495c0f12ad0055a583f72f9650a /source/blender/src/interface_draw.c
parent6bc3f4746bc5325d8e1ff54469ebb6929bf3bdb2 (diff)
Added new button type: ROUNDBOX
This replaces drawing with uiRoundBox() or glRect() in button Panels, which just fails for dynamic constructed button views where Panels are sometimes invisible. Also eliminates hack with PanelPop(). Error was visible with new Modifier panel, entering/exiting EditMode. Done Modifier and Constraints. Syntax: The last 4 free variables in the uiDefBut() call are: - float, corner-rounding (0.0-pixels), - not used, - short: roundbox type (bits, 1 2 4 8 for clockwise corners starting left/top) - short: color shade offset (color range 0-255)
Diffstat (limited to 'source/blender/src/interface_draw.c')
-rw-r--r--source/blender/src/interface_draw.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c
index d770409837d..92f38cbd1e8 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/src/interface_draw.c
@@ -1698,6 +1698,16 @@ static void ui_draw_but_HSVCUBE(uiBut *but)
fdrawbox((but->x1), (but->y1), (but->x2), (but->y2));
}
+static void ui_draw_roundbox(uiBut *but)
+{
+ BIF_ThemeColorShade(but->themecol, but->a2);
+
+ uiSetRoundBox(but->a1);
+ gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, but->min);
+
+}
+
+
/* nothing! */
static void ui_draw_nothing(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
{
@@ -1716,7 +1726,7 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
but->sliderfunc= ui_draw_slider;
// standard builtin first:
- if(but->type==LABEL) but->embossfunc= ui_draw_nothing;
+ if(but->type==LABEL || but->type==ROUNDBOX) but->embossfunc= ui_draw_nothing;
else if(but->type==PULLDOWN) but->embossfunc= ui_draw_pulldown_round;
else if(drawtype==UI_EMBOSSM) but->embossfunc= ui_draw_minimal;
else if(drawtype==UI_EMBOSSN) but->embossfunc= ui_draw_nothing;
@@ -1790,6 +1800,9 @@ void ui_draw_but(uiBut *but)
case INLINK:
ui_draw_icon(but, but->icon);
break;
+
+ case ROUNDBOX:
+ ui_draw_roundbox(but);
default:
but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);