diff --git a/GitUI/CommandsDialogs/BrowseDialog/FormBrowseMenus.cs b/GitUI/CommandsDialogs/BrowseDialog/FormBrowseMenus.cs
index 8e1cfa423bd..b4b1684e0d2 100644
--- a/GitUI/CommandsDialogs/BrowseDialog/FormBrowseMenus.cs
+++ b/GitUI/CommandsDialogs/BrowseDialog/FormBrowseMenus.cs
@@ -22,17 +22,11 @@ internal class FormBrowseMenus : ITranslate, IDisposable
///
private readonly ToolStrip _mainMenuStrip;
- ///
- /// The context menu that be shown to allow toggle visibilty of toolbars in .
- ///
- private readonly ContextMenuStrip _toolStripContextMenu = new ContextMenuStrip();
-
private List _navigateMenuCommands;
private List _viewMenuCommands;
private ToolStripMenuItem _navigateToolStripMenuItem;
private ToolStripMenuItem _viewToolStripMenuItem;
- private ToolStripMenuItem _toolbarsMenuItem;
// we have to remember which items we registered with the menucommands because other
// location (RevisionGrid) can register items too!
@@ -44,8 +38,6 @@ public FormBrowseMenus(ToolStrip menuStrip)
CreateMenuItems();
Translate();
-
- _toolStripContextMenu.Opening += (s, e) => RefreshToolbarsMenuItemCheckedState(_toolStripContextMenu.Items);
}
public void Dispose()
@@ -60,7 +52,6 @@ protected virtual void Dispose(bool disposing)
{
_navigateToolStripMenuItem.Dispose();
_viewToolStripMenuItem.Dispose();
- _toolbarsMenuItem.Dispose();
}
}
@@ -79,43 +70,6 @@ public virtual void TranslateItems(ITranslation translation)
TranslationUtils.TranslateItemsFromList("FormBrowse", translation, GetAdditionalMainMenuItemsForTranslation());
}
- ///
- /// Creates menu items for each toolbar supplied in . These menus will
- /// be surfaced in , and ,
- /// and will allow to toggle visibility of the toolbars.
- ///
- /// The list of toobars to toggle visibility for.
- public void CreateToolbarsMenus(params ToolStripEx[] toolStrips)
- {
- Debug.Assert(_toolbarsMenuItem != null, "Toolbars menu item must be already created.");
-
- foreach (ToolStrip toolStrip in toolStrips)
- {
- Debug.Assert(!string.IsNullOrEmpty(toolStrip.Text), "Toolstrip must specify its name via Text property.");
-
- _toolStripContextMenu.Items.Add(CreateItem(toolStrip));
- _toolbarsMenuItem.DropDownItems.Add(CreateItem(toolStrip));
- }
-
- static ToolStripItem CreateItem(ToolStrip senderToolStrip)
- {
- var toolStripItem = new ToolStripMenuItem(senderToolStrip.Text)
- {
- Checked = senderToolStrip.Visible,
- CheckOnClick = true,
- Tag = senderToolStrip
- };
- toolStripItem.Click += (s, e) =>
- {
- senderToolStrip.Visible = !senderToolStrip.Visible;
- };
-
- return toolStripItem;
- }
- }
-
- public void ShowToolStripContextMenu(Point point) => _toolStripContextMenu.Show(point);
-
public void ResetMenuCommandSets()
{
_navigateMenuCommands = null;
@@ -180,14 +134,6 @@ public void InsertRevisionGridMainMenuItems(ToolStripItem insertAfterMenuItem)
_mainMenuStrip.Items.Insert(_mainMenuStrip.Items.IndexOf(insertAfterMenuItem) + 1, _navigateToolStripMenuItem);
_mainMenuStrip.Items.Insert(_mainMenuStrip.Items.IndexOf(_navigateToolStripMenuItem) + 1, _viewToolStripMenuItem);
- // We're a bit lying here - "Toolbars" is not a RevisionGrid menu item,
- // however it is the logical place to add it to the "View" menu
- if (_toolbarsMenuItem.DropDownItems.Count > 0)
- {
- _viewToolStripMenuItem.DropDownItems.Add(new ToolStripSeparator());
- _viewToolStripMenuItem.DropDownItems.Add(_toolbarsMenuItem);
- }
-
// maybe set check marks on menu items
OnMenuCommandsPropertyChanged();
}
@@ -218,21 +164,11 @@ private void CreateMenuItems()
Text = "View"
};
}
-
- if (_toolbarsMenuItem is null)
- {
- _toolbarsMenuItem = new ToolStripMenuItem
- {
- Name = "toolbarsMenuItem",
- Text = "Toolbars",
- };
- _toolbarsMenuItem.DropDownOpening += (s, e) => RefreshToolbarsMenuItemCheckedState(_toolbarsMenuItem.DropDownItems);
- }
}
private IEnumerable<(string name, object item)> GetAdditionalMainMenuItemsForTranslation()
{
- foreach (ToolStripMenuItem menuItem in new[] { _navigateToolStripMenuItem, _viewToolStripMenuItem, _toolbarsMenuItem })
+ foreach (ToolStripMenuItem menuItem in new[] { _navigateToolStripMenuItem, _viewToolStripMenuItem })
{
yield return (menuItem.Name, menuItem);
}
@@ -304,15 +240,6 @@ private IEnumerable GetNavigateAndViewMenuCommands()
throw new ApplicationException("this case is not allowed");
}
}
-
- private void RefreshToolbarsMenuItemCheckedState(ToolStripItemCollection toolStripItems)
- {
- foreach (ToolStripMenuItem item in toolStripItems)
- {
- Debug.Assert(item.Tag is ToolStrip, "Toolbars context menu items must reference Toolstrips via Tag property.");
- item.Checked = ((ToolStrip)item.Tag).Visible;
- }
- }
}
internal enum MainMenuItem
diff --git a/GitUI/CommandsDialogs/FormBrowse.Designer.cs b/GitUI/CommandsDialogs/FormBrowse.Designer.cs
index 6e888d861bf..f6f6a45f5ca 100644
--- a/GitUI/CommandsDialogs/FormBrowse.Designer.cs
+++ b/GitUI/CommandsDialogs/FormBrowse.Designer.cs
@@ -243,6 +243,7 @@ private void InitializeComponent()
this.ToolStripMain.ClickThrough = true;
this.ToolStripMain.Dock = System.Windows.Forms.DockStyle.None;
this.ToolStripMain.GripMargin = new System.Windows.Forms.Padding(0);
+ this.ToolStripMain.GripStyle = ToolStripGripStyle.Hidden;
this.ToolStripMain.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.ToolStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.RefreshButton,
@@ -276,6 +277,7 @@ private void InitializeComponent()
this.ToolStripFilters.ClickThrough = true;
this.ToolStripFilters.Dock = System.Windows.Forms.DockStyle.None;
this.ToolStripFilters.GripMargin = new System.Windows.Forms.Padding(0);
+ this.ToolStripFilters.GripStyle = ToolStripGripStyle.Hidden;
this.ToolStripFilters.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.ToolStripFilters.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripLabel1,
diff --git a/GitUI/CommandsDialogs/FormBrowse.cs b/GitUI/CommandsDialogs/FormBrowse.cs
index 201481eb1c6..45c05ac367d 100644
--- a/GitUI/CommandsDialogs/FormBrowse.cs
+++ b/GitUI/CommandsDialogs/FormBrowse.cs
@@ -277,14 +277,6 @@ public FormBrowse([NotNull] GitUICommands commands, string filter, ObjectId sele
mainMenuStrip.BackColor = toolBackColor;
mainMenuStrip.ForeColor = toolForeColor;
- toolPanel.TopToolStripPanel.MouseClick += (s, e) =>
- {
- if (e.Button == MouseButtons.Right)
- {
- _formBrowseMenus.ShowToolStripContextMenu(Cursor.Position);
- }
- };
-
InitToolStripStyles(toolForeColor, toolBackColor);
foreach (var control in this.FindDescendants())
@@ -615,19 +607,6 @@ protected override void OnApplicationActivated()
protected override void OnLoad(EventArgs e)
{
- // Removing the main menu before restoring the toolstrip layouts
- // as it *does* randomly change the order of the defined items in the menu
- Controls.Remove(mainMenuStrip);
-
- toolPanel.TopToolStripPanel.SuspendLayout();
- ToolStripManager.LoadSettings(this, "toolsettings");
- toolPanel.TopToolStripPanel.ResumeLayout();
-
- // Add the menu back
- Controls.Add(mainMenuStrip);
-
- _formBrowseMenus.CreateToolbarsMenus(ToolStripMain, ToolStripFilters);
-
HideVariableMainMenuItems();
RefreshSplitViewLayout();
LayoutRevisionInfo();
@@ -689,10 +668,6 @@ protected override void OnActivated(EventArgs e)
protected override void OnFormClosing(FormClosingEventArgs e)
{
- // Remove the main menu to prevent its state being persisted
- Controls.Remove(mainMenuStrip);
-
- ToolStripManager.SaveSettings(this, "toolsettings");
SaveApplicationSettings();
foreach (var control in this.FindDescendants())
diff --git a/GitUI/Translation/English.xlf b/GitUI/Translation/English.xlf
index 54b464e9293..b24e9ad206a 100644
--- a/GitUI/Translation/English.xlf
+++ b/GitUI/Translation/English.xlf
@@ -2583,10 +2583,6 @@ Do you want to continue?
Manage stashes
-