summaryrefslogtreecommitdiff
path: root/redo/containerctrls_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-02 12:35:36 -0400
committerPietro Gagliardi <[email protected]>2014-08-02 12:35:36 -0400
commitcafc9daa720ffd3102b414ceead4a1d6683b0221 (patch)
tree82d139bc517f5a160a2974b59cd4d3e12415b1fc /redo/containerctrls_windows.go
parent668cf5e46e8b2be3c7f76ff5ae50fbc95093e71c (diff)
Implemented Tab.preferredSize() on Windows.
Diffstat (limited to 'redo/containerctrls_windows.go')
-rw-r--r--redo/containerctrls_windows.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/redo/containerctrls_windows.go b/redo/containerctrls_windows.go
index 1aa2c57..e9d116b 100644
--- a/redo/containerctrls_windows.go
+++ b/redo/containerctrls_windows.go
@@ -33,6 +33,7 @@ func newTab() Tab {
}
t.supersetParent = t.fsetParent
t.fsetParent = t.tabsetParent
+ t.fpreferredSize = t.tabpreferredSize
t.superallocate = t.fallocate
t.fallocate = t.taballocate
C.controlSetControlFont(t.hwnd)
@@ -73,6 +74,20 @@ func tabChanged(data unsafe.Pointer, new C.LRESULT) {
t.tabs[int(new)].child.containerShow()
}
+func (t *tab) tabpreferredSize(d *sizing) (width, height int) {
+ // TODO only consider the size of the current tab?
+ for _, s := range t.tabs {
+ w, h := s.child.preferredSize(d)
+ if width < w {
+ width = w
+ }
+ if height < h {
+ height = h
+ }
+ }
+ return width, height + int(C.tabGetTabHeight(t.hwnd))
+}
+
// a tab control contains other controls; size appropriately
// TODO change this to commitResize()
func (t *tab) taballocate(x int, y int, width int, height int, d *sizing) []*allocation {