From c7fdb5df2a32e21905e21193bc018c5d6fc6d326 Mon Sep 17 00:00:00 2001
From: Joel Bodenmann <joel@unormal.org>
Date: Sun, 28 Jul 2013 02:06:27 +0200
Subject: list widget first implementation

---
 src/gwin/list.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/gwin')

diff --git a/src/gwin/list.c b/src/gwin/list.c
index 8e1f2ef4..1d61f1c4 100644
--- a/src/gwin/list.c
+++ b/src/gwin/list.c
@@ -79,17 +79,17 @@ static void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
 
 	uint16_t i, fheight;
 	const gfxQueueASyncItem* qi;
-	const GColorSet*	pcol;
 
 	fheight = gdispGetFontMetric(gwinGetDefaultFont(), fontHeight);	
 
-	gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, Black);
+	gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->enabled.edge);
 	
 	for (qi = gfxQueueASyncPeek(&gcw->list_head), i = 0; qi; qi = gfxQueueASyncNext(qi), i += fheight + 2*BORDER) {
-		if (((ListItem*)qi)->flags & GLIST_FLG_SELECTED) 
-			gdispFillStringBox(gw->g.x + BORDER, gw->g.y + BORDER + i, gw->g.width - 2*BORDER, fheight, ((ListItem*)qi)->text, gwinGetDefaultFont(), White, Black, justifyLeft);
-		else
-			gdispFillStringBox(gw->g.x + BORDER, gw->g.y + BORDER + i, gw->g.width - 2*BORDER, fheight, ((ListItem*)qi)->text, gwinGetDefaultFont(), Black, White, justifyLeft);
+		if (((ListItem*)qi)->flags & GLIST_FLG_SELECTED) {
+			gdispFillStringBox(gw->g.x + BORDER, gw->g.y + BORDER + i, gw->g.width - 2*BORDER, fheight, ((ListItem*)qi)->text, gwinGetDefaultFont(), gw->pstyle->background, gw->pstyle->enabled.text, justifyLeft);
+		} else {
+			gdispFillStringBox(gw->g.x + BORDER, gw->g.y + BORDER + i, gw->g.width - 2*BORDER, fheight, ((ListItem*)qi)->text, gwinGetDefaultFont(), gw->pstyle->enabled.text, gw->pstyle->background, justifyLeft);
+		}
 	}
 
 	#undef gcw
-- 
cgit v1.2.3