mirror of
https://github.com/labwc/labwc.git
synced 2026-04-13 08:21:15 -04:00
[wip] Add ToggleSnapToEdge
This allows to replace the usual maximize behavior that does not
respect gaps with SnapToEdge direction="center" which does respect
gaps. It can be bound to the SSD Maximize button and Title double
click handlers in rc.xml.
Missing:
- [ ] docs
- [ ] some enum for `<snapping topMaximize="yes|no">`
like `yes|no|respect_gaps`
Ref: https://www.reddit.com/r/labwc/comments/1brvsj8/
This commit is contained in:
parent
d68376f2ac
commit
c2ddb1530d
3 changed files with 29 additions and 2 deletions
14
src/view.c
14
src/view.c
|
|
@ -1840,6 +1840,20 @@ view_edge_parse(const char *direction)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
view_toggle_snap_to_edge(struct view *view, enum view_edge edge)
|
||||
{
|
||||
assert(view);
|
||||
|
||||
if (view->tiled != edge) {
|
||||
view_snap_to_edge(view, edge, /*across_outputs*/ true,
|
||||
/*store_natural_geometry*/ true);
|
||||
} else {
|
||||
view_restore_to(view, view->natural_geometry);
|
||||
view_set_untiled(view);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
view_snap_to_edge(struct view *view, enum view_edge edge,
|
||||
bool across_outputs, bool store_natural_geometry)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue