From b13a953e11d30b891aaeff38a79c06b932fcf043 Mon Sep 17 00:00:00 2001 From: Chris Johnsen Date: Thu, 13 Aug 2026 04:10:23 -0500 Subject: [PATCH] gui/tiletypes: remove COLOR_RESET use with Pen COLOR_RESET should not be used with Pen. The original COLOR_RESET `fg` value here ended up being treated as COLOR_WHITE: for a Pen specified with just a single number, both COLORS_RESET (-1) and COLOR_WHITE (15) are decoded as "bold" grey-on-black (7-on-0) due to the masking done when decoding the Pen. The EMPTY_TOKEN is used to draw the "blank space" (non-text/non-checkbox parts) of the "more options" entries. Use of the `hpen` field overrides label text's normal "swap foreground and background" hover effect. Use UI_COLORS.HIGHLIGHTED to match the hover styling of the left side (text label) of the option entries (`OptionsPopup:init` `addOption` `left_specs` `pens_hover`). Since only a foreground color is specified for both the "left text" and the EMPTY_TOKEN, they both use Pen's default background color: black. Nicely, UI_COLORS.HIGHLIGHTED *is* COLOR_WHITE, so there isn't a visual change even if the active font has foreground pixels in its space characters (EMPTY_TOKEN is always drawn as space characters). --- gui/tiletypes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/tiletypes.lua b/gui/tiletypes.lua index 9f671db731..f018d96ae0 100644 --- a/gui/tiletypes.lua +++ b/gui/tiletypes.lua @@ -203,7 +203,7 @@ end --#region UI Utilities ---@type widgets.LabelToken -local EMPTY_TOKEN = { text=' ', hpen=dfhack.pen.make(COLOR_RESET), width=1 } +local EMPTY_TOKEN = { text=' ', hpen=UI_COLORS.HIGHLIGHTED, width=1 } ---@class InlineButtonLabelSpec ---@field left_specs? widgets.ButtonLabelSpec