allow dragging by frame edge for non-resizable windows

develop
Myk Taylor 2023-05-23 15:17:01 -07:00
parent 9e4c713180
commit 6f49a0eb3d
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 4 additions and 3 deletions

@ -59,6 +59,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- `gui/blueprint`: recording of stockpile layouts and categories is now supported. note that detailed stockpile configurations will *not* be saved (yet)
- Core: For debugging purposes, you can now pass ``--disable-dfhack`` on the Dwarf Fortress commandline or specify ``DFHACK_DISABLE=1`` in the environment to disable DFHack for the current session.
- `overlay`: added links to the quickstart guide and the control panel on the DF title screen
- Window behavior: non-resizable windows now allow dragging by their frame edges by default
- `gui/autodump`: fort-mode keybinding: Ctrl-H
## Documentation

@ -4503,7 +4503,7 @@ Has attributes:
Called from ``postComputeFrame``.
* ``draggable = bool`` (default: ``false``)
* ``drag_anchors = {}`` (default: ``{title=true, frame=false, body=false}``)
* ``drag_anchors = {}`` (default: ``{title=true, frame=false/true, body=true}``)
* ``drag_bound = 'frame' or 'body'`` (default: ``'frame'``)
* ``on_drag_begin = function()`` (default: ``nil``)
* ``on_drag_end = function(bool)`` (default: ``nil``)
@ -4511,7 +4511,7 @@ Has attributes:
If ``draggable`` is set to ``true``, then the above attributes come into play
when the panel is dragged around the screen, either with the mouse or the
keyboard. ``drag_anchors`` sets which parts of the panel can be clicked on
with the left mouse button to start dragging. ``drag_bound`` configures
with the left mouse button to start dragging. The frame is a drag anchor by default only if ``resizable`` (below) is ``false``. ``drag_bound`` configures
whether the frame of the panel (if any) can be dragged outside the containing
parent's boundary. The body will never be draggable outside of the parent,
but you can allow the frame to cross the boundary by setting ``drag_bound`` to

@ -87,7 +87,7 @@ Panel.ATTRS {
function Panel:init(args)
if not self.drag_anchors then
self.drag_anchors = {title=true, frame=false, body=true}
self.drag_anchors = {title=true, frame=not self.resizable, body=true}
end
if not self.resize_anchors then
self.resize_anchors = {t=false, l=true, r=true, b=true}