summaryrefslogtreecommitdiff
path: root/area.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-25 22:17:26 -0400
committerPietro Gagliardi <[email protected]>2014-06-25 22:17:26 -0400
commit057f0eaf53f2f7f40113e4a0952750d85f689521 (patch)
tree309e5c880b40b70d605f129a6901a75ef98b4f98 /area.go
parente4992dbcb2292a07c7d901dbe21f2d40f6af7a95 (diff)
Migrated existing controls to the new sizing system.
Diffstat (limited to 'area.go')
-rw-r--r--area.go21
1 files changed, 15 insertions, 6 deletions
diff --git a/area.go b/area.go
index 3c7ff07..211dea1 100644
--- a/area.go
+++ b/area.go
@@ -336,20 +336,29 @@ func (a *Area) make(window *sysData) error {
return nil
}
-func (a *Area) setRect(x int, y int, width int, height int, rr *[]resizerequest) {
- *rr = append(*rr, resizerequest{
- sysData: a.sysData,
+func (a *Area) allocate(x int, y int, width int, height int, d *sysSizeData) []*allocation {
+ return []*allocation{&allocation{
x: x,
y: y,
width: width,
height: height,
- })
+ this: a,
+ }}
}
-func (a *Area) preferredSize() (width int, height int, yoff int) {
- return a.sysData.preferredSize()
+func (a *Area) preferredSize(d *sysSizeData) (width int, height int) {
+ return a.sysData.preferredSize(d)
}
+func (a *Area) commitResize(a *allocation, d *sysSizeData) {
+ a.sysData.preferredSize(a, d)
+}
+
+func (a *Area) getAuxResizeInfo(d *sysSizeData) {
+ a.sysData.getAuxResizeInfo(d)
+}
+
+
// internal function, but shared by all system implementations: &img.Pix[0] is not necessarily the first pixel in the image
func pixelDataPos(img *image.RGBA) int {
return img.PixOffset(img.Rect.Min.X, img.Rect.Min.Y)