Skip to content

Commit

Permalink
Merge pull request #37 from Schnapus/master
Browse files Browse the repository at this point in the history
Changes to compile with VS 2022 and .NetCore 8.0
  • Loading branch information
brondavies authored Jan 28, 2025
2 parents 2add60c + f5cda5e commit 69a21ef
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/TrayToolbar/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ private void LoadResources()
}
});

RightClickMenu.Items.AddRange([
new ToolStripMenuItem { Text = R.Options, CommandParameter = Command_Options },
new ToolStripMenuItem { Text = R.Open_Folder, CommandParameter = Command_Open },
new ToolStripMenuItem { Text = R.Exit, CommandParameter = Command_Exit }
]);
List<ToolStripItem> itemsToAdd = [
new ToolStripMenuItem { Text = R.Options, CommandParameter = Command_Options },
new ToolStripMenuItem { Text = R.Open_Folder, CommandParameter = Command_Open },
new ToolStripMenuItem { Text = R.Exit, CommandParameter = Command_Exit }
];


RightClickMenu.Items.AddRange(itemsToAdd.ToArray());
}

private void ShowUpdateAvailable(string updateUri)
Expand Down Expand Up @@ -297,7 +300,9 @@ private void TrayIcon_Click(object? sender, EventArgs e)
var font = LeftClickMenu.Font;
LeftClickMenu.Font = new Font(font.FontFamily, Configuration.FontSize, font.Style, font.Unit, font.GdiCharSet, font.GdiVerticalFont);
LeftClickMenu.Items.Clear();
LeftClickMenu.Items.AddRange([.. MenuItems[folder]]);
List<ToolStripItem> itemsToAdd = [.. MenuItems[folder]];

LeftClickMenu.Items.AddRange(itemsToAdd.ToArray());
LeftClickMenu.Renderer = new MenuRenderer();
trayIcon.ContextMenuStrip = LeftClickMenu;
SystemTheme.SetThemeColors(LeftClickMenu, UseDarkMode());
Expand Down

0 comments on commit 69a21ef

Please sign in to comment.