diff --git a/docs/changelog.txt b/docs/changelog.txt index c4e1fed4e..ea2c6abd7 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -70,6 +70,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - Added functions reverse-engineered from ambushing unit code: ``Units::isHidden``, ``Units::isFortControlled``, ``Units::getOuterContainerRef``, ``Items::getOuterContainerRef`` ## Lua +- ``widgets.ListBox``: minimum height of dialog is now calculated correctly when there are no items in the list (e.g. when a filter doesn't match anything) - Lua wrappers for functions reverse-engineered from ambushing unit code: ``isHidden(unit)``, ``isFortControlled(unit)``, ``getOuterContainerRef(unit)``, ``getOuterContainerRef(item)`` - ``dwarfmode.enterSidebarMode()``: passing ``df.ui_sidebar_mode.DesignateMine`` now always results in you entering ``DesignateMine`` mode and not ``DesignateChopTrees``, even when you looking at the surface where the default designation mode is ``DesignateChopTrees`` - New string class function: ``string:escape_pattern()`` escapes regex special characters within a string diff --git a/library/lua/gui/dialogs.lua b/library/lua/gui/dialogs.lua index 7e970ea85..5d2a35197 100644 --- a/library/lua/gui/dialogs.lua +++ b/library/lua/gui/dialogs.lua @@ -212,10 +212,10 @@ function ListBox:onRenderFrame(dc,rect) end function ListBox:getWantedFrameSize() - local mw, mh = InputBox.super.getWantedFrameSize(self) + local mw, mh = ListBox.super.getWantedFrameSize(self) local list = self.subviews.list list.frame.t = mh+1 - return math.max(mw, list:getContentWidth()), mh+1+math.min(20,list:getContentHeight()) + return math.max(mw, list:getContentWidth()), mh+3+math.min(18,list:getContentHeight()) end function ListBox:onInput(keys)