Esempio n. 1
0
void FTextHistory::Rebuild(TSharedRef< FString, ESPMode::ThreadSafe > InDisplayString)
{
	const bool bIsOutOfDate = IsOutOfDate();

	// FTextHistory_Base will never report being out-of-date, but we need to keep the history revision in sync
	// with the head culture regardless so that FTextSnapshot::IdenticalTo still works correctly
	Revision = FTextLocalizationManager::Get().GetTextRevision();

	if(bIsOutOfDate)
	{
		InDisplayString.Get() = FTextInspector::GetDisplayString(ToText(false));
	}
}
void drawer::DrawItemText (TInt aItemIndex, const TRect &aItemTextRect, 
		TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected) const 
{	
	CALLSTACKITEM_N(_CL("drawer"), _CL("DrawItemText"));

	((drawer*)this)->ResizeItems(aItemIndex, EFalse);

	TBool out_of_date = EFalse;
	contact * con = 0;
	{
		CALLSTACKITEM_N(_CL("drawer"), _CL("DrawItemText1"));
		// we draw the mark on top of the vibrator as necessary
		if (!aItemIsSelected) {
			itemd->SetSubCellSizeL(11, TSize(0, rowheight));
		} else {
			itemd->SetSubCellSizeL(11, TSize(16, rowheight));
		}

		//RDebug::Print(iListBox->Model()->ItemText(aItemIndex));

		if (iBook != 0) {
			CALLSTACKITEM_N(_CL("drawer"), _CL("DrawItemText1.1"));
			con = iBook->GetContact(aItemIndex); 
		} else {
			CFormattedCellListBoxItemDrawer::DrawItemText(aItemIndex, aItemTextRect,
					aItemIsCurrent, aViewIsEmphasized, aItemIsSelected);
			((drawer*)this)->ResizeItems(aItemIndex, ETrue);
			return;
		}
	}

	{
		CALLSTACKITEM_N(_CL("drawer"), _CL("DrawItemText2"));

		if ( (con != NULL) && (con->presence != NULL) )
		{
			TTime stamp = con->presence->iSentTimeStamp();
			out_of_date = IsOutOfDate(stamp, GetTime() );	
		}

		COptionalFormattedCellListBoxData::TColors c = itemd->SubCellColors(1);
		if ( out_of_date ) {
			c.iText = TRgb(128,128,128);
			c.iHighlightedText = TRgb(128,128,128);
				
			c.iBack = TRgb(255,255,255);
			c.iHighlightedBack = TRgb(230,230,230); 
		} else {
			c.iText = TRgb(0,0,0);
			c.iHighlightedText = TRgb(0,0,0);
			c.iBack = TRgb(255,255,255);	
			c.iHighlightedBack = TRgb(170,170,255); // original blue of the list items
		}
		
		itemd->SetSubCellColorsL(1, c);
		itemd->SetSubCellColorsL(2, c);
		itemd->SetSubCellColorsL(3, c);
		itemd->SetSubCellColorsL(4, c);
		itemd->SetSubCellColorsL(5, c);
		itemd->SetSubCellColorsL(6, c);
		itemd->SetSubCellColorsL(7, c);

		COptionalFormattedCellListBoxData::TColors c2 = itemd->SubCellColors(1);
		c2.iText = TRgb(0,0,0);
		c2.iHighlightedText = TRgb(0,0,0);
			
		c2.iBack = TRgb(255,255,255);
		c2.iHighlightedBack = TRgb(230,230,230); // original blue of the list items
		itemd->SetSubCellColorsL(0, c2); // sub cell 0 should always draw text in black

		CFormattedCellListBoxItemDrawer::DrawItemText(aItemIndex, aItemTextRect,
				aItemIsCurrent, aViewIsEmphasized, aItemIsSelected);
			
		if ( aItemIsCurrent) { iListBox->LogVisibleItems(aItemIndex); }
	}

	((drawer*)this)->ResizeItems(aItemIndex, ETrue);
}