--- hatari/src/gui-sdl/dlgAbout.c 2019/04/09 08:47:26 1.1.1.7 +++ hatari/src/gui-sdl/dlgAbout.c 2019/04/09 08:54:39 1.1.1.10 @@ -1,23 +1,25 @@ /* Hatari - dlgAbout.c - This file is distributed under the GNU Public License, version 2 or at - your option any later version. Read the file gpl.txt for details. + This file is distributed under the GNU General Public License, version 2 + or at your option any later version. Read the file gpl.txt for details. Show information about the program and its license. */ const char DlgAbout_fileid[] = "Hatari dlgAbout.c : " __DATE__ " " __TIME__; #include "main.h" +#include "version.h" #include "dialog.h" #include "sdlgui.h" +static char aboutstr[] = PROG_NAME; /* The "About"-dialog: */ static SGOBJ aboutdlg[] = { { SGBOX, 0, 0, 0,0, 40,25, NULL }, - { SGTEXT, 0, 0, 13,1, 12,1, PROG_NAME }, + { SGTEXT, 0, 0, 13,1, 12,1, aboutstr }, { SGTEXT, 0, 0, 13,2, 12,1, "=============" }, { SGTEXT, 0, 0, 1,4, 38,1, "Written by Thomas Huth and many other" }, { SGTEXT, 0, 0, 1,5, 38,1, "people around the world." }, @@ -39,13 +41,20 @@ static SGOBJ aboutdlg[] = /*-----------------------------------------------------------------------*/ -/* - Show the "about" dialog: -*/ +/** + * Show the "about" dialog: + */ void Dialog_AboutDlg(void) { - /* Center PROG_NAME title string */ - aboutdlg[1].x = (aboutdlg[0].w - strlen(PROG_NAME)) / 2; + if ((int)strlen(aboutstr) > aboutdlg[0].w) + { + /* Shorten the name if it is too long */ + char *p = strrchr(aboutstr, '('); + if (p) + *(p-1) = 0; + } + /* Center the program name title string */ + aboutdlg[1].x = (aboutdlg[0].w - strlen(aboutstr)) / 2; SDLGui_CenterDlg(aboutdlg); SDLGui_DoDialog(aboutdlg, NULL);