mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
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:
@@ -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++)
|
||||
|
Reference in New Issue
Block a user