shithub: choc

Download patch

ref: 12c984cff816ca46aff78ddeb9a7ce018cf4bc5c
parent: 700644d667a3bd257881f662b1525cbe7f5cc26e
author: Simon Howard <[email protected]>
date: Fri Dec 28 11:25:55 EST 2018

textscreen: Use cyan bg for window action hover.

This makes the hover background consistent with other widgets instead
of giving a black background that is inconsistent. As part of this,
change the foreground text color when hovering so that the foreground
does not clash with the background, and the text stays readable.

--- a/textscreen/txt_window_action.c
+++ b/textscreen/txt_window_action.c
@@ -43,17 +43,16 @@
 static void TXT_WindowActionDrawer(TXT_UNCAST_ARG(action))
 {
     TXT_CAST_ARG(txt_window_action_t, action);
+    int hovering;
     char buf[10];
 
     TXT_GetKeyDescription(action->key, buf, sizeof(buf));
 
-    if (TXT_HoveringOverWidget(action))
-    {
-        TXT_BGColor(TXT_COLOR_BLACK, 0);
-    }
+    hovering = TXT_HoveringOverWidget(action);
+    TXT_SetWidgetBG(action);
 
     TXT_DrawString(" ");
-    TXT_FGColor(TXT_COLOR_BRIGHT_GREEN);
+    TXT_FGColor(hovering ? TXT_COLOR_BRIGHT_WHITE : TXT_COLOR_BRIGHT_GREEN);
     TXT_DrawString(buf);
     TXT_FGColor(TXT_COLOR_BRIGHT_CYAN);
     TXT_DrawString("=");