Merge pull request #3417 from myk002/myk_draggable_frame

allow dragging by frame edge for non-resizable windows
develop
Myk 2023-05-25 17:18:40 -07:00 committed by GitHub
commit 906b1570b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

@ -60,6 +60,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}