From 1d38577d338d6337cd9b4fea4bb4b9d2a88e8848 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 21 Feb 2013 20:23:40 +0000 Subject: Do some semi-automatic text size adjustment. Fixes Gaelic button texts. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2941 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenStatMain.pas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/screens/UScreenStatMain.pas') diff --git a/src/screens/UScreenStatMain.pas b/src/screens/UScreenStatMain.pas index 204f40cd..ef756a43 100644 --- a/src/screens/UScreenStatMain.pas +++ b/src/screens/UScreenStatMain.pas @@ -149,6 +149,17 @@ begin if (Length(Button[1].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[1]); +// This fixes the size of the button texts for gaelic +// Maybe other languages, too. +// Could probably be extended for an automatic text size adjustment +// It simply takes the number of characters, neglecting the actual width. +// The actual width came back as 0. Maybe, it is not properly calculated. + + if (Length(Button[1].Text[0].Text) > 13) then + Button[1].Text[0].Size := 21; + if (Length(Button[1].Text[0].Text) > 22) then + Button[1].Text[0].Size := 19; + AddButton(Theme.StatMain.ButtonSongs); if (Length(Button[2].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[2]); @@ -157,6 +168,9 @@ begin if (Length(Button[3].Text)=0) then AddButtonText(14, 20, Theme.StatDetail.Description[3]); + if (Length(Button[3].Text[0].Text) > 22) then + Button[3].Text[0].Size := 19; + AddButton(Theme.StatMain.ButtonExit); if (Length(Button[4].Text)=0) then AddButtonText(14, 20, Theme.Options.Description[4]); -- cgit v1.2.3