The International Simutrans Forum

 

Author Topic: The delete save button displays "..." in some fonts  (Read 633 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1503
  • Languages: ja
The delete save button displays "..." in some fonts
« on: October 27, 2020, 09:20:36 AM »
The delete save button displays the character "X", which may be omitted depending on the font and become "...".


This is because the button has a fixed width, but depending on the font, the width of the character "X" may exceed that fixed width. And some themes have offsets.
I noticed this issue because extended defaults to show_delete_buttons = 1. (However, the image above is a standard's screen. And I think the above font and theme combinations may be relatively popular.)

The corresponding code is here:
https://github.com/aburch/simutrans/blob/98d9a3f51c6b71e071a2c52e6ae154049f1a1709/gui/savegame_frame.cc#L31

I think it can be fixed by doing the following.
Code: [Select]
scr_size get_min_size() const OVERRIDE { return scr_size(proportional_string_width("X")+ gui_theme_t::gui_button_text_offset.w*2, D_BUTTON_HEIGHT); }

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4869
  • Languages: EN, DE, AT
Re: The delete save button displays "..." in some fonts
« Reply #1 on: October 31, 2020, 10:06:44 AM »
should be fixed in r9345

Offline Ranran

  • Devotee
  • *
  • Posts: 1503
  • Languages: ja
Re: The delete save button displays "..." in some fonts
« Reply #2 on: November 02, 2020, 11:33:45 AM »
Apologies for my previous incomplete report.  :-[
One of the causes of this bug was that the modern theme had padding.
With the fix of r9345, the buttons are too thin because there is no padding on the left and right of "X" in the theme that does not have padding.
I submit a patch to fix this. please confirm.

Offline Ranran

  • Devotee
  • *
  • Posts: 1503
  • Languages: ja
Re: The delete save button displays "..." in some fonts
« Reply #3 on: November 03, 2020, 12:26:24 PM »
I also remembered that there is a similar issue in the player color dialog.
I apologize for failing to report. I didn't care about that at the time.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4869
  • Languages: EN, DE, AT
Re: The delete save button displays "..." in some fonts
« Reply #4 on: November 03, 2020, 04:13:41 PM »
With the fix of r9345, the buttons are too thin because there is no padding on the left and right of "X" in the theme that does not have padding.
Which theme has this problem?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4869
  • Languages: EN, DE, AT
Re: The delete save button displays "..." in some fonts
« Reply #5 on: November 13, 2020, 07:02:24 PM »
Please test with r9391

Offline Ranran

  • Devotee
  • *
  • Posts: 1503
  • Languages: ja
Re: The delete save button displays "..." in some fonts
« Reply #6 on: November 14, 2020, 11:27:43 AM »
I've confirmed that this has been fixed. Thank you very much.  :)