-
Notifications
You must be signed in to change notification settings - Fork 59
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
Possibly fix multiline labels on windows #112
Conversation
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.
This is comparing an ASCII literal against UTF-16 strings to parse the newlines. Otherwise looks good.
Confirmed to be a Windows only issue, correct.
This always makes reviewing much easier, thanks! 👍 Maybe now also update that label text in the
I wouldn't worry about supporting multiline labels in forms, no. |
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.
Nice work, definitely seems to work according to my tests.
Apart from removing out the old, now unneeded cruft, please remove the curly braces around the single if statements. The general guideline is to add them only when nesting gets too crazy or to match if/else
blocks.
And please add the missing spaces around if ()
and while ()
statements. You did it in some places but not others.
Edit: and all the things @cody271 suggested of course.
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.
Missed the memory leak in my first review.
b50fc88
to
befe9e0
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.
Very nice. Code looks good to me.
I tested things as well under Window 7 with assistive technologies, as I was a little concerned about the hard coded line height. Results:
It seems like Windows actually takes care of things via some type of smart scaling. So all good it seems.
unix and darwin appear to have no problems with multiline labels (would like confirm that).
this is an attempt to solve that on windows and address #106.
the first commit from andlabs/libui#465 to calculate the correct width and solve #106
Screenshot and code example
before (smallest window width):
after:
second commit is to calculate the correct height based on how many lines will be in the label.
Screenshot and code example
if we change the label in controlgallery to:
before change:
after change:
This only addresses
uiLabel
, what aboutuiForm
? does it make sense to have a form with multiline label?