Implement style switching functionality. Add default, night, and high contrast styles.

This commit is contained in:
Oleg Sh
2026-01-12 19:05:49 +01:00
parent dee5d4c4ea
commit 6f5fb0fc9c
30 changed files with 661 additions and 63 deletions

View File

@@ -475,6 +475,33 @@ Editor.prototype.initButtonActions = function()
resizeCanvas();
}
document.getElementById("ApplyDefaultStyle").onclick = function()
{
userAction("select_default_style");
self.application.PushToStack("change_style");
self.application.UpdateFullStyle(GraphFullStyle);
self.application.redrawGraph();
}
document.getElementById("ApplyNightStyle").onclick = function()
{
userAction("select_night_style");
self.application.PushToStack("change_style");
self.application.UpdateFullStyle(NightGraphFullStyle);
self.application.redrawGraph();
}
document.getElementById("ApplyLargeStyle").onclick = function()
{
userAction("select_contrast_style");
self.application.PushToStack("change_style");
self.application.UpdateFullStyle(ContrastGraphFullStyle);
self.application.redrawGraph();
}
document.getElementById('CanvasSearchText').addEventListener('focus', (event) => {
let datalist = document.getElementById('vertexListCanvas');
const options = datalist.options;
@@ -661,6 +688,12 @@ Editor.prototype.redraw = function() {
this.application.redrawGraph();
}
Editor.prototype.OnRenderToEditor = function()
{
$("#CanvasMessage").css('color', this.application.style.edgeCommonStyle.strokeStyle);
$("#FullscreenIcon").css('color', this.application.style.edgeCommonStyle.strokeStyle);
}
Editor.prototype.createAlgorithmMenu = function()
{
let self = this;