Skip to content

Commit

Permalink
LT-21786: Show variant info for analysis chooser (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeOliver28 authored Jun 3, 2024
1 parent 6e42345 commit 98bb48c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Src/LexText/Interlinear/ChooseAnalysisHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void SetupCombo()
}
}

// Add option to clear the analysis altogeter.
// Add option to clear the analysis altogether.
AddItem(wordform, MakeSimpleString(ITextStrings.ksNewAnalysis), false, WfiWordformTags.kClassId);
// Add option to reset to the default
AddItem(null, MakeSimpleString(ITextStrings.ksUseDefaultAnalysis), false);
Expand Down Expand Up @@ -374,7 +374,6 @@ internal static ITsString MakeAnalysisStringRep(IWfiAnalysis wa, LcmCache fdoCac
ITsTextProps formTextProperties = FormTextProperties(fdoCache, fUseStyleSheet, wsVern);
ITsTextProps glossTextProperties = GlossTextProperties(fdoCache, true, fUseStyleSheet);
ITsStrBldr tsb = TsStringUtils.MakeStrBldr();
ISilDataAccess sda = fdoCache.MainCacheAccessor;
int cmorph = wa.MorphBundlesOS.Count;
if (cmorph == 0)
return TsStringUtils.MakeString(ITextStrings.ksNoMorphemes, fdoCache.DefaultUserWs);
Expand Down Expand Up @@ -436,7 +435,12 @@ internal static ITsString MakeAnalysisStringRep(IWfiAnalysis wa, LcmCache fdoCac
if (sense != null)
{
ITsString tssGloss = sense.Gloss.get_String(fdoCache.DefaultAnalWs);
tsb.Replace(ichMinSense, ichMinSense, tssGloss.Text, glossTextProperties);
var inflType = mb.InflTypeRA;
var glossAccessor = sense.Gloss;
var wsAnalysis = fdoCache.ServiceLocator.WritingSystemManager.Get(fdoCache.DefaultAnalWs);
var tssSense = MorphServices.MakeGlossOptionWithInflVariantTypes(inflType, glossAccessor, wsAnalysis);
var displayText = tssSense?.Text ?? tssGloss.Text;
tsb.Replace(ichMinSense, ichMinSense, displayText, glossTextProperties);
}
else
tsb.Replace(ichMinSense, ichMinSense, ksMissingString, glossTextProperties);
Expand Down Expand Up @@ -569,6 +573,7 @@ public void Activate(Rect loc)
combo.Location = new System.Drawing.Point(loc.left, loc.top);
// 21 is the default height of a combo, the smallest reasonable size.
combo.Size = new System.Drawing.Size(Math.Max(loc.right - loc.left + 30, 200), Math.Max( loc.bottom - loc.top, 50));

if (!m_owner.Controls.Contains(combo))
m_owner.Controls.Add(combo);
}
Expand Down

0 comments on commit 98bb48c

Please sign in to comment.