From 2ca870cfc5cd6611bb1fd52dcd67ef40895ad787 Mon Sep 17 00:00:00 2001 From: lolicon0930 <14966910+lolicon0930@users.noreply.github.com> Date: Sun, 25 Jun 2023 19:41:38 +0000 Subject: [PATCH] Check if the clock is on. (closes #521) (#522) If the clock is on, then change the numlock and capslock state positions. --- src/draw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/draw.c b/src/draw.c index 6420922..0679244 100644 --- a/src/draw.c +++ b/src/draw.c @@ -454,6 +454,11 @@ void draw_lock_state(struct term_buf* buf) // print text uint16_t pos_x = buf->width - strlen(lang.numlock); + uint16_t pos_y = 1; + if (config.clock == NULL || strlen(config.clock) == 0) + { + pos_y = 0; + } if (numlock_on) { @@ -465,7 +470,7 @@ void draw_lock_state(struct term_buf* buf) } else { - tb_blit(pos_x, 0, strlen(lang.numlock), 1, numlock); + tb_blit(pos_x, pos_y, strlen(lang.numlock), 1, numlock); free(numlock); } } @@ -482,7 +487,7 @@ void draw_lock_state(struct term_buf* buf) } else { - tb_blit(pos_x, 0, strlen(lang.capslock), 1, capslock); + tb_blit(pos_x, pos_y, strlen(lang.capslock), 1, capslock); free(capslock); } }