Public Access
Desktop: decide a titlebar double-click on the press, before the drag can swallow it
This commit is contained in:
1 parent
079a273d46
commit
a2362d1e3e
6 files changed
+127
-3
No files matched your search
@@ -41,6 +41,8 @@ internal sealed partial class TitleBar : UserControl
|
||||
}
|
||||
}
|
||||
|
||||
private readonly CaptionPresses presses = new();
|
||||
|
||||
private Window? Host => TopLevel.GetTopLevel(this) as Window;
|
||||
|
||||
/// <remarks>
|
||||
@@ -55,6 +57,15 @@ internal sealed partial class TitleBar : UserControl
|
||||
return;
|
||||
}
|
||||
|
||||
// Decided on the press, before the drag would take it: see CaptionPresses.
|
||||
if (presses.IsSecond(e, this))
|
||||
{
|
||||
OnToggleMaximised(sender, e);
|
||||
e.Handled = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Host?.BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
@@ -68,7 +79,8 @@ internal sealed partial class TitleBar : UserControl
|
||||
|
||||
/// <remarks>
|
||||
/// Both the button and a double-click on the bar arrive here, which is the convention Windows sets and
|
||||
/// the one people reach for without thinking about it.
|
||||
/// the one people reach for without thinking about it. The double-click comes from <see cref="OnDrag"/>
|
||||
/// rather than <c>DoubleTapped</c>; see <see cref="CaptionPresses"/>.
|
||||
/// </remarks>
|
||||
private void OnToggleMaximised(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user