Skip to content

Commit

Permalink
Merge pull request #36 from Dragon-0609/dev
Browse files Browse the repository at this point in the history
Version 7 update
  • Loading branch information
Dragon-0609 authored Mar 30, 2022
2 parents d07fb38 + ea1e1e5 commit 29c7d59
Show file tree
Hide file tree
Showing 29 changed files with 1,506 additions and 943 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

## English

This program is for people, who want to customize (change) PascalABC.NET IDE. By this program you can select and export default popular color schemes like: `Darcula`, `Monokai` and etc.
This program helps to customize PascalABC.NET IDE. By this program you can apply default popular color schemes like: `Darcula`, `Monokai` and etc.
Also, it includes `Doki Theme`, with over 50 themes, I think you will find the best girl.

Or, you can make your own color scheme by clicking `plus` button. Also, you can import your color scheme from any JetBrains IDE, by clicking `Import`.
Or, you can make your own color scheme by clicking `plus` button.

Before

Expand Down
Binary file modified Screenshots/screen1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Yuki Installer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("6.0")]
[assembly: AssemblyFileVersion ("6.0")]
[assembly: AssemblyVersion ("7.0")]
[assembly: AssemblyFileVersion ("7.0")]
1 change: 1 addition & 0 deletions Yuki Theme Plugin/PluginOptionsContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public void Action (OptionsContentAction action)
Settings.autoFitByWidth = settingsPanel.fitWidth.Checked;
Settings.askToSave = settingsPanel.askSave.Checked;
Settings.saveAsOld = settingsPanel.saveOld.Checked;
Settings.showPreview = settingsPanel.preview.Checked;
Settings.saveData ();
plugin.LoadSticker ();

Expand Down
4 changes: 2 additions & 2 deletions Yuki Theme Plugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("6.0")]
[assembly: AssemblyFileVersion ("6.0")]
[assembly: AssemblyVersion ("7.0")]
[assembly: AssemblyFileVersion ("7.0")]
134 changes: 116 additions & 18 deletions Yuki Theme Plugin/YukiTheme_VisualPascalABCPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ public class YukiTheme_VisualPascalABCPlugin : IVisualPascalABCPlugin, IColorUpd

#endregion

private Size defaultSize;
private Panel panel_bg;
private CustomList themeList;
public Image tmpImage1;
public Image tmpImage2;
private Size defaultSize;
private Panel panel_bg;
private CustomList themeList;
private Label lbl;
public Image tmpImage1;
public Image tmpImage2;

private IconManager manager;
public static ToolBarCamouflage camouflage;
Expand All @@ -160,8 +161,13 @@ public class YukiTheme_VisualPascalABCPlugin : IVisualPascalABCPlugin, IColorUpd
int imagesEnabled = 0; // Is enabled bg image and (or) sticker
bool nameInStatusBar = false; // Name in status bar
private ToolStripItem openInExplorerItem;
const string yukiThemeUpdate = "Yuki Theme Update";
private int lastFocused = -1;
const string yukiThemeUpdate = "Yuki Theme Update";
private int lastFocused = -1;
private bool needToReturnTheme = false;
private bool needToFullExportTheme = false;
private string oldThemeNameForPreExport = "";
private DateTime prevPreExportTime;
private bool hideBG = false;

public PopupFormsController popupController;

Expand Down Expand Up @@ -670,7 +676,6 @@ private void ToggleQuiet (object sender, EventArgs e)
updateQuietImage ();
updateWallpaperImage ();
updateStickerImage ();
// GetWindowProperities ();
}

private void ToggleWallpaper (object sender, EventArgs e)
Expand All @@ -690,10 +695,12 @@ private void SwitchTheme (object sender, EventArgs e)

panel_bg = new CustomPanel (0);
panel_bg.Name = "Custom Panel Switcher";

needToReturnTheme = true;
needToFullExportTheme = false;
prevPreExportTime = DateTime.Now;
Font fnt = new Font (FontFamily.GenericSansSerif, 10, GraphicsUnit.Point);

Label lbl = new Label ();
lbl = new Label ();
lbl.BackColor = bg;
lbl.ForeColor = clr;
lbl.Font = fnt;
Expand Down Expand Up @@ -737,6 +744,7 @@ private void SwitchTheme (object sender, EventArgs e)
themeList.SelectedIndexChanged += ThemeListOnSelectedIndexChanged;
themeList.AccessibleName = themeList.SelectedItem.ToString ();
panel_bg.Click += CloseOnClick;
oldThemeNameForPreExport = themeList.AccessibleName;

panel_bg.Controls.Add (themeList);
panel_bg.Controls.Add (lbl);
Expand Down Expand Up @@ -986,10 +994,38 @@ private void UpdateBottomTextPanel ()
}

public void ReloadLayout ()
{
ReloadLayoutAll (false);
}

public void ReloadLayoutLight ()
{
ReloadLayoutAll (true);
panel_bg.Visible = false;

Timer tim = new Timer ();
tim.Interval = 5;
tim.Tick += (sender, args) =>
{
tim.Stop ();
if (panel_bg != null && !panel_bg.IsDisposed)
{
panel_bg.Visible = true;
panel_bg.BringToFront ();
themeList.searchBar.Focus ();
}
};
tim.Start ();
}

public void ReloadLayoutAll (bool lightReload)
{
HighlightingManager.Manager.ReloadSyntaxModes ();
LoadImage ();
LoadSticker ();
if (!lightReload)
{
LoadImage ();
LoadSticker ();
}
LoadColors ();
UpdateColors ();
fm.Refresh ();
Expand Down Expand Up @@ -1254,7 +1290,7 @@ private void PaintBG (object sender, PaintEventArgs e)
foldmargin.DrawingPosition.Height);
}

if (img != null && bgImage)
if (img != null && bgImage && !hideBG)
{
Size vm = textEditor.ClientSize;
// bool chnd = false;
Expand Down Expand Up @@ -1376,6 +1412,21 @@ private void list_1_DrawItem (object sender, DrawItemEventArgs e)

private void CloseOnClick (object sender, EventArgs e)
{
if (Settings.showPreview)
{
if (needToReturnTheme)
{
needToFullExportTheme = true;
PreviewTheme (themeList.AccessibleName, oldThemeNameForPreExport);
needToReturnTheme = false;
needToFullExportTheme = false;
} else
{
hideBG = !CLI.currentTheme.HasWallpaper;
stickerControl.Visible = Settings.swSticker && CLI.currentTheme.HasSticker;
}
}

fm.Controls.Remove (panel_bg);
panel_bg?.Dispose ();
themeList?.searchBar.Dispose ();
Expand Down Expand Up @@ -1420,19 +1471,66 @@ private void ThemeListOnSelectedIndexChanged (object sender, EventArgs e)
CLI_Actions.ifDoesntHaveSticker2 = null;
}
}

needToReturnTheme = false;
CloseOnClick (sender, e);
}
}

private void ThemeListMouseHover(object sender, EventArgs e)
{
Point point = themeList.PointToClient(Cursor.Position);
int index = themeList.IndexFromPoint(point);
InvalidateItem ();
if (Settings.showPreview)
{
string nm = themeList.Items [themeList.selectionindex].ToString ();
if ((DateTime.Now - prevPreExportTime).TotalMilliseconds >= 25 && nm != oldThemeNameForPreExport) // Preview Theme if delay is more than 25 milliseconds
{
prevPreExportTime = DateTime.Now;
PreviewTheme (nm, oldThemeNameForPreExport);
lbl.BackColor = bg;
lbl.ForeColor = clr;
themeList.BackColor = bgdef;
themeList.ForeColor = clr;
oldThemeNameForPreExport = themeList.Items [themeList.selectionindex].ToString ();
}
}
}

private void PreviewTheme (string name, string oldName)
{
if(name != oldName)
{
if(CLI.SelectTheme (name))
{
CLI.restore ();
hideBG = !CLI.currentTheme.HasWallpaper;
stickerControl.Visible = Settings.swSticker && CLI.currentTheme.HasSticker;
if (needToFullExportTheme)
{
CLI.preview (SyntaxType.NULL, true, ReloadLayoutLight);
} else
{
SyntaxType type = ShadowNames.GetSyntaxByExtension (Path.GetExtension (fm.CurrentCodeFileDocument.FileName));
if (type != SyntaxType.Pascal)
{
CLI.preview (type, true, null); // Not to reload layout
CLI.preview (SyntaxType.Pascal, false, ReloadLayoutLight); // Pascal theme is necessary for UI
} else
{
CLI.preview (type, true, ReloadLayoutLight);
}
}
}
}
}

private void InvalidateItem ()
{
Point point = themeList.PointToClient (Cursor.Position);
int index = themeList.IndexFromPoint (point);
//Do any action with the item
themeList.UpdateHighlighting (index);
}

void setBorder(Control ctl, Control ctl2, Control ctl3)
{
Panel pan = new Panel();
Expand Down
Loading

0 comments on commit 29c7d59

Please sign in to comment.