summaryrefslogtreecommitdiff
path: root/prefsize_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-06 23:31:50 -0400
committerPietro Gagliardi <[email protected]>2014-06-06 23:31:50 -0400
commit14c7267b107e2a58a89be69a46f855742acf16ec (patch)
tree9cdb2c57ac32fb5922c0218db958abd69983a5be /prefsize_unix.go
parentf5397475469b8e5b7a42d0bbb9bda4bca97f2b8a (diff)
Made the preferred size of an Area its size on GTK+ as well.
Diffstat (limited to 'prefsize_unix.go')
-rw-r--r--prefsize_unix.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/prefsize_unix.go b/prefsize_unix.go
index dcdd40c..7ec2e86 100644
--- a/prefsize_unix.go
+++ b/prefsize_unix.go
@@ -14,8 +14,13 @@ import (
// The difference? Minimum size takes into account things like truncation with ellipses: the minimum size of a label can allot just the ellipses!
// So we use the natural size instead.
// There is a warning about height-for-width controls, but in my tests this isn't an issue.
+// For Areas, we manually save the Area size and use that, just to be safe.
func (s *sysData) preferredSize() (width int, height int) {
+ if s.ctype == c_area {
+ return s.areawidth, s.areaheight
+ }
+
_, _, width, height = gtk_widget_get_preferred_size(s.widget)
return width, height
}