[tools][system-analyzer] Change theme after data load

This CL initialises the change theme button in
correct place and adds the functionality to change
theme after the data load.

Bug: v8:10644

Change-Id: I7397933ff9d12a2ac270d025df1b3327801d89be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2336800
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Cr-Commit-Position: refs/heads/master@{#69238}
This commit is contained in:
Zeynep Cankara 2020-08-05 05:13:01 +01:00 committed by Commit Bot
parent 55891c3c3a
commit ebe332192b
2 changed files with 10 additions and 3 deletions

View File

@ -54,7 +54,7 @@ found in the LICENSE file. -->
display:none;
}
.slider {
background-color: var(--on-surface-color);
background-color: var(--primary-color);
bottom: 0;
cursor: pointer;
left: 0;

View File

@ -152,10 +152,17 @@ class App {
this.fileLoaded = true;
}
refreshTimelineTrackView(){
this.#view.mapTrack.data = this.#state.mapTimeline;
this.#view.icTrack.data = this.#state.icTimeline;
}
switchTheme(event) {
if(this.fileLoaded) return;
document.documentElement.dataset.theme =
event.target.checked ? 'dark' : 'light';
event.target.checked ? 'light' : 'dark';
if(this.fileLoaded) {
this.refreshTimelineTrackView();
}
}
}