aboutsummaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorokan2013-05-19 23:38:20 +0000
committerokan2013-05-19 23:38:20 +0000
commit7c22f25dc0a96380c81fbb79218bd21cf3812004 (patch)
tree7fd1e8847bcae6bca0793b2f7907e0776a9bae01 /menu.c
parent1f94cf68e821c1e6e3850f540d098737baf9ba00 (diff)
downloadcwm-7c22f25dc0a96380c81fbb79218bd21cf3812004.tar.gz
move the 2 small font helper functions to xutil.c
Diffstat (limited to '')
-rw-r--r--menu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/menu.c b/menu.c
index 1e862ba..9468a81 100644
--- a/menu.c
+++ b/menu.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: menu.c,v 1.61 2013/05/14 12:35:56 okan Exp $
+ * $OpenBSD: menu.c,v 1.62 2013/05/19 23:38:21 okan Exp $
*/
#include <sys/param.h>
@@ -367,7 +367,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
if (mc->hasprompt) {
(void)snprintf(mc->dispstr, sizeof(mc->dispstr), "%s%s%s%s",
mc->promptstr, PROMPT_SCHAR, mc->searchstr, PROMPT_ECHAR);
- mc->width = font_width(sc->xftfont, mc->dispstr,
+ mc->width = xu_xft_width(sc->xftfont, mc->dispstr,
strlen(mc->dispstr));
mc->height = sc->xftfont->height + 1;
mc->num = 1;
@@ -384,7 +384,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
text = mi->text;
}
- mc->width = MAX(mc->width, font_width(sc->xftfont, text,
+ mc->width = MAX(mc->width, xu_xft_width(sc->xftfont, text,
MIN(strlen(text), MENU_MAXENTRY)));
mc->height += sc->xftfont->height + 1;
mc->num++;
@@ -419,7 +419,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
mc->width, mc->height);
if (mc->hasprompt) {
- font_draw(sc, mc->dispstr, sc->menuwin, CWM_COLOR_MENU_FONT,
+ xu_xft_draw(sc, mc->dispstr, sc->menuwin, CWM_COLOR_MENU_FONT,
0, sc->xftfont->ascent);
n = 1;
} else
@@ -434,7 +434,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
if (mc->y + y > xine.h)
break;
- font_draw(sc, text, sc->menuwin, CWM_COLOR_MENU_FONT, 0, y);
+ xu_xft_draw(sc, text, sc->menuwin, CWM_COLOR_MENU_FONT, 0, y);
n++;
}
if (mc->hasprompt && n > 1 && (mc->searchstr[0] != '\0')) {
@@ -466,7 +466,7 @@ menu_draw_entry(struct screen_ctx *sc, struct menu_ctx *mc,
(sc->xftfont->height + 1) * entry, mc->width,
(sc->xftfont->height + 1) + sc->xftfont->descent);
color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
- font_draw(sc, text, sc->menuwin, color,
+ xu_xft_draw(sc, text, sc->menuwin, color,
0, (sc->xftfont->height + 1) * entry + sc->xftfont->ascent + 1);
}