fix: 跳过 GridViewRowPresenter 中的文本翻译

添加 IsInGridViewRowPresenter 检查,避免在 GridViewRowPresenter 控件内进行自动翻译,防止潜在的界面显示问题。
This commit is contained in:
辉鸭蛋
2026-02-12 00:00:38 +08:00
parent b0e15ae925
commit e1bc2d01db

View File

@@ -313,6 +313,11 @@ namespace BetterGenshinImpact.View.Behavior
{
continue;
}
if (IsInGridViewRowPresenter(current))
{
continue;
}
TranslateKnown(current, translator);
@@ -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;
}
}
}
}