remove widest_number definition and usage, add Font::getMaxDigitWidth() method instead

Signed-off-by: M. Liebmann <tuxcode.bbg@gmail.com>


Origin commit data
------------------
Commit: 15b2b2ec05
Author: martii <m4rtii@gmx.de>
Date: 2013-11-29 (Fri, 29 Nov 2013)
This commit is contained in:
martii
2013-11-29 21:06:36 +01:00
committed by Michael Liebmann
parent 189db5deb2
commit 4c2c559da3
10 changed files with 47 additions and 25 deletions

View File

@@ -151,15 +151,7 @@ void CComponentsFrmClock::initCCLockItems()
}
}
int minNumWidth = 0, w_tmp;
char b[2];
b[1] = 0;
for (int i = 0; i < 10; i++) {
b[0] = '0' + i;
w_tmp = (*getClockFont())->getRenderWidth(b, true);
if (w_tmp > minNumWidth)
minNumWidth = w_tmp;
}
int w_tmp;
int minSepWidth = (*getClockFont())->getRenderWidth(":", true);
w_tmp = (*getClockFont())->getRenderWidth(".", true);
if (w_tmp > minSepWidth)
@@ -189,14 +181,13 @@ void CComponentsFrmClock::initCCLockItems()
char c = stmp.at(0);
switch (c) {
case '0' ... '9':
wtmp = minNumWidth;
wtmp = (*getClockFont())->getMaxDigitWidth();
break;
case '.':
case ':':
wtmp = minSepWidth;
break;
default:
b[0] = c;
wtmp = (*getClockFont())->getRenderWidth(stmp, true);
}