Fixed Mac OS X sizing and more TODOs. Ready to merge back!
This commit is contained in:
parent
922407d5b6
commit
8c8b642adb
10
future
10
future
|
@ -1,7 +1,13 @@
|
||||||
|
mac os x sizing is now completely broken
|
||||||
|
- need to catch window initial sizes
|
||||||
|
- need to catch tab changes
|
||||||
|
- rect should be based on the alignment rect, not the frame rect
|
||||||
|
|
||||||
new control stuff
|
new control stuff
|
||||||
Tab, Group
|
Tab, Group
|
||||||
- should host Controls directly
|
- should host Controls directly?
|
||||||
- should have sharedWndProc()
|
- should have sharedWndProc()
|
||||||
|
- Tab needs Margined
|
||||||
|
|
||||||
more flexible sizing determination
|
more flexible sizing determination
|
||||||
Tab needs a SetMargined(n), Margined(n)
|
Tab needs a SetMargined(n), Margined(n)
|
||||||
|
|
|
@ -17,7 +17,7 @@ type sizing struct {
|
||||||
sizingbase
|
sizingbase
|
||||||
|
|
||||||
// for size calculations
|
// for size calculations
|
||||||
// nothing for mac
|
// nothing on Mac OS X
|
||||||
|
|
||||||
// for the actual resizing
|
// for the actual resizing
|
||||||
neighborAlign C.struct_xalignment
|
neighborAlign C.struct_xalignment
|
||||||
|
|
|
@ -34,7 +34,14 @@ id newContainerView(void *gocontainer)
|
||||||
|
|
||||||
void moveControl(id c, intptr_t x, intptr_t y, intptr_t width, intptr_t height)
|
void moveControl(id c, intptr_t x, intptr_t y, intptr_t width, intptr_t height)
|
||||||
{
|
{
|
||||||
[toNSView(c) setFrame:NSMakeRect((CGFloat) x, (CGFloat) y, (CGFloat) width, (CGFloat) height)];
|
NSView *v;
|
||||||
|
NSRect frame;
|
||||||
|
|
||||||
|
frame = NSMakeRect((CGFloat) x, (CGFloat) y, (CGFloat) width, (CGFloat) height);
|
||||||
|
// mac os x coordinate system has (0,0) in the lower-left
|
||||||
|
v = toNSView(c);
|
||||||
|
frame.origin.y = ([[v superview] bounds].size.height - frame.size.height) - frame.origin.y;
|
||||||
|
[v setFrame:frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xrect containerBounds(id view)
|
struct xrect containerBounds(id view)
|
||||||
|
|
|
@ -34,6 +34,7 @@ func newWindow(title string, width int, height int, control Control) *window {
|
||||||
C.windowSetDelegate(w.id, unsafe.Pointer(w))
|
C.windowSetDelegate(w.id, unsafe.Pointer(w))
|
||||||
C.windowSetContentView(w.id, w.container.id)
|
C.windowSetContentView(w.id, w.container.id)
|
||||||
w.child.setParent(w.container.parent())
|
w.child.setParent(w.container.parent())
|
||||||
|
// trigger an initial resize
|
||||||
return w
|
return w
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +50,9 @@ func (w *window) SetTitle(title string) {
|
||||||
|
|
||||||
func (w *window) Show() {
|
func (w *window) Show() {
|
||||||
C.windowShow(w.id)
|
C.windowShow(w.id)
|
||||||
|
// trigger an initial resize
|
||||||
|
// TODO fine-tune this
|
||||||
|
windowResized(unsafe.Pointer(w))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *window) Hide() {
|
func (w *window) Hide() {
|
||||||
|
|
Loading…
Reference in New Issue