More auto layout fixes and hacks and TODOs.

This commit is contained in:
Pietro Gagliardi 2016-05-01 16:25:05 -04:00
parent 8efa8c19db
commit 896a779e1e
4 changed files with 9 additions and 5 deletions

View File

@ -51,6 +51,10 @@ void layoutSingleView(NSView *superview, NSView *subview, int margined, NSString
[superview removeConstraints:[superview constraints]];
// don't hug if needed
setHorzHuggingPri(subview, NSLayoutPriorityDefaultLow);
setVertHuggingPri(subview, NSLayoutPriorityDefaultLow);
margin = 0;
if (margined)
margin = 20; // TODO named constant

View File

@ -2,11 +2,10 @@
#import "uipriv_darwin.h"
// TODOs:
// - page 2 is growable but the wrong control grows
// - tab on page 2 is glitched
// - separators on page 4 have variable padding after them
// - tab on page 2 is glitched initially
// - 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...
// - 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
// let's use a 0x0 intrinsic size instead; that seems to fix things

View File

@ -2,6 +2,7 @@
#import "uipriv_darwin.h"
// 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 {
uiFontButton *libui_b;

View File

@ -82,12 +82,12 @@ struct uiSpinbox {
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeTop,
NSLayoutRelationEqual,
self, NSLayoutAttributeTop,
1, 0,
1, -1, // TODO make sure this is right
@"uiSpinbox top edge stepper")];
[self addConstraint:mkConstraint(self->stepper, NSLayoutAttributeBottom,
NSLayoutRelationEqual,
self, NSLayoutAttributeBottom,
1, 0,
1, -1, // TODO make sure this is right
@"uiSpinbox bottom edge stepper")];
[self addConstraint:mkConstraint(self->tf, NSLayoutAttributeTrailing,
NSLayoutRelationEqual,