Skip to content

Commit

Permalink
Fixes #688 by adding new Popup-Dismiss-Reason for KeyTips
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Jan 25, 2019
1 parent abd0848 commit 3a5e98c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
- [#666](../../issues/666) - InRibbonGallery DropDown not layouting correctly
- [#673](../../issues/673) - RibbonContextualTabGroup not shown
- [#677](../../issues/677) - Alt Codes no longer working in alpha version v7.0.0
- [#688](../../issues/688) - Backstage and StartScreen closing when pressing Alt

- ### Enhancements/Features
- [#516](../../issues/516) - Add options to hide the row containing RibbonTabItems
Expand Down
6 changes: 4 additions & 2 deletions Fluent.Ribbon/Controls/Backstage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ private void Handle_DataContextChanged(object sender, DependencyPropertyChangedE
/// </summary>
protected virtual void OnDismissPopup(object sender, DismissPopupEventArgs e)
{
// don't close on dismiss popup event if application lost focus
if (e.DismissReason == DismissPopupReason.ApplicationLostFocus)
// Don't close on dismiss popup event if application lost focus
// or keytips should be shown.
if (e.DismissReason == DismissPopupReason.ApplicationLostFocus
|| e.DismissReason == DismissPopupReason.ShowingKeyTips)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Services/KeyTipService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private void ClearUserInput()

private void ClosePopups()
{
PopupService.RaiseDismissPopupEvent(Keyboard.FocusedElement, DismissPopupMode.Always);
PopupService.RaiseDismissPopupEvent(Keyboard.FocusedElement, DismissPopupMode.Always, DismissPopupReason.ShowingKeyTips);
}

private void RestoreFocus()
Expand Down
7 changes: 6 additions & 1 deletion Fluent.Ribbon/Services/PopupService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ public enum DismissPopupReason
/// <summary>
/// Application lost focus.
/// </summary>
ApplicationLostFocus
ApplicationLostFocus,

/// <summary>
/// Showing key tips.
/// </summary>
ShowingKeyTips
}

/// <summary>
Expand Down

0 comments on commit 3a5e98c

Please sign in to comment.