diff options
author | Kevin Lange <klange@ogunderground.com> | 2008-01-27 14:19:53 -0500 |
---|---|---|
committer | Dennis kasprzyk <onestone@opencompositing.org> | 2008-01-27 20:25:20 +0100 |
commit | b2c357df90bc6f9f0acafdfd57b5109688114c70 (patch) | |
tree | 1464a0f42e084b8ca375c7a250b357d1bf2042a6 /3d.c | |
parent | 4617061daed9eafcd54d69edbfa3e3f66ca3bbb5 (diff) | |
download | 3d-b2c357df90bc6f9f0acafdfd57b5109688114c70.tar.gz 3d-b2c357df90bc6f9f0acafdfd57b5109688114c70.tar.bz2 |
[PATCH] Added option to use custom colors for window borders
Diffstat (limited to '3d.c')
-rw-r--r-- | 3d.c | 34 |
1 files changed, 14 insertions, 20 deletions
@@ -11,6 +11,7 @@ * Danny Baumann <maniac@opencompositing.org> * Robert Carr <racarr@beryl-project.org> * Diogo Ferreira <diogo@underdev.org> + * Kevin Lange <klange@ogunderground.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -278,9 +279,16 @@ tdPaintWindowWithDepth (CompWindow *w, glDisable (GL_CULL_FACE); glEnable (GL_BLEND); - + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin (GL_QUADS); - glColor4f (0.90f, 0.90f, 0.90f, w->paint.opacity / OPAQUE); + unsigned short *c; + if (w->id == s->display->activeWindow) + c = tdGetWidthColor(s); + else + c = tdGetWidthColorInactive(s); + int temp = c[3] * w->paint.opacity; + temp /= 0xffff; + glColor4us(c[0],c[1],c[2],temp); point.z = 0.0f; point.w = 1.0f; @@ -299,10 +307,8 @@ tdPaintWindowWithDepth (CompWindow *w, /* Right */ ADDQUAD (wx + ww - 0.01, wy + DOBEVEL (Topright), - wx + ww - 0.01, wy + wh - DOBEVEL (Bottomright)); - - glColor4f (0.95f, 0.95f, 0.95f, w->paint.opacity / OPAQUE); - + wx + ww - 0.01, wy + wh - DOBEVEL (Bottomright));\ + /* Top left bevel */ if (tdGetBevelTopleft (s)) { @@ -310,13 +316,10 @@ tdPaintWindowWithDepth (CompWindow *w, wx + bevel / 2.0f, wy + bevel - bevel / 1.2f, &tds->bTransform, transform); - glColor4f (1.0f, 1.0f, 1.0f, w->paint.opacity / OPAQUE); - ADDBEVELQUAD (wx + bevel / 2.0f, wy + bevel - bevel / 1.2f, wx + bevel, wy, transform, &tds->bTransform); - glColor4f (0.95f, 0.95f, 0.95f, w->paint.opacity / OPAQUE); } /* Bottom left bevel */ @@ -326,15 +329,11 @@ tdPaintWindowWithDepth (CompWindow *w, wx + bevel / 2.0f, wy + wh - bevel + bevel / 1.2f, transform, &tds->bTransform); - glColor4f (1.0f, 1.0f, 1.0f, w->paint.opacity / OPAQUE); - ADDBEVELQUAD (wx + bevel / 2.0f, wy + wh - bevel + bevel / 1.2f, wx + bevel, wy + wh, &tds->bTransform, transform); } - glColor4f (0.95f, 0.95f, 0.95f, w->paint.opacity / OPAQUE); - /* Bottom right bevel */ if (tdGetBevelBottomright (s)) { @@ -343,14 +342,11 @@ tdPaintWindowWithDepth (CompWindow *w, wy + wh - bevel + bevel / 1.2f, transform, &tds->bTransform); - glColor4f (1.0f, 1.0f, 1.0f, w->paint.opacity / OPAQUE); - ADDBEVELQUAD (wx + ww - bevel / 2.0f, wy + wh - bevel + bevel / 1.2f, wx + ww, wy + wh - bevel, &tds->bTransform, transform); - glColor4f (0.95f, 0.95f, 0.95f, w->paint.opacity / OPAQUE); } /* Top right bevel */ @@ -360,13 +356,12 @@ tdPaintWindowWithDepth (CompWindow *w, wx + ww - bevel / 2.0f, wy + bevel - bevel / 1.2f, transform, &tds->bTransform); - glColor4f (1.0f, 1.0f, 1.0f, w->paint.opacity / OPAQUE); - ADDBEVELQUAD (wx + ww - bevel / 2.0f, wy + bevel - bevel / 1.2f, wx + ww, wy + bevel, &tds->bTransform, transform); } - + glColor4usv (defaultColor); + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glEnd (); glPopMatrix (); @@ -401,7 +396,6 @@ tdPaintWindowWithDepth (CompWindow *w, status = (*s->paintWindow) (w, attrib, transform, region, mask); WRAP (tds, s, paintWindow, tdPaintWindow); } - glCullFace (cull); if (!wasCulled) |