Skip to content

Commit 1702729

Browse files
authored
Fix LT-22451: Refresh problem with pop ups (#750)
* Fix LT-22451: Refresh problem with pop ups * Add comment * Add IsShowingLexEntry as requested
1 parent f2c86c6 commit 1702729

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

Src/LexText/Interlinear/FocusBoxController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,12 @@ private void toolTip_Popup(object sender, PopupEventArgs e)
529529
}
530530

531531
}
532+
533+
internal bool ContainsLexEntry(int hvo)
534+
{
535+
Sandbox sandbox = m_sandbox as Sandbox;
536+
return sandbox?.IsShowingLexEntry(hvo) == true;
537+
}
532538
}
533539

534540
/// <summary>

Src/LexText/Interlinear/InterlinDocForAnalysis.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ public override void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvD
104104
MoveFocusBoxIntoPlace();
105105
}
106106
}
107+
if (IsFocusBoxInstalled && FocusBox.SelectedOccurrence != null
108+
&& tag == LexSenseTags.kflidGloss && FocusBox.ContainsLexEntry(hvo))
109+
{
110+
// Somebody changed something in the sandbox. Reset the focus box to reflect the change.
111+
FocusBox.SelectOccurrence(FocusBox.SelectedOccurrence);
112+
MoveFocusBoxIntoPlace();
113+
}
107114
}
108115

109116
protected override void UpdateWordforms(HashSet<IWfiWordform> wordforms)

Src/LexText/Interlinear/SandboxBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,6 +3933,11 @@ internal int CurrentLexEntriesAnalysis(int hvoMorph)
39333933
return hvoMorphEntry;
39343934
}
39353935

3936+
internal bool IsShowingLexEntry(int hvoLex)
3937+
{
3938+
return LexSensesForCurrentMorphs().Contains(hvoLex);
3939+
}
3940+
39363941
/// <summary>
39373942
/// Get's the real lex senses for each current morph.
39383943
/// </summary>

0 commit comments

Comments
 (0)