aboutsummaryrefslogtreecommitdiffstats
path: root/font.c
diff options
context:
space:
mode:
authorokan2013-05-14 12:35:56 +0000
committerokan2013-05-14 12:35:56 +0000
commitbd1dad402457696bc85c71879328d3c3db146164 (patch)
tree758002659a156353bce0371de43363f407bac737 /font.c
parentf33b33868923e469c45b593d6699ed2f297daf3b (diff)
downloadcwm-bd1dad402457696bc85c71879328d3c3db146164.tar.gz
- let callers of font_draw figure out (and pass) the color instead of an
'active' flag. - use strlen() inside of font_draw; the only instance where it wasn't used happened to be ignored on a subsequent draw.
Diffstat (limited to 'font.c')
-rw-r--r--font.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/font.c b/font.c
index 0b36161..1200bf7 100644
--- a/font.c
+++ b/font.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: font.c,v 1.25 2013/05/02 17:25:15 okan Exp $
+ * $OpenBSD: font.c,v 1.26 2013/05/14 12:35:56 okan Exp $
*/
#include <sys/param.h>
@@ -75,13 +75,10 @@ font_width(XftFont *xftfont, const char *text, int len)
}
void
-font_draw(struct screen_ctx *sc, const char *text, int len,
- Drawable d, int active, int x, int y)
+font_draw(struct screen_ctx *sc, const char *text,
+ Drawable d, int color, int x, int y)
{
- int color;
-
- color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
XftDrawChange(sc->xftdraw, d);
XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor[color], sc->xftfont, x, y,
- (const FcChar8*)text, len);
+ (const FcChar8*)text, strlen(text));
}