From 3c24e67a9ae600139b96a48f395e0da6fd9916f2 Mon Sep 17 00:00:00 2001 From: Kelvie Wong Date: Wed, 22 Feb 2023 17:22:04 -0800 Subject: [PATCH] Address additional PR comments on_activate is likely to happen first so we shouldn't need to check the other. --- docs/dev/Lua API.rst | 6 ++++++ library/lua/gui/widgets.lua | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 1786c9028..7ead7e374 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -3757,6 +3757,12 @@ Misc Wraps ``dfhack.screen.getKeyDisplay`` in order to allow using strings for the keycode argument. +* ``invert_color(color, bold)`` + + This inverts the brightness of ``color``. If this color is coming from a pen's + foreground color, include ``pen.bold`` in ``bold`` for this to work properly. + + ViewRect class -------------- diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index 6a1726115..3ef27a651 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -1461,7 +1461,7 @@ end function HotkeyLabel:shouldHover() -- When on_activate is set, text should also hover on mouseover - return HotkeyLabel.super.shouldHover(self) or self.on_activate + return self.on_activate or HotkeyLabel.super.shouldHover(self) end function HotkeyLabel:initializeLabel()