Skip to content

Commit

Permalink
Fix: Graph widget colour not synced (#63)
Browse files Browse the repository at this point in the history
* fix: graph widget colour not synced

* refactor: clean up code
  • Loading branch information
mrmagic2020 authored Jun 21, 2024
1 parent 0346abc commit e9b058e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ui/generic/windows/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class GraphWindow extends Window<WindowParams> {
whiskerLow: read(params.statistics).min,
whiskerHigh: read(params.statistics).max,
range: params.boxChartRange,
background: baseData.global.colour_scheme.secondary.store.get()
background: baseData.global.colour_scheme.secondary.store
})
],
onClose: () => {
Expand Down
8 changes: 5 additions & 3 deletions src/ui/generic/windows/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
window
} from "openrct2-flexui"

class Window<T extends WindowParams | TabWindowParams> {
type AnyWindowParams = WindowParams | TabWindowParams

class Window<T extends AnyWindowParams> {
protected _windowParams: T
protected _windowTemplate: WindowTemplate
protected _isOpen: boolean

private isTabWindowParams(
params: WindowParams | TabWindowParams
params: AnyWindowParams
): params is TabWindowParams {
return (params as TabWindowParams).tabs !== undefined
}
Expand Down Expand Up @@ -61,7 +63,7 @@ class Window<T extends WindowParams | TabWindowParams> {
this.open()
}

setProperties(properties: Partial<WindowParams>) {
setProperties(properties: Partial<AnyWindowParams>) {
this._windowParams = { ...this._windowParams, ...properties }
}
}
Expand Down

0 comments on commit e9b058e

Please sign in to comment.