-
-
Couldn't load subscription status.
- Fork 1k
Auto adjust sensor texts size in header #2066
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
Conversation
|
Wow nice work! But don't you think that GPS is wayy fat? |
|
Yes, it seems it has used all the space, the ideal is to reduce only, not to make it bigger, but I'm not too sure if there is a property for this... I will play a little more with it, but I want to know if this is an accepted solution. |
|
It seems nice to me considering there won't be strings longer than 4 CN chars. I think that's acceptable. |
|
Looks so good this autoadjust idea! Html part cant be done in css?? |
8f2dd07 to
364151d
Compare
|
It seems this latest solution has cutted some of the characters.. I will go back to see what I have lost... |
|
I need to let it by today. The problem is the |
|
@McGiverGim what about reduce GPS |
|
No that will not work. What this does is to say the text the size it must fill. If I use 70% ALL the text will be compressed to 70% of the assigned space, making too small the big texts. I will try to find a solution today, but yesterday search give me nothing... |
|
The SVG path has ended to me... So we have several solutions, now we need to decide which we prefer:
I think this are the more common solutions for this problem. |
|
For me the 3 solution is the best for these cases :) |
|
The third solution seems fine to me. I won't be bothered if I need to add additional |
364151d to
e25837f
Compare
|
Updated the code with solution 3 as requested. Now I think we need to wait @mikeller to see if better to use this code, or better to do the same manually with <style> tags in the translators side. |
953d80b to
d69d747
Compare
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.
|
I've limited the minimum don't size but yes, it must work. I will recheck my code to see what is happening. |
f3dde7e to
370c15b
Compare
|
Sorry @mikeller I forgot to upload the library, so it was not working... 🤦♂️ I've tested with German and is very large so it does not work at all... With the SVG solution neither... So seeing that, I think the best we can do is simply "cut" the large texts, and if some translator want to make them smaller let him do that in the translations string as you suggested. |
370c15b to
fcac8bd
Compare
|
Yes, the super small fonts do not work - translators will have to change this. Maybe we should add instructions for such fields to indicate that these need to fit into small fields. |
|
No, the library works independent for each field. We can change this, of course but it will not work neither seeing how long are some strings. |
That's where I am not sure if trying to do this automatically here to make it work for a small number of languages, and introducing the potential for all other languages to end up with an odd look if different size text is used for fields in the same group is the right thing to do here. |
|
Pushed new code. It simply cuts the text if too big. All the icons have a tooltip with a long string, so is not a problem. I've uploaded the directly cut version: Is cleaner with ellipsis, but maybe the strings are too short then: @DusKing1 you will need to add your own "reductor" in the the translations, something like: |
fcac8bd to
50265dd
Compare
|
@McGiverGim Thank you so much for putting so many efforts on this, I like this solution and have no problem with that! |
50265dd to
73f8f92
Compare
|
Another PR forgotten, rebased! |
|
Kudos, SonarCloud Quality Gate passed!
|















Fixes #2065
The elements of the Configurator not always adjust to the size of translations. This is specially a problem in very short strings, like the sensors header. This tries to fix that making it resize using a SVG. This is the result: