mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
view: when centering, top/left align if view is bigger than usable area
This commit is contained in:
parent
0f22613952
commit
fb1af5f68e
1 changed files with 8 additions and 0 deletions
|
|
@ -155,6 +155,14 @@ view_compute_centered_position(struct view *view, int w, int h, int *x, int *y)
|
||||||
*x = usable.x + (usable.width - width) / 2;
|
*x = usable.x + (usable.width - width) / 2;
|
||||||
*y = usable.y + (usable.height - height) / 2;
|
*y = usable.y + (usable.height - height) / 2;
|
||||||
|
|
||||||
|
/* If view is bigger than usable area, just top/left align it */
|
||||||
|
if (*x < rc.gap) {
|
||||||
|
*x = rc.gap;
|
||||||
|
}
|
||||||
|
if (*y < rc.gap) {
|
||||||
|
*y = rc.gap;
|
||||||
|
}
|
||||||
|
|
||||||
#if HAVE_XWAYLAND
|
#if HAVE_XWAYLAND
|
||||||
/* TODO: refactor xwayland.c functions to get rid of this */
|
/* TODO: refactor xwayland.c functions to get rid of this */
|
||||||
if (view->type == LAB_XWAYLAND_VIEW) {
|
if (view->type == LAB_XWAYLAND_VIEW) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue