about summary refs log tree commit diff
path: root/keyboard.c
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-01-20 16:44:39 -0500
committerZach DeCook <zachdecook@librem.one>2022-01-20 21:08:36 -0500
commitb47bac490ec77a4870c344e576dc8a72f7af8e05 (patch)
tree92103eb8b0f5de100d148c94154da1c4bfb2b94a /keyboard.c
parent5c1b9655b8a76403991e3f0f81d53e1489295583 (diff)
downloadsuggpicker-b47bac490ec77a4870c344e576dc8a72f7af8e05.tar.gz
layout: Remove width
Diffstat (limited to 'keyboard.c')
-rw-r--r--keyboard.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/keyboard.c b/keyboard.c
index ee50827..a964c34 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -44,10 +44,10 @@ kbd_init_layout(struct layout *l, uint32_t width, uint32_t height) {
 			y += l->keyheight;
 			x = 0;
 			rowlength = kbd_get_row_length(k + 1);
-		} else if (k->width > 0) {
+		} else if (k->type == Code) {
 			k->x = x;
 			k->y = y;
-			k->w = ((double)width / rowlength) * k->width;
+			k->w = width / rowlength;
 			x += k->w;
 		}
 		k->h = l->keyheight;
@@ -59,7 +59,7 @@ double
 kbd_get_row_length(struct key *k) {
 	double l = 0.0;
 	while ((k->type != Last) && (k->type != EndRow)) {
-		l += k->width;
+		l += 1.0;
 		k++;
 	}
 	return l;
@@ -132,7 +132,7 @@ kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type type) {
 	if (kb->debug)
 		fprintf(stderr, "Draw key +%d+%d %dx%d -> %s\n", k->x, k->y, k->w, k->h,
 		        label);
-	struct clr_scheme *scheme = (k->scheme == 0) ? &(kb->scheme) : &(kb->scheme1);
+	struct clr_scheme *scheme = &(kb->scheme);
 	switch (type) {
 	case Unpress:
 		draw_inset(d, k->x, k->y, k->w, k->h, KBD_KEY_BORDER, scheme->fg);