5 Year thread anniversary bump! Currently abusing setBorder to fake actual justification as a hacky workaround and I die a little inside every time I see that chunk of code
Damnā¦ must get around to this one day!
ā¦itās a 19 days lag left (may 30th, 2011) - thatās a challange
Just set it as an interview question next time youāre hiring at roli ā¦ someone will come up with a good fix
Ha! I like this. Jules, if I rewrite TextEditor and fix it, will you guys hire me?
Well, if you send us an improved version of TextEditor that demonstrates an absolutely beautiful coding style and stunning abilities, then yes, absolutely weāll hire you!
+1
For single lines and single style runs, there is a workaround here: Editable label's TextEdit centered text
I guess itās my turn! +1
Itās my turn now to +1
!
I dream of a JUCE newsletter stating among its cover features: ācustomizable TextEditor Justificationā
Heh. Iād love to see a poll of hot-topic feature requests. This oneās been around for ~6 years - always curious to see what else is frequently asked for in a simple list.
Happy Friday!
(and yet another requestā¦ :- )
Only the horizontal alignment is taken into account at the moment (i.e, topRight/centredRight/bottomRight all lead to the same result).
Is there any plan to also support the vertical alignment?
Well, it scrolls vertically so not really sure what youād expect to happen if you asked for a different vertical alignment.
humā¦ right. I was in a case where the text is much shorter than the text editorās height and without scrollbars, so I did not think about it.
Perhaps that should be taken into account until the scrollbars appears?
Let see if anyone else needs it.
(personally I donāt need it anymore actually at the moment - I just had a small vertical alignement issue but that was due to something else).
I think it makes sense in the common case when an editor is single-line and all text has the same font. These look really weird if the text is not vertically centred. Right now you have to do something like this whenever you create a single line text editor:
float extra = editor.getHeight() - editor.getFont().getHeight() - editor.getBorder().getTopAndBottom();
editor.setIndents(4, (int) (extra * 0.5f));
I hacked up the TextEditor to be single line only and support vertical justification: https://github.com/FigBug/SingleLineTextEditor