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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-04-22 21:14:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-22 21:14:23 +0400
commit1c52e2cfa4096f3775472bd11d5ac982edc5ae3a (patch)
tree937be2dbb8dd2a251bad4be153fd71de1f94aa9c /source
parentd2f81fe5e98d3cb98bbf4e4caf97bf4738561a87 (diff)
6488 - Interface - Theme controls corner style
Made some other changes too, to border redraw, and dont draw antialiased squares when the minimal themes enabled.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/editscreen.c9
-rw-r--r--source/blender/src/interface_panel.c38
2 files changed, 35 insertions, 12 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index 4cd2ca7086b..c0fee24ba8a 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -3678,6 +3678,12 @@ void drawscredge_area(ScrArea *sa)
cpack(0x0);
+ /* Simple hack to make sure round corners arntdrawn with the minimal theme,
+ * Nothing wrong with it IMHO, but just be aware its used so the following
+ * if's never compare true with HEADERTOP or HEADERDOWN */
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
+ sa->headertype = -sa->headertype;
+
/* right border area */
if(sa->headertype==HEADERTOP) sdrawline(x2, y1, x2, y2-SCR_ROUND+1);
else if(sa->headertype==HEADERDOWN) sdrawline(x2, y1+SCR_ROUND-1, x2, y2);
@@ -3697,6 +3703,9 @@ void drawscredge_area(ScrArea *sa)
if(sa->headertype==HEADERDOWN) sdrawline(x1+SCR_ROUND-3, y1, x2-SCR_ROUND+3, y1);
else sdrawline(x1, y1, x2, y1);
+ /* restore real header type */
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
+ sa->headertype = -sa->headertype;
}
/* ********************************* */
diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c
index 4bf572b7ca4..bafc544daa7 100644
--- a/source/blender/src/interface_panel.c
+++ b/source/blender/src/interface_panel.c
@@ -102,8 +102,14 @@ static int roundboxtype= 15;
void uiSetRoundBox(int type)
{
- roundboxtype= type;
-
+ /* Not sure the roundbox function is the best place to change this
+ * if this is undone, its not that big a deal, only makes curves edges
+ * square for the */
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
+ roundboxtype= 0;
+ else
+ roundboxtype= type;
+
/* flags to set which corners will become rounded:
1------2
@@ -204,8 +210,10 @@ void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy
coldown[1]= color[1]+shadedown; if(coldown[1]<0.0) coldown[1]= 0.0;
coldown[2]= color[2]+shadedown; if(coldown[2]<0.0) coldown[2]= 0.0;
- glShadeModel(GL_SMOOTH);
- glBegin(mode);
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
+ glShadeModel(GL_SMOOTH);
+ glBegin(mode);
+ }
/* start with corner right-bottom */
if(roundboxtype & 4) {
@@ -350,12 +358,14 @@ void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad,
//if(active)
// gl_round_box_shade(GL_POLYGON, minx, miny, maxx, maxy, rad, 0.10, -0.05);
// else
- /* shading doesnt work for certain buttons yet (pulldown) need smarter buffer caching (ton) §*/
+ /* shading doesnt work for certain buttons yet (pulldown) need smarter buffer caching (ton) */
gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad);
/* set antialias line */
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ }
/* top shade */
gl_round_box_topshade(minx+1, miny+1, maxx-1, maxy-1, rad);
@@ -388,8 +398,10 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad)
}
/* set antialias line */
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ }
gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
@@ -415,9 +427,11 @@ void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad)
gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad);
/* set antialias line */
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
-
+ if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ }
+
gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
glDisable( GL_BLEND );