The International Simutrans Forum

 

Author Topic: Tooltips on the main toolbar appear under the button  (Read 346 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Tooltips on the main toolbar appear under the button
« 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. (´・ω・`)


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);

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4869
  • Languages: EN, DE, AT
Re: Tooltips on the main toolbar appear under the button
« Reply #1 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.

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Re: Tooltips on the main toolbar appear under the button
« Reply #2 on: November 08, 2020, 05:34:19 AM »
Thank you for the explanation. It seems to have been fixed.  :)