Merge pull request #2735 from myk002/myk_resizable

only mark the border corner as resizable if the window is resizable
develop
Myk 2023-01-28 11:55:39 -08:00 committed by GitHub
commit 255307890b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

@ -46,6 +46,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- `gui/quickcmd`: now has it's own global keybinding for your convenience: Ctrl-Shift-A
- Many DFHack windows can now be unfocused by clicking somewhere not over the tool window. This has the same effect as pinning previously did, but without the extra clicking.
- `overlay`: overlay widgets can now specify a default enabled state if they are not already set in the player's overlay config file
-@ New borders for DFHack tool windows -- tell us what you think!
## Documentation

@ -888,13 +888,17 @@ THIN_FRAME = make_frame('Thin', false)
-- for compatibility with pre-steam code
GREY_LINE_FRAME = WINDOW_FRAME
function paint_frame(dc,rect,style,title,inactive, pause_forced)
function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable)
local pen = style.frame_pen
local x1,y1,x2,y2 = dc.x1+rect.x1, dc.y1+rect.y1, dc.x1+rect.x2, dc.y1+rect.y2
dscreen.paintTile(style.lt_frame_pen or pen, x1, y1)
dscreen.paintTile(style.rt_frame_pen or pen, x2, y1)
dscreen.paintTile(style.lb_frame_pen or pen, x1, y2)
dscreen.paintTile(style.rb_frame_pen or pen, x2, y2)
local rb_frame_pen = style.rb_frame_pen
if rb_frame_pen == WINDOW_FRAME.rb_frame_pen and not resizable then
rb_frame_pen = PANEL_FRAME.rb_frame_pen
end
dscreen.paintTile(rb_frame_pen or pen, x2, y2)
dscreen.fillRect(style.t_frame_pen or style.h_frame_pen or pen,x1+1,y1,x2-1,y1)
dscreen.fillRect(style.b_frame_pen or style.h_frame_pen or pen,x1+1,y2,x2-1,y2)
dscreen.fillRect(style.l_frame_pen or style.v_frame_pen or pen,x1,y1+1,x1,y2-1)

@ -502,7 +502,7 @@ function Panel:onRenderFrame(dc, rect)
and not self.parent_view:hasFocus()
local pause_forced = self.parent_view and self.parent_view.force_pause
gui.paint_frame(dc, rect, self.frame_style, self.frame_title, inactive,
pause_forced)
pause_forced, self.resizable)
if self.kbd_get_pos then
local pos = self.kbd_get_pos()
local pen = to_pen{fg=COLOR_GREEN, bg=COLOR_BLACK}