Hi silarm,
thanks a lot for pointing me directly to the correct file and line and the code quoted, too.
I know some programming, but not which language is used here.
But I guess that the code divides the vertical screen resolution (in my case 1024) by 800 (in my case resulting in 1.28).
What the syntax *= means, I do not know. To me it first looks as if sz gets the value of scale, but that would not make sense, or does it?
Then it checks if sz (in my case sz gets what if scale is 1.28?) is less 10 (.f obviously means that it is a floating point value, right?).
Any sz value below 10 is set to 10. I guess that thus we avoid that text becomes too small, right?
Would we then need an upper limit, too, so that the text does not get too large? (as in my case)
Then I would add e.g. (not tested yet - and as I wrote above, I do not know if this code works at all, but it should):if (sz > 12.f) {
sz = 12.f;
}
The last code line with round surely takes care that sz is always rounded.
Currently, this means that sz is equal or greater than 10 and is always a whole number, i.e. 10, 11, 12, 13, etc.
After modifying the above file and running make again, the text of 12 is fine for my resolution (1280x1024) - but see comment below, too:
int WidgetConfig::computeFontSize(int size) {
float sz = float(size);
float scale = g_config.getDisplayHeight() / 800.f;
sz *= scale;
if (sz < 10.f) {
sz = 10.f;
}
// if (sz > 12.f) {
// sz = 12.f;
// }
sz = 11;
return int(roundf(sz));
Comment:
The size is ok regarding readability. But when selecting an item from a drop-down menu, the entry overlaps with the next item value below. In some occasions this may be confusing, because one does not immediately understand (e.g. with terrain renderer) whether the other (below) item (water shader) value belongs to the same drop-down menu or to the next item below. As a solution, the spaces between different items could be enlarged or the font size has still to be made smaller. I set sz even to 10, but when changing terrain renderer, the drop-down menu still hangs down into the next item water shader.
PS 1:
By the way, water shader shows for me (after autoconfig) "???3D_Textures???". Do the question marks have any meaning or is there a misspelling with this variable's value?
PS 2:
I cannot switch to "windowed mode", i.e. the tickbox is always empty, but the games runs fullscreen. When I click on the tickbox, nothing happens, i.e. it does not become ticked and the game still runs in fullscreen mode.
And the resolution field is also always empty, even when I select another resolution. The new resolution works, but the field is still empty.
Should I open a new threads for these two last topics?