Implemented the foundation for padding.
This commit is contained in:
parent
ec95a4a2dd
commit
1b5de5f096
|
@ -34,6 +34,8 @@ uiLogObjCClassAllocations
|
|||
// TODO reverify these against /layout rects/, not /frame rects/
|
||||
#define macXMargin 20
|
||||
#define macYMargin 20
|
||||
#define macXPadding 8
|
||||
#define macYPadding 8
|
||||
|
||||
- (void)uiUpdateNow
|
||||
{
|
||||
|
@ -52,6 +54,8 @@ uiLogObjCClassAllocations
|
|||
width -= 2 * macXMargin;
|
||||
height -= 2 * macYMargin;
|
||||
}
|
||||
d.xPadding = macXPadding;
|
||||
d.yPadding = macYPadding;
|
||||
(*(self.child->resize))(self.child, x, y, width, height, &d);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ static void uiContainer_remove(GtkContainer *container, GtkWidget *widget)
|
|||
|
||||
#define gtkXMargin 12
|
||||
#define gtkYMargin 12
|
||||
#define gtkXPadding 12
|
||||
#define gtkYPadding 6
|
||||
|
||||
static void uiContainer_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
|
||||
{
|
||||
|
@ -77,6 +79,8 @@ static void uiContainer_size_allocate(GtkWidget *widget, GtkAllocation *allocati
|
|||
width -= 2 * gtkXMargin;
|
||||
height -= 2 * gtkYMargin;
|
||||
}
|
||||
d.xPadding = gtkXPadding;
|
||||
d.yPadding = gtkYPadding;
|
||||
(*(c->child->resize))(c->child, x, y, width, height, &d);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,10 @@ BOOL sharedWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// TODO get source
|
||||
#define winXPadding 4
|
||||
#define winYPadding 4
|
||||
|
||||
void resize(uiControl *control, HWND parent, RECT r, RECT margin)
|
||||
{
|
||||
uiSizing d;
|
||||
|
@ -87,6 +91,8 @@ void resize(uiControl *control, HWND parent, RECT r, RECT margin)
|
|||
r.top += uiDlgUnitToY(margin.top, d.baseY);
|
||||
r.right -= uiDlgUnitToX(margin.right, d.baseX);
|
||||
r.bottom -= uiDlgUnitToY(margin.bottom, d.baseY);
|
||||
d.xPadding = uiDlgUnitToX(winXPadding, d.baseX);
|
||||
d.yPadding = uiDlgUnitToY(winYPadding, d.baseY);
|
||||
(*(control->resize))(control, r.left, r.top, r.right - r.left, r.bottom - r.top, &d);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue