Skip to content
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

Add justify config option for Labels #2887

Merged
merged 2 commits into from
Mar 5, 2024
Merged

Add justify config option for Labels #2887

merged 2 commits into from
Mar 5, 2024

Conversation

dann-merlin
Copy link

This is PR adds the option to specify a "justify" field for aligning text modules. It should be either "left", "right" or "center".

This is especially useful for centering the text in labels on vertical bars. In situations like this:

"format": "{icon}\n{value}%",
This kind of fix was already mentioned in #366, however it was never implemented, so here's my take on it.

An example config for this:

    "memory": {
        "format": "\n{}%", // That's a character for a RAM module in the font I'm using.
        "justify": "center",
    },

This is especially useful for centering labels on vertical bars.
@Alexays
Copy link
Owner

Alexays commented Feb 6, 2024

Nice, can you add this to the man and github wiki?

@dann-merlin
Copy link
Author

This would need to be added to basically all module documentations, right?

@2hexed
Copy link

2hexed commented Feb 14, 2024

Would love to see this implemented, I myself have been wanting this!

@Alexays
Copy link
Owner

Alexays commented Feb 19, 2024

Sorry for the delay, yep should be added to all modules that inherit label class :)

@machitgarha
Copy link

So all we need is documentation for this to get merged?

@dann-merlin
Copy link
Author

Alright, I've added documentation for justify whereever I was able to find documentation for align. Which should be everything that inherits the label class.
I also slightly changed the documentation for align, in order to clarify the difference between these two options.

Let me know if there's anything else!

@Alexays Alexays merged commit 4c46d7d into Alexays:master Mar 5, 2024
8 of 9 checks passed
@Alexays
Copy link
Owner

Alexays commented Mar 5, 2024

LGTM, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants