[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] Font dropdown fix



In message <44720E15.4020000@xxxxxxxxxxx>
          Alex Bligh <alex@xxxxxxxxxxx> wrote:

> Martin Wuerthner wrote:
>> Find attached below a proposed fix for bug 1057. It adds a transient
>> entry to the font dropdown list while a substituted font is the
>> current font. This allows the font name (followed by "(missing)") to
>> be displayed.
> 
> Thanks
> 
>> The string " (missing)" is currently a literal in the code. Do I need
>> to do anything special to expose it for translation?
> 
> Yes you do. I committed it as a separate patch - see below.

Thanks, I see.

There is one cosmetic issue we might want to change: It might be 
preferable to display no icon or a special "missing" icon (e.g., a 
question mark as suggested earlier) next to the missing entry. Most 
notably, this icon is also shown in the font field on the tool bar.

The patch below changes the font type for the extra "missing" entry to 
FC_UNDEFINED, which currently means that no icon is displayed. If we 
wanted one we would just have to update FontDropDown::DrawIcon.

Martin
Index: wxOil/fontdrop.cpp
===================================================================
--- wxOil/fontdrop.cpp	(Revision 1165)
+++ wxOil/fontdrop.cpp	(Arbeitskopie)
@@ -505,13 +505,13 @@
 		{
 			TRACEUSER("wuerthne", _T("update missing item"));
 			FontDropItem *Item = (FontDropItem*)Fonts.GetTail();
-			Item->SetInfo(NewName, TheFont->Type);
+			Item->SetInfo(NewName, FC_UNDEFINED);
 			SelectedIndex = Index - 1;
 		}
 		else
 		{
 			TRACEUSER("wuerthne", _T("add missing item"));
-			FontDropItem *Item = new FontDropItem(NewName, TheFont->Type);
+			FontDropItem *Item = new FontDropItem(NewName, FC_UNDEFINED);
 			Fonts.AddTail(Item);
 			AddItem((void*) Item);
 			m_MissingItemAdded = TRUE;