Changeset 5982 for branches/newosd

Show
Ignore:
Timestamp:
01/03/08 02:13:42 (11 months ago)
Author:
eugene
Message:

Implemented max lines limit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newosd/src/iface.cpp

    r5981 r5982  
    200200void Iface::displayLayout(string& msg, bool control) 
    201201{ 
     202  trd.fore.color = control ? conf->textControlColor : conf->textColor; 
     203 
    202204  pango_layout_set_text(trd.lay, const_cast<char*>(msg.c_str()), -1); 
    203205 
    204   trd.fore.color = control ? conf->textControlColor : conf->textColor; 
     206  if (conf->maxLines != 0 && 
     207      pango_layout_get_line_count(trd.lay) > conf->maxLines) 
     208  { 
     209    PangoLayoutLine* line = 
     210      pango_layout_get_line_readonly(trd.lay, conf->maxLines); 
     211    pango_layout_set_text(trd.lay, const_cast<char*>(msg.c_str()), 
     212        line->start_index); 
     213  } 
    205214 
    206215  unsigned width, height; 
     
    212221      width, height, conf->offsetHorizontal, conf->offsetVertical); 
    213222 
     223  // TODO implement non-waiting mechanism 
     224 
    214225  aosd_flash(aosd, conf->fadeIn, 
    215226      conf->fadeFull + msg.size() * conf->delayPerChar, conf->fadeOut);