futuretap/InAppSettingsKit

Bad alignment for "compact" Date pickers

tipa opened this issue · 4 comments

tipa commented

See screenshot below. Compact date/time pickers should be aligned right.
Can be fixed by wrapping the date picker into a horizontal stack panel and set a constraint to the right cell border. (idea taken from here)

Screenshot 2021-03-30 at 12 06 19

You're right. Not sure when I'll find time to fix it. If you feel like fixing it yourself, I'd gladly accept a PR. 😉

tipa commented

I think the problem can be fixed by simply removing this line:

[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.datePicker attribute:NSLayoutAttributeLeading multiplier:1.0 constant:10].active = YES;

That causes the date picker to align right.

Removing that line would break the layout if the title is too long. We want a proper truncation in this case.
Should be solved in 3.3.1.

tipa commented

Awesome, thanks a lot for the quick fix!