gears: Keep gears inside screen in fullscreen mode
This commit is contained in:
+13
-8
@@ -358,18 +358,23 @@ resize_handler(struct widget *widget,
|
|||||||
int32_t width, int32_t height, void *data)
|
int32_t width, int32_t height, void *data)
|
||||||
{
|
{
|
||||||
struct gears *gears = data;
|
struct gears *gears = data;
|
||||||
|
int32_t size, big, small;
|
||||||
|
|
||||||
/* Constrain child size to be square and at least 300x300 */
|
/* Constrain child size to be square and at least 300x300 */
|
||||||
if (width > height)
|
if (width < height) {
|
||||||
height = width;
|
small = width;
|
||||||
else
|
big = height;
|
||||||
width = height;
|
} else {
|
||||||
if (width < 300) {
|
small = height;
|
||||||
width = 300;
|
big = width;
|
||||||
height = 300;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
widget_set_size(gears->widget, width, height);
|
if (gears->fullscreen)
|
||||||
|
size = small;
|
||||||
|
else
|
||||||
|
size = big;
|
||||||
|
|
||||||
|
widget_set_size(gears->widget, size, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user