News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

The delete save button displays "..." in some fonts

Started by Ranran, October 27, 2020, 09:20:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

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.

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

Dwachs

Parsley, sage, rosemary, and maggikraut.

Ranran

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.

Ranran

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.

Dwachs

Quote from: Ranran on November 02, 2020, 11:33:45 AM
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?
Parsley, sage, rosemary, and maggikraut.

Dwachs

Parsley, sage, rosemary, and maggikraut.

Ranran

I've confirmed that this has been fixed. Thank you very much.  :)