summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redo/container.go12
-rw-r--r--redo/container_darwin.go3
-rw-r--r--redo/container_unix.go3
-rw-r--r--redo/container_windows.go8
4 files changed, 16 insertions, 10 deletions
diff --git a/redo/container.go b/redo/container.go
index f323952..c855072 100644
--- a/redo/container.go
+++ b/redo/container.go
@@ -12,10 +12,11 @@ type allocation struct {
}
type sizingbase struct {
- xmargin int
- ymargin int
- xpadding int
- ypadding int
+ xmargin int
+ ymargintop int
+ ymarginbottom int
+ xpadding int
+ ypadding int
}
type controlSizing interface {
@@ -41,7 +42,8 @@ func (c *container) resize(x, y, width, height int) {
return
}
d := c.beginResize()
- allocations := c.child.allocate(x + d.xmargin, y + d.ymargin, width - (2 * d.xmargin), height - (2 * d.ymargin), d)
+ allocations := c.child.allocate(x + d.xmargin, y + d.ymargintop,
+ width - (2 * d.xmargin), height - d.ymargintop - d.ymarginbottom, d)
c.translateAllocationCoords(allocations, width, height)
// move in reverse so as to approximate right->left order so neighbors make sense
for i := len(allocations) - 1; i >= 0; i-- {
diff --git a/redo/container_darwin.go b/redo/container_darwin.go
index 4936a62..8b98b64 100644
--- a/redo/container_darwin.go
+++ b/redo/container_darwin.go
@@ -51,7 +51,8 @@ func (c *container) beginResize() (d *sizing) {
d = new(sizing)
if spaced {
d.xmargin = macXMargin
- d.ymargin = macYMargin
+ d.ymargintop = macYMargin
+ d.ymarginbottom = d.ymargintop
d.xpadding = macXPadding
d.ypadding = macYPadding
}
diff --git a/redo/container_unix.go b/redo/container_unix.go
index 4beccef..fbfd993 100644
--- a/redo/container_unix.go
+++ b/redo/container_unix.go
@@ -58,7 +58,8 @@ func (c *container) beginResize() (d *sizing) {
d = new(sizing)
if spaced {
d.xmargin = gtkXMargin
- d.ymargin = gtkYMargin
+ d.ymargintop = gtkYMargin
+ d.ymarginbottom = d.ymargintop
d.xpadding = gtkXPadding
d.ypadding = gtkYPadding
}
diff --git a/redo/container_windows.go b/redo/container_windows.go
index e1470cc..d3fd327 100644
--- a/redo/container_windows.go
+++ b/redo/container_windows.go
@@ -107,7 +107,6 @@ const (
paddingDialogUnits = 4
groupXMargin = 6
- // TODO
groupYMarginTop = 11 // note this value /includes the groupbox label/
groupYMarginBottom = 7
)
@@ -125,7 +124,8 @@ func (c *container) beginResize() (d *sizing) {
if spaced {
d.xmargin = fromdlgunitsX(marginDialogUnits, d)
- d.ymargin = fromdlgunitsY(marginDialogUnits, d)
+ d.ymargintop = fromdlgunitsY(marginDialogUnits, d)
+ d.ymarginbottom = d.ymargintop
d.xpadding = fromdlgunitsX(paddingDialogUnits, d)
d.ypadding = fromdlgunitsY(paddingDialogUnits, d)
}
@@ -134,7 +134,9 @@ func (c *container) beginResize() (d *sizing) {
// this is because Windows groupboxes have the client rect spanning the entire size of the control, not just the active work area
// the measurements Microsoft give us are for spaced margining; let's just use them
d.xmargin = fromdlgunitsX(groupXMargin, d)
- d.ymargin = fromdlgunitsY(groupYMarginTop, d)
+ d.ymargintop = fromdlgunitsY(groupYMarginTop, d)
+ d.ymarginbottom = fromdlgunitsY(groupYMarginBottom, d)
+
}
return d