More work. uiSizing on Unix done.

This commit is contained in:
Pietro Gagliardi 2015-06-15 22:36:49 -04:00
parent 039bc5083b
commit 58a4b5d2da
4 changed files with 24 additions and 4 deletions

View File

@ -17,4 +17,7 @@ struct uiSizingSys {
// this structure currently left blank
};
// This creates a uiSizing for Unix systems.
_UI_EXTERN uiSizing *uiUnixNewSizing(void);
#endif

View File

@ -35,7 +35,7 @@ static void singleWidgetResize(uiControl *c, intmax_t x, intmax_t y, intmax_t wi
static uiSizing *singleWidgetSizing(uiControl *c)
{
// TODO
return uiUnixNewSizing();
}
static void singleWidgetCommitShow(uiControl *c)

View File

@ -11,3 +11,23 @@ void complain(const char *fmt, ...)
va_end(ap);
g_error("[libui] %s\n", msg);
}
#define gtkXPadding 12
#define gtkYPadding 6
uiSizing *uiUnixNewSizing(void)
{
uiSizing *d;
d = uiNew(uiSizing);
d->XPadding = gtkXPadding;
d->YPadding = gtkYPadding;
d->Sys = uiNew(uiSizingSys);
return d;
}
void uiFreeSizing(uiSizing *d)
{
uiFree(d->Sys);
uiFree(d);
}

View File

@ -61,9 +61,6 @@ static void containerWidget_remove(GtkContainer *container, GtkWidget *widget)
complain("widget %p not found in containerWidget gtk_container_remove()", widget);
}
#define gtkXPadding 12
#define gtkYPadding 6
static void containerWidget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
{
containerWidget *c = containerWidget(widget);