mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
change getRenderWidth() default to UTF8
Origin commit data
------------------
Commit: 8b91cda918
Author: vanhofen <vanhofen@gmx.de>
Date: 2014-06-11 (Wed, 11 Jun 2014)
Origin message was:
------------------
- change getRenderWidth() default to UTF8
This commit is contained in:
@@ -117,7 +117,7 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
string s_time = cl_timestr;
|
||||
|
||||
//get minimal required height, width from raw text
|
||||
int min_text_w = (*getClockFont())->getRenderWidth(s_time, true);;
|
||||
int min_text_w = (*getClockFont())->getRenderWidth(s_time);
|
||||
int min_text_h = (*getClockFont())->getHeight();
|
||||
height = max(height, min_text_h);
|
||||
width = max(width, min_text_w);
|
||||
@@ -153,7 +153,7 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
int minSepWidth = 0;
|
||||
string sep[] ={" ", ".", ":"};
|
||||
for (size_t i = 0; i < sizeof(sep)/sizeof(sep[0]); i++)
|
||||
minSepWidth = max((*getClockFont())->getRenderWidth(sep[i], true), minSepWidth);
|
||||
minSepWidth = max((*getClockFont())->getRenderWidth(sep[i]), minSepWidth);
|
||||
|
||||
//modify available label items with current segment chars
|
||||
for (size_t i = 0; i < v_cc_items.size(); i++)
|
||||
@@ -179,7 +179,7 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
if (isdigit(stmp.at(0)) ) //check for digits, if true, we use digit width
|
||||
wtmp = (*getClockFont())->getMaxDigitWidth();
|
||||
else //not digit found, we use render width or minimal width
|
||||
wtmp = max((*getClockFont())->getRenderWidth(stmp, true), minSepWidth);
|
||||
wtmp = max((*getClockFont())->getRenderWidth(stmp), minSepWidth);
|
||||
|
||||
//set size, text, color of current item
|
||||
lbl->setDimensionsAll(cl_x, cl_y, wtmp, cl_h);
|
||||
|
Reference in New Issue
Block a user