mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
fix: 跳过 GridViewRowPresenter 中的文本翻译
添加 IsInGridViewRowPresenter 检查,避免在 GridViewRowPresenter 控件内进行自动翻译,防止潜在的界面显示问题。
This commit is contained in:
@@ -314,6 +314,11 @@ namespace BetterGenshinImpact.View.Behavior
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsInGridViewRowPresenter(current))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TranslateKnown(current, translator);
|
||||
|
||||
if (current is FrameworkElement feCurrent)
|
||||
@@ -750,6 +755,22 @@ namespace BetterGenshinImpact.View.Behavior
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
private static bool IsInGridViewRowPresenter(DependencyObject obj)
|
||||
{
|
||||
DependencyObject? current = obj;
|
||||
while (current != null)
|
||||
{
|
||||
if (current is GridViewRowPresenter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
current = GetParentObject(current);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user