Skip to content

Commit

Permalink
WinForms: Fix ampersands in profiles toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Feb 2, 2025
1 parent 8e14a8a commit 2e34c4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions NAPS2.Lib.WinForms/EtoForms/Ui/WinFormsDesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,10 @@ protected override void UpdateProfilesToolbar()
var profile = profiles[i];
var item = toolbarItems[i];
item.Tag = profile;
if (item.Text != profile.DisplayName)
var text = profile.DisplayName.Replace("&", "&&");
if (item.Text != text)
{
item.Text = profile.DisplayName;
item.Text = text;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion NAPS2.Lib/EtoForms/Ui/DesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ private void UpdateScanButton()
var commandList = _profileManager.Profiles.Select(profile =>
new ActionCommand(() => _desktopScanController.ScanWithProfile(profile))
{
// TODO: Does this need to change on non-WinForms?
MenuText = profile.DisplayName.Replace("&", "&&"),
IconName = profile == defaultProfile ? "accept_small" : null
})
Expand Down

0 comments on commit 2e34c4e

Please sign in to comment.