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.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 467515fd70
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-12-10 (Tue, 10 Dec 2013)



------------------
This commit was generated by Migit
This commit is contained in:
2013-12-10 10:42:55 +01:00
parent 87998ee737
commit 83e80ccd68

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++)