summaryrefslogtreecommitdiff
path: root/new/container_unix.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-09 15:18:18 -0400
committerPietro Gagliardi <[email protected]>2015-04-09 15:18:18 -0400
commitd1461673210f8616bba6fe3a586148aa44696edd (patch)
tree88e613399af846af817dc64d30ae8d7266c4a99f /new/container_unix.c
parent7c6beec879fcea66361b677eb752477f01f65b98 (diff)
Implemented uiWindowSetMargined() on GTK+.
Diffstat (limited to 'new/container_unix.c')
-rw-r--r--new/container_unix.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/new/container_unix.c b/new/container_unix.c
index d9d6996..d393273 100644
--- a/new/container_unix.c
+++ b/new/container_unix.c
@@ -55,14 +55,29 @@ static void uiContainer_remove(GtkContainer *container, GtkWidget *widget)
g_ptr_array_remove(c->children, widget);
}
+#define gtkXMargin 12
+#define gtkYMargin 12
+
static void uiContainer_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
{
uiContainer *c = uiContainer(widget);
uiSizing d;
+ intmax_t x, y, width, height;
gtk_widget_set_allocation(GTK_WIDGET(c), allocation);
- if (c->child != NULL)
- (*(c->child->resize))(c->child, allocation->x, allocation->y, allocation->width, allocation->height, &d);
+ if (c->child == NULL)
+ return;
+ x = allocation->x;
+ y = allocation->y;
+ width = allocation->width;
+ height = allocation->height;
+ if (c->margined) {
+ x += gtkXMargin;
+ y += gtkYMargin;
+ width -= 2 * gtkXMargin;
+ height -= 2 * gtkYMargin;
+ }
+ (*(c->child->resize))(c->child, x, y, width, height, &d);
}
struct forall {