Skip to content

Commit

Permalink
Reset calc grid section's stroke style after toggling dark/light mode.
Browse files Browse the repository at this point in the history
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I73f2bfdf533fcd0dfb50196945cc915285e44df8
  • Loading branch information
gokaysatir committed Nov 22, 2024
1 parent 57bb7df commit 98254a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions browser/src/canvas/sections/CalcGridSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions browser/src/control/Control.UIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},

Expand Down

0 comments on commit 98254a0

Please sign in to comment.