|
2 | 2 | using Avalonia.Controls; |
3 | 3 | using Avalonia.Input; |
4 | 4 | using Avalonia.Interactivity; |
5 | | -using Avalonia.Markup.Xaml; |
6 | 5 | using Avalonia.Threading; |
7 | 6 | using MsBox.Avalonia; |
8 | 7 | using MsBox.Avalonia.Enums; |
@@ -88,12 +87,13 @@ private void Window_PointerExited(object? sender, PointerEventArgs e) |
88 | 87 | } |
89 | 88 |
|
90 | 89 | // ---- drag to move + double-click-snap -------------------------------- |
| 90 | + // Double-click detection uses Avalonia's PointerPressedEventArgs.ClickCount |
| 91 | + // (it's already debounced by the OS click-time), so we don't need a manual |
| 92 | + // "_lastClickAt + 350 ms window" check like the WPF version had. |
91 | 93 | private bool _maybeStartDrag; |
92 | 94 | private Point _maybeDragStartPos; |
93 | 95 | private const double DragHysteresisPx = 3; |
94 | 96 | private const double TopStripPx = 50; |
95 | | - private DateTime _lastClickAt = DateTime.MinValue; |
96 | | - private const int DoubleClickWindowMs = 350; |
97 | 97 |
|
98 | 98 | private void Window_PointerPressed(object? sender, PointerPressedEventArgs e) |
99 | 99 | { |
@@ -275,14 +275,6 @@ public void UpdateToggleLabel() |
275 | 275 | }); |
276 | 276 | } |
277 | 277 |
|
278 | | - public void ClearLyrics() |
279 | | - { |
280 | | - _sourceBuf = string.Empty; |
281 | | - _targetBuf = string.Empty; |
282 | | - SourceText.Text = string.Empty; |
283 | | - TranslationText.Text = string.Empty; |
284 | | - } |
285 | | - |
286 | 278 | protected override void OnClosed(EventArgs e) |
287 | 279 | { |
288 | 280 | _settings.OnSourceDelta -= OnSourceDelta; |
|
0 commit comments