diff --git a/WindowTranslator.Abstractions/UserSettings.cs b/WindowTranslator.Abstractions/UserSettings.cs
index 1e1e232e..73eb236b 100644
--- a/WindowTranslator.Abstractions/UserSettings.cs
+++ b/WindowTranslator.Abstractions/UserSettings.cs
@@ -87,6 +87,11 @@ public class TargetSettings
///
public bool IsOneShotMode { get; set; }
+ ///
+ /// マウスポインター判定の余白(ピクセル)
+ ///
+ public double MousePointerHitTestPadding { get; set; }
+
///
/// プラグインの選択
///
@@ -128,4 +133,4 @@ public enum OverlaySwitch
/// トグル
///
Toggle,
-}
\ No newline at end of file
+}
diff --git a/WindowTranslator/Controls/OverlayTextsControl.cs b/WindowTranslator/Controls/OverlayTextsControl.cs
index 494320a9..d98949a6 100644
--- a/WindowTranslator/Controls/OverlayTextsControl.cs
+++ b/WindowTranslator/Controls/OverlayTextsControl.cs
@@ -64,5 +64,15 @@ public double Scale
public static readonly DependencyProperty ScaleProperty =
DependencyProperty.Register(nameof(Scale), typeof(double), typeof(OverlayTextsControl), new PropertyMetadata(1.0));
+ public double MousePointerHitTestPadding
+ {
+ get => (double)GetValue(MousePointerHitTestPaddingProperty);
+ set => SetValue(MousePointerHitTestPaddingProperty, value);
+ }
+
+ /// Identifies the dependency property.
+ public static readonly DependencyProperty MousePointerHitTestPaddingProperty =
+ DependencyProperty.Register(nameof(MousePointerHitTestPadding), typeof(double), typeof(OverlayTextsControl), new PropertyMetadata(0.0));
+
}
diff --git a/WindowTranslator/Data/TextOverlayVisibilityConverter.cs b/WindowTranslator/Data/TextOverlayVisibilityConverter.cs
index 024afc03..00282812 100644
--- a/WindowTranslator/Data/TextOverlayVisibilityConverter.cs
+++ b/WindowTranslator/Data/TextOverlayVisibilityConverter.cs
@@ -11,11 +11,15 @@ public sealed class TextOverlayVisibilityConverter : IMultiValueConverter
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
- if (values is not [TextRect rect, Point pos, double scale, bool isSwap])
+ if (values is not [TextRect rect, Point pos, double scale, bool isSwap, double padding])
{
return Visibility.Visible;
}
var r = new Rect(rect.X * scale, rect.Y * scale, rect.Width * scale, rect.Height * scale);
+ if (padding > 0)
+ {
+ r.Inflate(padding * scale, padding * scale);
+ }
return r.Contains(pos) ^ isSwap ? Visibility.Collapsed : Visibility.Visible;
}
diff --git a/WindowTranslator/Modules/Main/MainViewModelBase.cs b/WindowTranslator/Modules/Main/MainViewModelBase.cs
index 8326a7e2..02c49580 100644
--- a/WindowTranslator/Modules/Main/MainViewModelBase.cs
+++ b/WindowTranslator/Modules/Main/MainViewModelBase.cs
@@ -37,6 +37,7 @@ public abstract partial class MainViewModelBase : IDisposable
private readonly double fontScale;
private readonly double overlayOpacity;
private readonly bool isOneShotModeEnabled;
+ private readonly double mousePointerHitTestPadding;
private TextRect[]? lastRequested;
private bool isFirstCapture = true;
@@ -62,6 +63,7 @@ public abstract partial class MainViewModelBase : IDisposable
public ObservableCollection OcrTexts { get; } = [];
public string Font { get; }
+ public double MousePointerHitTestPadding => this.mousePointerHitTestPadding;
public MainViewModelBase(
IPresentationService presentationService,
@@ -82,6 +84,7 @@ public MainViewModelBase(
this.fontScale = options.Value.FontScale;
this.overlayOpacity = options.Value.OverlayOpacity;
this.isOneShotModeEnabled = options.Value.IsOneShotMode;
+ this.mousePointerHitTestPadding = options.Value.MousePointerHitTestPadding;
this.DisplayBusy = options.Value.DisplayBusy;
this.capture = capture ?? throw new ArgumentNullException(nameof(capture));
this.capture.Captured += Capture_CapturedAsync;
diff --git a/WindowTranslator/Modules/Main/OverlayMainWindow.xaml b/WindowTranslator/Modules/Main/OverlayMainWindow.xaml
index 9244b6ce..eda07005 100644
--- a/WindowTranslator/Modules/Main/OverlayMainWindow.xaml
+++ b/WindowTranslator/Modules/Main/OverlayMainWindow.xaml
@@ -31,6 +31,7 @@
x:Name="overlay"
FontFamily="{Binding Font, Mode=OneWay}"
IsSwapVisibility="{Binding IsSwapVisibility, ElementName=host, Mode=OneWay}"
+ MousePointerHitTestPadding="{Binding MousePointerHitTestPadding, Mode=OneWay}"
MousePos="{Binding MousePos, ElementName=host, Mode=OneWay}"
RectHeight="{Binding Height}"
RectWidth="{Binding Width}"
diff --git a/WindowTranslator/Modules/Settings/AllSettingsViewModel.cs b/WindowTranslator/Modules/Settings/AllSettingsViewModel.cs
index 632e1145..a98411a1 100644
--- a/WindowTranslator/Modules/Settings/AllSettingsViewModel.cs
+++ b/WindowTranslator/Modules/Settings/AllSettingsViewModel.cs
@@ -264,6 +264,7 @@ public async Task SaveAsync(object window)
DisplayBusy = t.DisplayBusy,
IsOneShotMode = t.IsOneShotMode,
OverlayOpacity = t.OverlayOpacity,
+ MousePointerHitTestPadding = t.MousePointerHitTestPadding,
}),
};
@@ -466,6 +467,13 @@ public partial class TargetSettingsViewModel(
[ObservableProperty]
private bool isOneShotMode = settings.IsOneShotMode;
+ [property: Category("SettingsViewModel|Misc")]
+ [property: LocalizedDescription(typeof(Resources), $"{nameof(MousePointerHitTestPadding)}_Desc")]
+ [property: Spinnable(Minimum = 0, Maximum = 100)]
+ [property: SortIndex(10)]
+ [ObservableProperty]
+ private double mousePointerHitTestPadding = settings.MousePointerHitTestPadding;
+
public IReadOnlyList Params { get; } = sp.GetServices().Select(p =>
{
var configureType = typeof(IConfigureNamedOptions<>).MakeGenericType(p.GetType());
diff --git a/WindowTranslator/Properties/Resources.ar.resx b/WindowTranslator/Properties/Resources.ar.resx
index 63af0458..580aa430 100644
--- a/WindowTranslator/Properties/Resources.ar.resx
+++ b/WindowTranslator/Properties/Resources.ar.resx
@@ -312,6 +312,12 @@
عرض الترجمة فقط للنص تحت المؤشر
+
+ هامش اختبار مؤشر الماوس
+
+
+ عدد وحدات البكسل المضافة حول منطقة اختبار مؤشر الماوس
+
شفافية خلفية الطبقة العلوية
@@ -447,4 +453,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.de.resx b/WindowTranslator/Properties/Resources.de.resx
index 00177fe2..a7d8dee4 100644
--- a/WindowTranslator/Properties/Resources.de.resx
+++ b/WindowTranslator/Properties/Resources.de.resx
@@ -312,6 +312,12 @@
Overlay-Übersetzung nur für Text an der Mauszeiger-Position anzeigen
+
+ Trefferbereichspuffer des Mauszeigers
+
+
+ Zusätzliche Pixel um den Trefferbereich des Mauszeigers
+
Overlay-Hintergrund-Deckkraft
@@ -456,4 +462,4 @@ Monitore werden nicht unterstützt.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.en.resx b/WindowTranslator/Properties/Resources.en.resx
index 74c0acfa..d34ea235 100644
--- a/WindowTranslator/Properties/Resources.en.resx
+++ b/WindowTranslator/Properties/Resources.en.resx
@@ -312,6 +312,12 @@
Display overlay translation only for text at mouse pointer position
+
+ Mouse pointer hit test padding
+
+
+ Additional pixels added around the mouse pointer hit test area
+
Overlay background opacity
@@ -456,4 +462,4 @@ Monitors are not supported.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.es.resx b/WindowTranslator/Properties/Resources.es.resx
index d22a3c3a..1d5bc4e8 100644
--- a/WindowTranslator/Properties/Resources.es.resx
+++ b/WindowTranslator/Properties/Resources.es.resx
@@ -312,6 +312,12 @@
Mostrar traducción solo para texto bajo el puntero
+
+ Margen de prueba del puntero del ratón
+
+
+ Píxeles adicionales alrededor del área de prueba del puntero del ratón
+
Opacidad del fondo de superposición
@@ -447,4 +453,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.fil.resx b/WindowTranslator/Properties/Resources.fil.resx
index 657dde0d..5a0c8803 100644
--- a/WindowTranslator/Properties/Resources.fil.resx
+++ b/WindowTranslator/Properties/Resources.fil.resx
@@ -312,8 +312,14 @@
Ipakita ang overlay translation para sa teksto sa posisyon ng mouse pointer lamang
+
+ Padding ng hit test ng mouse pointer
+
+
+ Karagdagang mga pixel sa paligid ng hit test area ng mouse pointer
+
- Opacity ng background ng overlay
+ Opasidad ng background ng overlay
Ipadala ang error information sa reporting system. Ang sumusunod na impormasyon ay ipapadala:
@@ -456,4 +462,4 @@ Ang monitor ay hindi suportado.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.fr.resx b/WindowTranslator/Properties/Resources.fr.resx
index f4c7038c..121478f7 100644
--- a/WindowTranslator/Properties/Resources.fr.resx
+++ b/WindowTranslator/Properties/Resources.fr.resx
@@ -312,6 +312,12 @@
Afficher la traduction uniquement pour le texte sous le pointeur
+
+ Marge de test du pointeur de souris
+
+
+ Pixels supplémentaires autour de la zone de test du pointeur de souris
+
Opacité de l'arrière-plan de superposition
@@ -447,4 +453,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.id.resx b/WindowTranslator/Properties/Resources.id.resx
index 494a9598..857c2012 100644
--- a/WindowTranslator/Properties/Resources.id.resx
+++ b/WindowTranslator/Properties/Resources.id.resx
@@ -304,7 +304,7 @@
Terapkan
- Show busy icon
+ Tampilkan ikon sibuk
Terjemahkan hanya saat hamparan diaktifkan
@@ -312,8 +312,14 @@
Tampilkan terjemahan hamparan hanya untuk teks di posisi pointer mouse
+
+ Padding uji hit pointer mouse
+
+
+ Jumlah piksel tambahan di sekitar area uji hit pointer mouse
+
- Overlay background opacity
+ Opasitas latar belakang hamparan
Kirim informasi kesalahan ke sistem laporan. Informasi berikut akan dikirim:
@@ -326,10 +332,10 @@
> %{color:red}**Informasi pribadi tidak akan dikirim, tetapi pastikan informasi pribadi tidak termasuk dalam layar target terjemahan.**%
- Send Information
+ Kirim informasi
- Sent
+ Terkirim
Salin Informasi
@@ -455,4 +461,4 @@ Monitor tidak didukung.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.ko.resx b/WindowTranslator/Properties/Resources.ko.resx
index 186b4ee9..ac4ccca1 100644
--- a/WindowTranslator/Properties/Resources.ko.resx
+++ b/WindowTranslator/Properties/Resources.ko.resx
@@ -312,6 +312,12 @@
마우스 포인터 위치의 텍스트에만 오버레이 번역을 표시
+
+ 마우스 포인터 판정 여백
+
+
+ 마우스 포인터 판정 영역에 추가하는 픽셀 수
+
오버레이 배경 불투명도
@@ -456,4 +462,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.ms.resx b/WindowTranslator/Properties/Resources.ms.resx
index 6f2dbe69..c4e894cc 100644
--- a/WindowTranslator/Properties/Resources.ms.resx
+++ b/WindowTranslator/Properties/Resources.ms.resx
@@ -304,7 +304,7 @@
Guna
- Show busy icon
+ Tunjukkan ikon sibuk
Terjemah hanya apabila hamparan didayakan
@@ -312,8 +312,14 @@
Paparkan terjemahan hamparan hanya untuk teks pada kedudukan penunjuk tetikus
+
+ Padding ujian sentuh penunjuk tetikus
+
+
+ Bilangan piksel tambahan di sekeliling kawasan ujian sentuh penunjuk tetikus
+
- Overlay background opacity
+ Kelegapan latar belakang hamparan
Hantar maklumat ralat ke sistem laporan. Maklumat berikut akan dihantar:
@@ -326,10 +332,10 @@
> %{color:red}**Maklumat peribadi tidak akan dihantar, tetapi sila pastikan maklumat peribadi tidak disertakan dalam skrin sasaran terjemahan.**%
- Send Information
+ Hantar maklumat
- Sent
+ Dihantar
Salin Maklumat
@@ -455,4 +461,4 @@ Monitor tidak disokong.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.pl.resx b/WindowTranslator/Properties/Resources.pl.resx
index 93400dac..12d726e2 100644
--- a/WindowTranslator/Properties/Resources.pl.resx
+++ b/WindowTranslator/Properties/Resources.pl.resx
@@ -312,6 +312,12 @@
Wyświetlaj tłumaczenie nakładki tylko dla tekstu pod pozycją wskaźnika myszy
+
+ Margines testu trafienia wskaźnika myszy
+
+
+ Dodatkowe piksele wokół obszaru testu trafienia wskaźnika myszy
+
Krycie tła nakładki
@@ -456,4 +462,4 @@ Monitory nie są obsługiwane.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.pt-BR.resx b/WindowTranslator/Properties/Resources.pt-BR.resx
index 9ae483a0..c67b535e 100644
--- a/WindowTranslator/Properties/Resources.pt-BR.resx
+++ b/WindowTranslator/Properties/Resources.pt-BR.resx
@@ -304,53 +304,59 @@
Terapkan
- Show busy icon
+ Mostrar ícone de ocupado
- Terjemahkan hanya saat hamparan diaktifkan
+ Traduzir apenas quando a sobreposição estiver ativada
- Tampilkan terjemahan hamparan hanya untuk teks di posisi pointer mouse
+ Exibir tradução da sobreposição apenas para texto na posição do ponteiro do mouse
+
+
+ Margem do teste de acerto do ponteiro do mouse
+
+
+ Pixels adicionais adicionados ao redor da área de teste de acerto do ponteiro do mouse
- Overlay background opacity
+ Opacidade do fundo da sobreposição
- Kirim informasi kesalahan ke sistem laporan. Informasi berikut akan dikirim:
-* Informasi aplikasi
-* Spesifikasi PC dan informasi lingkungan
-* Nama aplikasi target terjemahan
-* Gambar target terjemahan
-* Pengaturan target terjemahan
+ Enviar informações de erro para o sistema de relatórios. As seguintes informações serão enviadas:
+* Informações do aplicativo
+* Especificações do PC e informações do ambiente
+* Nome do aplicativo alvo da tradução
+* Imagem do alvo da tradução
+* Configurações do alvo da tradução
-> %{color:red}**Informasi pribadi tidak akan dikirim, tetapi pastikan informasi pribadi tidak termasuk dalam layar target terjemahan.**%
+> %{color:red}**Informações pessoais não serão enviadas, mas certifique-se de que a tela do alvo da tradução não contenha informações pessoais.**%
- Send Information
+ Enviar informações
- Sent
+ Enviado
- Salin Informasi
+ Copiar informações
- Disalin
+ Copiado
- Konfirmasi
+ Confirmar
- Submit
+ Enviar
- Log
+ Registro
- Melampirkan
+ Anexando
- Ekspor
+ Exportar
Kosongkan
@@ -455,4 +461,4 @@ Monitor tidak didukung.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.resx b/WindowTranslator/Properties/Resources.resx
index 5e6bfd5f..abc7f099 100644
--- a/WindowTranslator/Properties/Resources.resx
+++ b/WindowTranslator/Properties/Resources.resx
@@ -312,6 +312,12 @@
マウスポインター位置のテキストのみオーバレイ翻訳を表示する
+
+ マウスポインター判定の余白
+
+
+ マウスポインター周辺の判定領域に追加するピクセル数
+
オーバーレイ背景の不透明度
@@ -456,4 +462,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.ru.resx b/WindowTranslator/Properties/Resources.ru.resx
index dd98967c..30166ed9 100644
--- a/WindowTranslator/Properties/Resources.ru.resx
+++ b/WindowTranslator/Properties/Resources.ru.resx
@@ -312,6 +312,12 @@
Отображать перевод оверлея только для текста в позиции указателя мыши
+
+ Отступ зоны проверки указателя мыши
+
+
+ Дополнительные пиксели вокруг зоны проверки указателя мыши
+
Непрозрачность фона оверлея
@@ -447,4 +453,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.th.resx b/WindowTranslator/Properties/Resources.th.resx
index efb6f04e..a8fa27c7 100644
--- a/WindowTranslator/Properties/Resources.th.resx
+++ b/WindowTranslator/Properties/Resources.th.resx
@@ -312,6 +312,12 @@
แสดงการแปลโอเวอร์เลย์เฉพาะข้อความที่ตำแหน่งเมาส์เท่านั้น
+
+ ระยะขยายพื้นที่ตรวจจับเมาส์
+
+
+ จำนวนพิกเซลที่เพิ่มรอบพื้นที่ตรวจจับเมาส์
+
ความทึบแสงของพื้นหลังโอเวอร์เลย์
@@ -456,4 +462,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.tr.resx b/WindowTranslator/Properties/Resources.tr.resx
index cd9c45fa..5c3f3397 100644
--- a/WindowTranslator/Properties/Resources.tr.resx
+++ b/WindowTranslator/Properties/Resources.tr.resx
@@ -312,6 +312,12 @@
Kaplama çevirisini yalnızca fare işaretçisi konumundaki metin için göster
+
+ Fare işaretçisi isabet testi dolgusu
+
+
+ Fare işaretçisi isabet testi alanına eklenen piksel sayısı
+
Kaplama arka plan opaklığı
@@ -456,4 +462,4 @@ Monitör desteklenmiyor.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.vi.resx b/WindowTranslator/Properties/Resources.vi.resx
index 81d73a70..a98af764 100644
--- a/WindowTranslator/Properties/Resources.vi.resx
+++ b/WindowTranslator/Properties/Resources.vi.resx
@@ -312,6 +312,12 @@
Chỉ hiển thị bản dịch lớp phủ cho văn bản tại vị trí con trỏ chuột
+
+ Vùng đệm kiểm tra trỏ chuột
+
+
+ Số pixel bổ sung quanh vùng kiểm tra của con trỏ chuột
+
Độ mờ nền lớp phủ
@@ -456,4 +462,4 @@ Màn hình không được hỗ trợ.
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.zh-CN.resx b/WindowTranslator/Properties/Resources.zh-CN.resx
index feb1e119..2d4e955f 100644
--- a/WindowTranslator/Properties/Resources.zh-CN.resx
+++ b/WindowTranslator/Properties/Resources.zh-CN.resx
@@ -312,6 +312,12 @@
仅在鼠标指针位置的文本上显示覆盖翻译
+
+ 鼠标指针命中检测边距
+
+
+ 为鼠标指针命中检测区域增加的像素数
+
覆盖层背景不透明度
@@ -456,4 +462,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Properties/Resources.zh-TW.resx b/WindowTranslator/Properties/Resources.zh-TW.resx
index 784cc9d9..eff0a897 100644
--- a/WindowTranslator/Properties/Resources.zh-TW.resx
+++ b/WindowTranslator/Properties/Resources.zh-TW.resx
@@ -312,6 +312,12 @@
僅在滑鼠指標位置的文字上顯示重疊翻譯
+
+ 滑鼠指標命中測試邊距
+
+
+ 加入至滑鼠指標命中測試區域的像素數
+
覆蓋層背景不透明度
@@ -456,4 +462,4 @@
-
\ No newline at end of file
+
diff --git a/WindowTranslator/Themes/Generic.xaml b/WindowTranslator/Themes/Generic.xaml
index e1e0bc98..0ae7061c 100644
--- a/WindowTranslator/Themes/Generic.xaml
+++ b/WindowTranslator/Themes/Generic.xaml
@@ -121,6 +121,7 @@
+