Skip to content

Commit 6eaf98b

Browse files
committed
info sort overlay: use interface width in resize_overlay
The DF info window is based on the interface area, not the full window area. So the sort info overlays should also work with the interface width instead of the window width. If DF is configured to use an interface percentage smaller than 100, then the interface area will be narrower than the full window once the window is resized beyond the minimum width. Basing the info sort overlay size on the window size can let some UI elements extend outside the footprint of the info window. For example, when the DF interface percentage is set to 90, the search box for the Task tab - is too close to the info window border at window widths 115 and 147 - shares a edge with the info window border at window widths 116 and 146 - extends beyond the info window border for window widths 117-145
1 parent fce63b7 commit 6eaf98b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/lua/sort/info.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ function InfoOverlay:get_key()
278278
end
279279

280280
function resize_overlay(self)
281-
local sw = dfhack.screen.getWindowSize()
282-
local overlay_width = math.min(40, sw-(self.frame_rect.x1 + 30))
281+
local iw = gui.get_interface_rect().width
282+
local overlay_width = math.min(40, iw - (self.frame_rect.x1 + 30))
283283
if overlay_width ~= self.frame.w then
284284
self.frame.w = overlay_width
285285
return true

0 commit comments

Comments
 (0)