News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Tooltips on the main toolbar appear under the button

Started by Ranran, November 07, 2020, 09:19:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

Thank you for your daily maintenance.

This is a very small issue, but the tooltips on the main toolbar may cut off the top of the text in large fonts. Because this tooltip is displayed under the button. (´・ω・`)


For example, the List toolbar tooltip is displayed over the button.

https://github.com/aburch/simutrans/blob/192de6e3e79689c646dab813a1a914e1a04bca27/gui/tool_selector.cc#L302
Maybe the fixed value 12 is from when the old font size was considered 10 or 12 (m+10r/m+12r)?

I think this change will look like it used to (m+10r/m+12r).

win_set_tooltip(get_mouse_x() + TOOLTIP_MOUSE_OFFSET_X, pos.y + TOOLTIP_MOUSE_OFFSET_Y + ((ydiff+1)*env_t::iconsize.h) + LINESPACE, tools[tipnr].tool->get_tooltip(welt->get_active_player()), tools[tipnr].tool, this);


Dwachs

Please test with r9377. Problem was/is that the tooltip is clipped at the menubar and not drawn. The position correction did not work for large fontsizes. Hopefully works now.
Parsley, sage, rosemary, and maggikraut.

Ranran

Thank you for the explanation. It seems to have been fixed.  :)