diff --git a/Terminal.Gui/Core/View.cs b/Terminal.Gui/Core/View.cs index 3b4d87f93..a859bdb9e 100644 --- a/Terminal.Gui/Core/View.cs +++ b/Terminal.Gui/Core/View.cs @@ -189,7 +189,9 @@ namespace Terminal.Gui { public virtual Key HotKey { get => hotKey; set { - hotKey = TextFormatter.HotKey = value; + if (hotKey != value) { + hotKey = TextFormatter.HotKey = (value == Key.Unknown ? Key.Null : value); + } } } diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs index d33e34e8b..76342dbf1 100644 --- a/Terminal.Gui/Views/Button.cs +++ b/Terminal.Gui/Views/Button.cs @@ -37,7 +37,6 @@ namespace Terminal.Gui { Rune _leftDefault; Rune _rightDefault; Key hotKey = Key.Null; - Rune hotKeySpecifier; /// /// Initializes a new instance of using layout. @@ -155,19 +154,11 @@ namespace Terminal.Gui { } else if (v != Key.Null) { AddKeyBinding (Key.Space | v, Command.Accept); } - hotKey = v; + hotKey = TextFormatter.HotKey = v; } } } - /// - public override Rune HotKeySpecifier { - get => hotKeySpecifier; - set { - hotKeySpecifier = TextFormatter.HotKeySpecifier = value; - } - } - /// protected override void UpdateTextFormatterText () { diff --git a/Terminal.Gui/Views/Checkbox.cs b/Terminal.Gui/Views/Checkbox.cs index 79704061a..d12def889 100644 --- a/Terminal.Gui/Views/Checkbox.cs +++ b/Terminal.Gui/Views/Checkbox.cs @@ -13,8 +13,6 @@ namespace Terminal.Gui { /// The shows an on/off toggle that the user can set /// public class CheckBox : View { - Key hotKey = Key.Null; - Rune hotKeySpecifier; Rune charChecked; Rune charUnChecked; bool @checked; @@ -118,25 +116,6 @@ namespace Terminal.Gui { return Text.RuneSubstring (0, Math.Min (Frame.Width - 2, Text.RuneCount)); } - /// - public override Key HotKey { - get => hotKey; - set { - if (hotKey != value) { - var v = value == Key.Unknown ? Key.Null : value; - hotKey = v; - } - } - } - - /// - public override Rune HotKeySpecifier { - get => hotKeySpecifier; - set { - hotKeySpecifier = TextFormatter.HotKeySpecifier = value; - } - } - /// /// The state of the ///