summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-12 11:54:58 -0400
committerPietro Gagliardi <[email protected]>2014-10-12 11:54:58 -0400
commit1b070b3f107b8d421d3c3dc709d2da98c99db692 (patch)
treef1d8cd9a6535489b67bd3fa6ac99567bc30729f2
parentea391ef84109f42f7b5cf51b4976845e9320aa3f (diff)
Revert "Began making the spaced property per-container." Things are more complicated here than it's worth. Will need to tear everything apart and redo the whole control hierarchy. Sigh...
This reverts commit ea391ef84109f42f7b5cf51b4976845e9320aa3f.
-rw-r--r--container.go4
-rw-r--r--container_darwin.go2
-rw-r--r--container_unix.go2
-rw-r--r--container_windows.go2
-rw-r--r--zz_test.go2
5 files changed, 7 insertions, 5 deletions
diff --git a/container.go b/container.go
index ac6a354..143985c 100644
--- a/container.go
+++ b/container.go
@@ -32,9 +32,11 @@ type controlSizing interface {
// All containers must embed containerbase.
type containerbase struct {
child Control
- spaced bool
}
+// set to true to apply spacing to all windows
+var spaced bool = false
+
func (c *container) resize(x, y, width, height int) {
if c.child == nil { // no children; nothing to do
return
diff --git a/container_darwin.go b/container_darwin.go
index ef0355b..b2086c4 100644
--- a/container_darwin.go
+++ b/container_darwin.go
@@ -49,7 +49,7 @@ const (
func (c *container) beginResize() (d *sizing) {
d = new(sizing)
- if c.spaced {
+ if spaced {
d.xmargin = macXMargin
d.ymargintop = macYMargin
d.ymarginbottom = d.ymargintop
diff --git a/container_unix.go b/container_unix.go
index 4db046c..ffb1ffa 100644
--- a/container_unix.go
+++ b/container_unix.go
@@ -56,7 +56,7 @@ const (
func (c *container) beginResize() (d *sizing) {
d = new(sizing)
- if c.spaced {
+ if spaced {
d.xmargin = gtkXMargin
d.ymargintop = gtkYMargin
d.ymarginbottom = d.ymargintop
diff --git a/container_windows.go b/container_windows.go
index 39e1a5c..99be1c2 100644
--- a/container_windows.go
+++ b/container_windows.go
@@ -122,7 +122,7 @@ func (c *container) beginResize() (d *sizing) {
d.baseY = baseY
d.internalLeading = internalLeading
- if c.spaced {
+ if spaced {
d.xmargin = fromdlgunitsX(marginDialogUnits, d)
d.ymargintop = fromdlgunitsY(marginDialogUnits, d)
d.ymarginbottom = d.ymargintop
diff --git a/zz_test.go b/zz_test.go
index 2f3d286..a7b0670 100644
--- a/zz_test.go
+++ b/zz_test.go
@@ -18,7 +18,6 @@ import (
var closeOnClick = flag.Bool("close", false, "close on click")
var smallWindow = flag.Bool("small", false, "open a small window (test Mac OS X initial control sizing)")
-var spaced = flag.Bool("spaced", false, "enable spacing")
type dtype struct {
Name string
@@ -263,6 +262,7 @@ var tw *testwin
// because Cocoa hates being run off the main thread, even if it's run exclusively off the main thread
func init() {
+ flag.BoolVar(&spaced, "spaced", false, "enable spacing")
flag.Parse()
go func() {
tw = new(testwin)