-
Notifications
You must be signed in to change notification settings - Fork 253
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
TVTHeader.AutoScale() never decreases height. #1206
Comments
Well, I guess the original idea was to let the developer decide about the header height, but prevent cut off text which never makes sense. Furthermore, changing the font is not the same as dpi-scaling. In dpi-scaling you have How about tying the header height to |
In that case the developer should not set toAutoChangeScale. Especially now that it is decoupled from DPI scaling. Setting this flag means that you allow VT to optimize node and header height, based on the font size.
This would not work when the header ParentFont is False. And in any case DefaultNodeHeight is also incorrect when you decrease the font size. The suggested changes fix both DefaultNodeHeight and header height. Just think what needs to be done otherwise, if a user assigns a font with smaller size at run time:
|
Thanks! But, shouldn't TBaseVirtualTree.AutoScale behave in a similar way? |
Both VT and Header AutoScale may only increase height, but never decrease it.
In my application (PyScripter), I have an option to change the UI content font size. When a user increases font size both default node height and header height* are automatically adjusting (increasing), which is good, but if a user decreases font size, the node height and header height stay at their previous high values and do not look good.
Is there a reason for this behaviour? I would think that if toAutoChangeScale is set, you let VT manage the node and header heights for better or worse.
Changes needed
in TVTHeader.AutoScale remove the lines below:
//Get the maximum of the scaled original value and the minimum needed header height. lMaxHeight := Max(lMaxHeight, FHeight);
In TBaseVirtualTree.AutoScale change the > to <>.
The text was updated successfully, but these errors were encountered: