From 98254a0ee7ede0818dbad7503d480370187f0eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kay=20=C5=9Eat=C4=B1r?= Date: Fri, 22 Nov 2024 22:14:36 +0300 Subject: [PATCH] Reset calc grid section's stroke style after toggling dark/light mode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gökay Şatır Change-Id: I73f2bfdf533fcd0dfb50196945cc915285e44df8 --- browser/src/canvas/sections/CalcGridSection.ts | 4 ++++ browser/src/control/Control.UIManager.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/browser/src/canvas/sections/CalcGridSection.ts b/browser/src/canvas/sections/CalcGridSection.ts index a9631084f0f3..de94b6cb831d 100644 --- a/browser/src/canvas/sections/CalcGridSection.ts +++ b/browser/src/canvas/sections/CalcGridSection.ts @@ -29,6 +29,10 @@ class CalcGridSection extends app.definitions.canvasSectionObject { }; } + public resetStrokeStyle() { + this.sectionProperties.strokeStyle = getComputedStyle(document.body).getPropertyValue('--color-calc-grid'); + } + // repaintArea, paneTopLeft, canvasCtx onDrawArea(area?: Bounds, paneTopLeft?: any): void { if (!this.sectionProperties.docLayer.sheetGeometry) diff --git a/browser/src/control/Control.UIManager.js b/browser/src/control/Control.UIManager.js index e938950e1ea4..7fc442ebd57b 100644 --- a/browser/src/control/Control.UIManager.js +++ b/browser/src/control/Control.UIManager.js @@ -187,6 +187,12 @@ L.Control.UIManager = L.Control.extend({ if (!window.mode.isMobile()) this.refreshAfterThemeChange(); + if (app.map._docLayer._docType === 'spreadsheet') { + const calcGridSection = app.sectionContainer.getSectionWithName(L.CSections.CalcGrid.name); + if (calcGridSection) + calcGridSection.resetStrokeStyle(); + } + this.map.fire('themechanged'); },