Skip to content

Commit

Permalink
A couple of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brondavies committed Nov 27, 2024
1 parent c0f3646 commit d505163
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 56 deletions.
67 changes: 33 additions & 34 deletions src/TrayToolbar/Controls/FolderControl.resx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
Expand Down Expand Up @@ -48,7 +48,7 @@
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
Expand Down Expand Up @@ -121,31 +121,30 @@
<data name="BrowseFolderButton.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAAYRJREFUOE+lks0rBHEch8eNi4OIgyjsAXvhL1AuDq4ou15S2+Y9pEVIkiRJCQcp
L7lskeSmHERewrDLrveXlZdYbwcK5TGzM9odb5t862ku388zn/n9Rvj3PLtdATaL3rlsEPBlozLOpq78
PlLY8XI6xNNqvQZbRQTqyu8jv427CVgwaHAPpyCWht9/biZjTRe21fjPApbykAw8Tht5mMr0MlvHZHaw
Sx8qxGoF81kwJ5PpQwZrpiDP5/g2kLFbYl41gnVz0Jcl0RTI+WAaHHXAfivsNIGjFq5GEUvClDP6EIhF
IUqT6xG4HICzPjjpgsN22GuB7UbYsiDV8ezJOY3g48lFP5z2wHEnHLTBbjM462GzGjbKYa3Qj8DV/bWy
vQrWS2HVLB1uvh/Bd5XFYlgxwWKuckOfBW/uMa/gu8rLBVI4x3vFvgJbdfyWoyFZEdyOKxJ/3IxJv0ik
IpAnNUrQiWXRj/aaRI/IH3ZLAge9xic1roxjxqq7WbRm/IEkNfqfEYR33M4gabLk4uQAAAAASUVORK5C
YII=
vAAADrwBlbxySQAAAX1JREFUOE+lkssrRGEYh48dGwsRC1EuC8yGv0DZWNiijFtqkssQ0kFIkiRJCQsp
l2ymSLJTFiJDOJxh3G8jlxi3BYXy6Dgxc86cmvCrZ/ee5/t95/0E4b95dbsCZNG0s2IW8GazOk7WzxpG
Fk3Ot/MRXtYaNchVEehnDaOcxsMULJk1uEdTkazhj/pmCrYMYdevgOUCkKw8z+byNJPlYb6B6ZxglylU
iNUKFrNhQSHLi0zWLUFf19G3cIgx7xrBRnGQz5BkCeRyOB1OuuCwHfZawFkPN+NI5WHqP/oWSKUhapPb
MbgegosBOOuB4044aIPdZtgWQa76mlO+0wh+rnI1COd9cNoNRx2w3wo7jbBVC5uVsF7iR+Dq9a3sqIEN
K6wVw3KhH4FRZakMVi1gz1c3pBd8uCc8AqPKK0Vgz/Os2Fsg1yZsO5tSVMH9pCrxx90EkjXS81LTooR4
qSL62VGX5LNKIxxiIkf9uS8/AiXOOVv8nd2W+QuSNYK/5hPcziBpHQJ2awAAAABJRU5ErkJggg==
</value>
</data>
<data name="DeleteFolderButton.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJpSURBVDhPpZP7S1NhGMf9W/SHKEGiGyFhFBTmvMyd
tTa3eTvL9LjFIpam7AzTDGoYuvCHcJbaVSt/yTSxUV4ycnYdWh4rL+3URq3pObumfNsmbS5HEL3weeE8
PJ/vy3nOeZMA/BcbCgsaTco8Van/QJUzsyqSm1GVcO9JJTNFyvW2UmnKn/1xD4tqDfGJotjvpib4RywI
vLUiMDEK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n4zlQj2KRbBXeCRKjnMl7kZ2NYmk3HBe+pw0yg5woi3Tb4TTX4UixNymINCd7cAK+xFg+I
LCYuYLSaYPheDyJWI/yn9PhT8ypE8FFFWLC1Yih/ezAumCaLg0vdHQg16xE8WbE2F29RwXy5CgttrRgU
b04IpspUjM/UgCULDe6YOrYwKcp8+BvrMVdfjQFBZuIIzhI5zcgECHZ3wq+RwVcuWRdm5UKwhRIE7Bcx
Kt6K/tyNiSK+KpamPi8lPO7KUgRudsQKNq8S/wwq8sDKhGBlYvCd7ZgskUbDnl5BeuIao0wUiohxxX7e
dUiFwNUOfGum4SWV+KRWwNdkAH+pHVPqAvTlZvC9gvTVD+kXT+T7iMcH9rAOyU58rquGr+VcjI+1R/FQ
tCUaZn8PrxNEGZHuShsWZxmGiB3M/YJt3KBgE9efl8n0CTMMvTkb/v6Z/oUfHdLOuUgtmkUAAAAASUVO
RK5CYII=
</value>
</data>
<metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Expand All @@ -154,18 +153,18 @@
<data name="ErrorIcon.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ5SURBVDhPpZP9SxNxHMf9WzRMeyAkgvAHzQfE7MHY
mQ/pMbc5N2v5wMikvOkeJFckaohJhC5zKAQFVlCpiYRIhFEWUZeR2m3twYd557xZ8O57N27LiiD6wPu4
u8/39f58P9+HBAD/pd9+fG87nbTlqGEiNgO72arnNyw6nm/WsKELamb1PJ306/htHwSkIjajZ8VeC8Hd
DfH+gCze3QUfY0TAXObxNRRTPzOxl4jdSInWaiHU68C38RGIg5cRdp6RJd5yYmtsGMHuFnwxqYTFmsKY
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
VBKVksC1unNYtVYgWK8FN3Ibc0RmVDUINpZFt8cGsNVuVFuVEuOf5mUDCfxuKUfAVIaAlQQ33I9XxUcS
BuxFDbPp7YLQT6utSoncnW7wD3wy6DeWgtWfxZqbQqCnAzNFGYktLJpP27/ZqrE9dk9tVUpUSgKXdSVY
0hLYGvXire4MpgsOJg7xi+F48ufqAtbf2YzIwyE1MexxI+TplMFFUiPDC1Q9pvL3s5O56YnfKOlDVS4x
X5EtLNOXINwfROh6G1ZMVViurcTqVQrciBcLrfV4kZcuTOTs3XmRFL0pySRea47639doEOimsT7Qi7C3
F2yXC3PkSUzkpPmfZ6fufpUVzZ46nDJzIoN6WXiImS44wE/l7+Mnc9OY8WOp1LOsPX9/TP+iX3Kv1BqL
+sa2AAAAAElFTkSuQmCC
</value>
</data>
</root>
7 changes: 5 additions & 2 deletions src/TrayToolbar/Extensions/SystemTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ public static void SetThemeColors(Control? control, bool dark)
{
backColor = ThemeColors.Current.MenuStripBackColor;
}
if (control is not PictureBox)
if (control is not PictureBox && control.AccessibleRole != AccessibleRole.Caret)
{
control.BackColor = backColor;
if (control.BackColor != Color.Transparent)
{
control.BackColor = backColor;
}
control.ForeColor = foreColor;
}
foreach(Control child in control.Controls)
Expand Down
20 changes: 12 additions & 8 deletions src/TrayToolbar/Models/MenuItemCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public MenuItemCollection() { }
ToolStripMenuItem? parent = null;
foreach (var part in parts)
{
var added = AddFolder(parent, part.ToMenuName(), target, clickHandler, mouseDownHandler, out ToolStripMenuItem? menu);
var exists = AddFolder(parent, part.ToMenuName(), target, clickHandler, mouseDownHandler, out ToolStripMenuItem? menu);
parent = menu;
if (!added && menu != null)
if (!exists && menu != null)
{
//Adds to the menu with folders first, alphabetically
Insert(LastSubMenuIndex(this), menu);
Expand Down Expand Up @@ -99,6 +99,7 @@ internal void CreateMenuItem(
}
var entry = new ToolStripMenuItem
{
Name = menuText,
Text = menuText.ToMenuName(),
CommandParameter = file,
Image = file.GetImage(configuration.LargeIcons),
Expand All @@ -107,14 +108,17 @@ internal void CreateMenuItem(
entry.MouseDown += mouseDownHandler;
if (submenu != null)
{
if (sequential)
submenu.DropDownItems.Add(entry);
else
submenu.DropDownItems.Insert(IndexOfItem(submenu.DropDownItems, entry.Text), entry);
if (submenu.DropDownItems.Find(entry.Name!, false).Length == 0)
{
if (sequential)
submenu.DropDownItems.Add(entry);
else
submenu.DropDownItems.Insert(IndexOfItem(submenu.DropDownItems, entry.Text), entry);
}
}
else
else if (!this.Any(i => i.Name == entry.Name))
{
if (sequential)
if (sequential)
Add(entry);
else
Insert(IndexOfItem(entry.Text), entry);
Expand Down
24 changes: 12 additions & 12 deletions src/TrayToolbar/SettingsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d505163

Please sign in to comment.