Skip to content
Snippets Groups Projects
Commit bfc1cefa authored by Reeves, David E's avatar Reeves, David E
Browse files

* fixed theme code to use a checked item to make telling which theme you're in easier to read

parent 2c8c26f6
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,16 @@ namespace BDSCodeTools
SavePropFile();
}
public static void RemoveProp(string key)
{
GetPropFile();
if (props.ContainsKey(key))
props.Remove(key);
SavePropFile();
}
public static bool HasProp(string key)
{
GetPropFile();
......
No preview for this file type
......@@ -55,10 +55,9 @@
this.preventMultOpenCBX = new DevExpress.XtraBars.BarCheckItem();
this.barButtonItem5 = new DevExpress.XtraBars.BarButtonItem();
this.barSubItem3 = new DevExpress.XtraBars.BarSubItem();
this.barCheckItem1 = new DevExpress.XtraBars.BarCheckItem();
this.barCheckItem2 = new DevExpress.XtraBars.BarCheckItem();
this.lightThemeBI = new DevExpress.XtraBars.BarButtonItem();
this.darkThemeBI = new DevExpress.XtraBars.BarButtonItem();
this.lightThemeBCI = new DevExpress.XtraBars.BarCheckItem();
this.barSubItem1 = new DevExpress.XtraBars.BarSubItem();
this.findOnPageBI = new DevExpress.XtraBars.BarButtonItem();
this.findInFilesBI = new DevExpress.XtraBars.BarButtonItem();
......@@ -126,6 +125,8 @@
this.barHeaderItem1 = new DevExpress.XtraBars.BarHeaderItem();
this.barButtonItem3 = new DevExpress.XtraBars.BarButtonItem();
this.barToggleSwitchItem1 = new DevExpress.XtraBars.BarToggleSwitchItem();
this.barCheckItem1 = new DevExpress.XtraBars.BarCheckItem();
this.barCheckItem2 = new DevExpress.XtraBars.BarCheckItem();
this.tabbedView1 = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
......@@ -229,9 +230,10 @@
this.barCheckItem1,
this.barCheckItem2,
this.lightThemeBI,
this.darkThemeBI});
this.darkThemeBI,
this.lightThemeBCI});
this.barManager1.MainMenu = this.bar2;
this.barManager1.MaxItemId = 53;
this.barManager1.MaxItemId = 58;
this.barManager1.StatusBar = this.bar3;
//
// bar2
......@@ -432,23 +434,25 @@
this.barSubItem3.Caption = "&View";
this.barSubItem3.Id = 47;
this.barSubItem3.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
new DevExpress.XtraBars.LinkPersistInfo(this.lightThemeBI),
new DevExpress.XtraBars.LinkPersistInfo(this.darkThemeBI)});
new DevExpress.XtraBars.LinkPersistInfo(this.lightThemeBCI)});
this.barSubItem3.Name = "barSubItem3";
//
// lightThemeBI
//
this.lightThemeBI.Caption = "Light Theme B";
this.lightThemeBI.Id = 51;
this.lightThemeBI.Id = 56;
this.lightThemeBI.Name = "lightThemeBI";
this.lightThemeBI.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem6_ItemClick);
//
// darkThemeBI
//
this.darkThemeBI.Caption = "Dark Theme B";
this.darkThemeBI.Id = 52;
this.darkThemeBI.Id = 57;
this.darkThemeBI.Name = "darkThemeBI";
this.darkThemeBI.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem7_ItemClick);
//
// lightThemeBCI
//
this.lightThemeBCI.Caption = "Use Light Theme";
this.lightThemeBCI.Id = 55;
this.lightThemeBCI.Name = "lightThemeBCI";
this.lightThemeBCI.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.lightThemeBCI_CheckedChanged);
//
// barSubItem1
//
......@@ -595,13 +599,13 @@
//
// panelContainer3
//
this.panelContainer3.ActiveChild = this.dockPanel11;
this.panelContainer3.ActiveChild = this.dockPanel12;
this.panelContainer3.Controls.Add(this.dockPanel11);
this.panelContainer3.Controls.Add(this.scenarioDockPanel);
this.panelContainer3.Controls.Add(this.dockPanel12);
this.panelContainer3.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left;
this.panelContainer3.ID = new System.Guid("202e2720-7588-4a34-8253-0724a50ef1d1");
this.panelContainer3.Location = new System.Drawing.Point(0, 0);
this.panelContainer3.Location = new System.Drawing.Point(-242, 0);
this.panelContainer3.Name = "panelContainer3";
this.panelContainer3.OriginalSize = new System.Drawing.Size(242, 200);
this.panelContainer3.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Left;
......@@ -1056,6 +1060,16 @@
this.barToggleSwitchItem1.Id = 48;
this.barToggleSwitchItem1.Name = "barToggleSwitchItem1";
//
// barCheckItem1
//
this.barCheckItem1.Id = 53;
this.barCheckItem1.Name = "barCheckItem1";
//
// barCheckItem2
//
this.barCheckItem2.Id = 54;
this.barCheckItem2.Name = "barCheckItem2";
//
// tabbedView1
//
this.tabbedView1.RootContainer.Element = null;
......@@ -1215,6 +1229,7 @@
private DevExpress.XtraBars.BarCheckItem barCheckItem2;
private DevExpress.XtraBars.BarButtonItem lightThemeBI;
private DevExpress.XtraBars.BarButtonItem darkThemeBI;
private DevExpress.XtraBars.BarCheckItem lightThemeBCI;
}
}
......@@ -891,6 +891,8 @@ namespace BehaviorStudio2
bb = new BarButtonItem(htnSubMenu.Manager, "Update Templates");
templatesBSI.AddItem(bb);
bb.ItemClick += Bb_UpdateHTNTemplates;
lightThemeBCI.Checked = ScintillaPython.IsLightTheme();
}
private void Bb_UpdateHTNTemplates(object sender, ItemClickEventArgs e)
......@@ -1092,18 +1094,10 @@ namespace BehaviorStudio2
CodeCompleteTools.CloseJava();
}
private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e)
{
// set light theme
ScintillaPython.SetColorTheme(true);
MessageBox.Show("Restart the editor to change the colors", "Info");
}
private void barButtonItem7_ItemClick(object sender, ItemClickEventArgs e)
private void lightThemeBCI_CheckedChanged(object sender, ItemClickEventArgs e)
{
// set dark theme
ScintillaPython.SetColorTheme(false);
MessageBox.Show("Restart the editor to change the colors", "Info");
ScintillaPython.SetColorTheme(lightThemeBCI.Checked);
//MessageBox.Show("Restart the editor to change the colors", "Info");
}
}
}
......@@ -157,12 +157,17 @@ namespace ScintillaPythonControl
}
public static bool IsLightTheme()
{
return PropFile.HasProp(BACK_COLOR_KEY);
}
public static void SetColorTheme(bool light)
{
if (!light)
{
PropFile.SetProp(BACK_COLOR_KEY, BACK_COLOR.ToString("X6"));
PropFile.SetProp(FORE_COLOR_KEY, FORE_COLOR.ToString("X6"));
PropFile.RemoveProp(BACK_COLOR_KEY);
PropFile.RemoveProp(FORE_COLOR_KEY);
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment