CComponentsFrmClock: fix calculate minimal separator width

It's nevertheless necessary to use more than one space char.
Some "exotic" font types can make issues with its size handling.
We use char size of some possible chars to get minimal separator size.
This commit is contained in:
2013-12-10 10:42:55 +01:00
parent 63392accda
commit 467515fd70

View File

@@ -152,9 +152,11 @@ void CComponentsFrmClock::initCCLockItems()
}
}
//calculate minimal separator width, we use a space char...should be enough
//calculate minimal separator width, we use char size of some possible chars
int minSepWidth = 0;
minSepWidth = max((*getClockFont())->getRenderWidth("\x20", true), minSepWidth);
string sep[] ={" ", ".", ":"};
for (size_t i = 0; i < sizeof(sep)/sizeof(sep[0]); i++)
minSepWidth = max((*getClockFont())->getRenderWidth(sep[i], true), minSepWidth);
//modify available label items with current segment chars
for (size_t i = 0; i < v_cc_items.size(); i++)