More auto layout fixes and hacks and TODOs.
This commit is contained in:
parent
8efa8c19db
commit
896a779e1e
|
@ -51,6 +51,10 @@ void layoutSingleView(NSView *superview, NSView *subview, int margined, NSString
|
||||||
|
|
||||||
[superview removeConstraints:[superview constraints]];
|
[superview removeConstraints:[superview constraints]];
|
||||||
|
|
||||||
|
// don't hug if needed
|
||||||
|
setHorzHuggingPri(subview, NSLayoutPriorityDefaultLow);
|
||||||
|
setVertHuggingPri(subview, NSLayoutPriorityDefaultLow);
|
||||||
|
|
||||||
margin = 0;
|
margin = 0;
|
||||||
if (margined)
|
if (margined)
|
||||||
margin = 20; // TODO named constant
|
margin = 20; // TODO named constant
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
#import "uipriv_darwin.h"
|
#import "uipriv_darwin.h"
|
||||||
|
|
||||||
// TODOs:
|
// TODOs:
|
||||||
// - page 2 is growable but the wrong control grows
|
// - tab on page 2 is glitched initially
|
||||||
// - tab on page 2 is glitched
|
|
||||||
// - separators on page 4 have variable padding after them
|
|
||||||
// - 10.8: if we switch to page 4, then switch back to page 1, check Spaced, and go back to page 4, some controls (progress bar, popup button) are clipped on the sides
|
// - 10.8: if we switch to page 4, then switch back to page 1, check Spaced, and go back to page 4, some controls (progress bar, popup button) are clipped on the sides
|
||||||
// - calling layoutSubtreeIfNeeded on a superview of the box will cause the following intrinsic content size thing to not work until the window is resized in the primary direction; this is bad if we ever add a Splitter...
|
// - calling layoutSubtreeIfNeeded on a superview of the box will cause the following intrinsic content size thing to not work until the window is resized in the primary direction; this is bad if we ever add a Splitter...
|
||||||
|
// - moving around randomly through the tabs does this too
|
||||||
|
|
||||||
// the default is to have no intrinsic content size; this wreaks havoc with nested no-stretchy boxes fighting over which box gets the remaining space
|
// the default is to have no intrinsic content size; this wreaks havoc with nested no-stretchy boxes fighting over which box gets the remaining space
|
||||||
// let's use a 0x0 intrinsic size instead; that seems to fix things
|
// let's use a 0x0 intrinsic size instead; that seems to fix things
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#import "uipriv_darwin.h"
|
#import "uipriv_darwin.h"
|
||||||
|
|
||||||
// TODO drag and drop fonts? what other interactions does NSColorWell allow that we can do for fonts?
|
// TODO drag and drop fonts? what other interactions does NSColorWell allow that we can do for fonts?
|
||||||
|
// TODO when closing the window, deactivate the current button
|
||||||
|
|
||||||
@interface fontButton : NSButton {
|
@interface fontButton : NSButton {
|
||||||
uiFontButton *libui_b;
|
uiFontButton *libui_b;
|
||||||
|
|
|
@ -82,12 +82,12 @@ struct uiSpinbox {
|
||||||
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeTop,
|
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeTop,
|
||||||
NSLayoutRelationEqual,
|
NSLayoutRelationEqual,
|
||||||
self, NSLayoutAttributeTop,
|
self, NSLayoutAttributeTop,
|
||||||
1, 0,
|
1, -1, // TODO make sure this is right
|
||||||
@"uiSpinbox top edge stepper")];
|
@"uiSpinbox top edge stepper")];
|
||||||
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeBottom,
|
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeBottom,
|
||||||
NSLayoutRelationEqual,
|
NSLayoutRelationEqual,
|
||||||
self, NSLayoutAttributeBottom,
|
self, NSLayoutAttributeBottom,
|
||||||
1, 0,
|
1, -1, // TODO make sure this is right
|
||||||
@"uiSpinbox bottom edge stepper")];
|
@"uiSpinbox bottom edge stepper")];
|
||||||
[self addConstraint:mkConstraint(self->tf, NSLayoutAttributeTrailing,
|
[self addConstraint:mkConstraint(self->tf, NSLayoutAttributeTrailing,
|
||||||
NSLayoutRelationEqual,
|
NSLayoutRelationEqual,
|
||||||
|
|
Loading…
Reference in New Issue