-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Box title alignment support #371
Conversation
titleAlignment.isLeft() -> 0 | ||
titleAlignment.isRight() -> size.width - cleanText.length - 4 | ||
titleAlignment.isCenter() -> (size.width - cleanText.length - 4) / 2 | ||
else -> throw IllegalStateException("unreachable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have written this should never happen
😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want me to? 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, it is OK.
zircon.core/src/commonTest/kotlin/org/hexworks/zircon/CharacterTilesAsString.kt
Outdated
Show resolved
Hide resolved
dccae20
to
a5a8217
Compare
a5a8217
to
153c4f4
Compare
This is ready for review! One thing that I'm curious about -- for RTL support, we'd eventually want to say start/end instead of left/right. Do we have anything like that now or planned? Otherwise we can just add them later and deprecate left/right. |
@nanodeath I have no idea what RTL is or how it is used (I guess it is not the television channel). Can you elaborate? But yes, what we usually do is to introduce the new thing ( |
RTL as in right-to-left. In CSS for example the flex-grid alignment is start/end instead of left/right because start is actually on the right side for an RTL locale. I guess if/when we support RTL more broadly we can revisit this. |
Oh, got it. We can revisit this later if we add RTL support. |
Add horizontal and "vertical" alignment for box titles by adding an additional enum parameter to
box()
. Closes #331.Note, this is currently stacked on top of my other change, #369, because it uses some helpers I introduced there. I'm going to leave this as a draft until that one gets merged, so that this PR will just contain the one actual commit.