summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lange <klange@ogunderground.com>2008-01-27 14:19:53 -0500
committerDennis kasprzyk <onestone@opencompositing.org>2008-01-27 20:25:20 +0100
commitb2c357df90bc6f9f0acafdfd57b5109688114c70 (patch)
tree1464a0f42e084b8ca375c7a250b357d1bf2042a6
parent4617061daed9eafcd54d69edbfa3e3f66ca3bbb5 (diff)
download3d-b2c357df90bc6f9f0acafdfd57b5109688114c70.tar.gz
3d-b2c357df90bc6f9f0acafdfd57b5109688114c70.tar.bz2
[PATCH] Added option to use custom colors for window borders
-rw-r--r--3d.c34
-rw-r--r--3d.xml.in20
2 files changed, 34 insertions, 20 deletions
diff --git a/3d.c b/3d.c
index 0d4ba60..ec3532b 100644
--- a/3d.c
+++ b/3d.c
@@ -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)
diff --git a/3d.xml.in b/3d.xml.in
index 545ac1e..6776430 100644
--- a/3d.xml.in
+++ b/3d.xml.in
@@ -65,6 +65,26 @@
<min>0</min>
<max>20</max>
</option>
+ <option name="width_color" type="color">
+ <_short>Window Color (Active)</_short>
+ <_long>Color of the active window's depth</_long>
+ <default>
+ <red>0x3333</red>
+ <green>0x3333</green>
+ <blue>0x3333</blue>
+ <alpha>0xffff</alpha>
+ </default>
+ </option>
+ <option name="width_color_inactive" type="color">
+ <_short>Window Color (Inactive)</_short>
+ <_long>Color of an inactive window's depth</_long>
+ <default>
+ <red>0x3333</red>
+ <green>0x3333</green>
+ <blue>0x3333</blue>
+ <alpha>0xffff</alpha>
+ </default>
+ </option>
<subgroup>
<_short>Bevel Corners</_short>
<option name="bevel_topleft" type="bool">