Load theme icons
This commit is contained in:
parent
a0587a0693
commit
9539f6a775
@ -23,6 +23,24 @@ namespace UniversalEditor.UserInterface.WindowsForms.Controls
|
||||
IconMethods.PopulateSystemIcons(ref imlSmallIcons);
|
||||
imlSmallIcons.Images.Add("generic-solution", Properties.Resources.solution_icon);
|
||||
imlSmallIcons.Images.Add("generic-project", Properties.Resources.project_icon);
|
||||
|
||||
RecursiveLoadToolbarItemImages(cbToolBar1.Items);
|
||||
}
|
||||
|
||||
private void RecursiveLoadToolbarItemImages(ToolStripItemCollection coll)
|
||||
{
|
||||
foreach (ToolStripItem tsi in coll)
|
||||
{
|
||||
string name = tsi.Name;
|
||||
if (name.StartsWith("tsb")) name = name.Substring(3);
|
||||
tsi.Image = AwesomeControls.Theming.Theme.CurrentTheme.GetImage("SolutionExplorer/" + name + ".png");
|
||||
if (tsi is ToolStripDropDownItem)
|
||||
{
|
||||
ToolStripDropDownItem tsddi = (tsi as ToolStripDropDownItem);
|
||||
RecursiveLoadToolbarItemImages(tsddi.DropDownItems);
|
||||
if (tsi.Image == null && tsddi.DropDownItems.Count > 0) tsi.Image = tsddi.DropDownItems[0].Image;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MainWindow mvarParentWindow = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user