Included spanning views in hugging priority management.

This commit is contained in:
Pietro Gagliardi 2016-06-12 16:27:29 -04:00
parent 629c242a83
commit f89feba680
1 changed files with 3 additions and 3 deletions

View File

@ -333,16 +333,16 @@ struct uiGrid {
uiDarwinControlSetSuperview(uiDarwinControl(gc.c), self); uiDarwinControlSetSuperview(uiDarwinControl(gc.c), self);
uiDarwinControlSyncEnableState(uiDarwinControl(gc.c), uiControlEnabledToUser(uiControl(self->g))); uiDarwinControlSyncEnableState(uiDarwinControl(gc.c), uiControlEnabledToUser(uiControl(self->g)));
// if a control expands horizontally, it should not hug horizontally // if a control expands horizontally OR spans horizontally, it should not hug horizontally
// otherwise, it should *forcibly* hug // otherwise, it should *forcibly* hug
if (gc.hexpand) if (gc.hexpand || gc.xspan != 1)
priority = NSLayoutPriorityDefaultLow; priority = NSLayoutPriorityDefaultLow;
else else
// LONGTERM will default high work? // LONGTERM will default high work?
priority = NSLayoutPriorityRequired; priority = NSLayoutPriorityRequired;
uiDarwinControlSetHuggingPriority(uiDarwinControl(gc.c), priority, NSLayoutConstraintOrientationHorizontal); uiDarwinControlSetHuggingPriority(uiDarwinControl(gc.c), priority, NSLayoutConstraintOrientationHorizontal);
// same for vertical direction // same for vertical direction
if (gc.vexpand) if (gc.vexpand || gc.yspan != 1)
priority = NSLayoutPriorityDefaultLow; priority = NSLayoutPriorityDefaultLow;
else else
// LONGTERM will default high work? // LONGTERM will default high work?