Aligned UI#301
Merged
Merged
Conversation
Added ellipse char for long nick cutoff. Alignment of activity line.
osa1
reviewed
Apr 14, 2021
| #[serde(rename_all = "snake_case")] | ||
| pub(crate) enum UiStyle { | ||
| Compact, | ||
| Aligned { max_nick_length: usize }, |
Owner
There was a problem hiding this comment.
tiny is supposed to easy to configure and provide good UX out of the box, so I think making max_nick_length optional would be good. I think I should be able to change
ui_style: compact
to
ui_style: aligned
and it should work.
Perhaps moving max_nick_length to another top-level field might make sense. Something like:
ui_style: aligned
max_nick_length: 12
|
|
||
| #[derive(Deserialize)] | ||
| #[serde(rename_all = "snake_case")] | ||
| pub(crate) enum UiStyle { |
Owner
There was a problem hiding this comment.
Should we rename this to Layout maybe? (both the type name and the config field name)
| /// Inserts a blank space that is the size of a timestamp | ||
| fn blank(msg_area: &mut MsgArea) { | ||
| msg_area.add_text( | ||
| &format!("{:^width$}", "", width = Timestamp::WIDTH), |
Owner
There was a problem hiding this comment.
This allocates a String, but it's actually a static string. I think we can't create &'static str using WIDTH, but having a const/static string next to WIDTH, with documentation that the length of the string should be WIDTH should be fine.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added Aligned UI, which can be turned on or off, and configured (currently only minimally).
Implementation details:
Layout--Compact(original) andAligned.Linegetting constructed will have a type -- regular and aligned (MsgandAligned, withinLineDataCache). Not all message lines are aligned in the aligned ui (ex. topics)Small refactors are included.
Closes #169 and #299