mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
view: move MoveRelative code from action.c and restore natural geometry
This commit is contained in:
parent
c6e2f667d3
commit
cb4afadd01
3 changed files with 19 additions and 4 deletions
17
src/view.c
17
src/view.c
|
|
@ -206,8 +206,9 @@ view_move_resize(struct view *view, struct wlr_box geo)
|
|||
void
|
||||
view_resize_relative(struct view *view, int left, int right, int top, int bottom)
|
||||
{
|
||||
if (view->fullscreen || view->maximized)
|
||||
if (view->fullscreen || view->maximized) {
|
||||
return;
|
||||
}
|
||||
struct wlr_box newgeo = view->pending;
|
||||
newgeo.x -= left;
|
||||
newgeo.width += left + right;
|
||||
|
|
@ -217,6 +218,20 @@ view_resize_relative(struct view *view, int left, int right, int top, int bottom
|
|||
view_set_untiled(view);
|
||||
}
|
||||
|
||||
void
|
||||
view_move_relative(struct view *view, int x, int y)
|
||||
{
|
||||
if (view->fullscreen) {
|
||||
return;
|
||||
}
|
||||
view_maximize(view, false, /*store_natural_geometry*/ false);
|
||||
if (view_is_tiled(view)) {
|
||||
view_set_untiled(view);
|
||||
view_restore_to(view, view->natural_geometry);
|
||||
}
|
||||
view_move(view, view->pending.x + x, view->pending.y + y);
|
||||
}
|
||||
|
||||
void
|
||||
view_adjust_size(struct view *view, int *w, int *h)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue