The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Ranran on November 07, 2020, 09:19:24 AM

Title: Tooltips on the main toolbar appear under the button
Post by: Ranran on November 07, 2020, 09:19:24 AM
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. (´・ω・`)
(https://i.imgur.com/pMwgsHt.gif)

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).
Code: [Select]
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);
Title: Re: Tooltips on the main toolbar appear under the button
Post by: Dwachs on November 07, 2020, 05:16:37 PM
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.
Title: Re: Tooltips on the main toolbar appear under the button
Post by: Ranran on November 08, 2020, 05:34:19 AM
Thank you for the explanation. It seems to have been fixed.  :)