Skip to content

Commit a1612f5

Browse files
committed
UI: Fix shortcut text not updating in menus after changing a shortcut in the options
1 parent 2926a49 commit a1612f5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

UI/Debugger/Utilities/ContextMenuAction.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ public List<object>? SubActions
119119
public bool AlwaysShowLabel { get; set; }
120120
public RoutingStrategies RoutingStrategy { get; set; } = RoutingStrategies.Bubble;
121121

122-
public abstract string ShortcutText { get; }
122+
protected abstract string InternalShortcutText { get; }
123123

124+
[Reactive] public string ShortcutText { get; set; } = "";
124125
[Reactive] public string ActionName { get; set; } = "";
125126
[Reactive] public Image? ActionIcon { get; set; }
126127
[Reactive] public bool Enabled { get; set; }
@@ -169,6 +170,7 @@ public void Update()
169170
{
170171
ActionName = Name;
171172

173+
ShortcutText = InternalShortcutText;
172174
if(ShortcutText.Length > 0) {
173175
TooltipText = $"{Name} ({ShortcutText})";
174176
} else {
@@ -233,7 +235,7 @@ public MainMenuAction(EmulatorShortcut? shortcut)
233235
}
234236
}
235237

236-
public override string ShortcutText
238+
protected override string InternalShortcutText
237239
{
238240
get
239241
{
@@ -250,7 +252,7 @@ public override string ShortcutText
250252
public class ContextMenuAction : BaseMenuAction
251253
{
252254
public Func<DbgShortKeys>? Shortcut { get; set; }
253-
public override string ShortcutText => Shortcut?.Invoke().ToString() ?? "";
255+
protected override string InternalShortcutText => Shortcut?.Invoke().ToString() ?? "";
254256

255257
public override void Dispose()
256258
{

0 commit comments

Comments
 (0)