perfetto-ui: Show/hide sidebar
There is now a button on the sidebar that allows it to be
hidden to make full use of screen real-estate for
looking at a trace.
Bug:130355032
Change-Id: I9a6e583bb8d63544dbe28bb0170922f664c52645
diff --git a/ui/src/frontend/panel_container.ts b/ui/src/frontend/panel_container.ts
index a57f068..9b3a7e6 100644
--- a/ui/src/frontend/panel_container.ts
+++ b/ui/src/frontend/panel_container.ts
@@ -25,6 +25,7 @@
RunningStatistics,
runningStatStr
} from './perf';
+import {TRACK_SHELL_WIDTH} from './track_constants';
/**
* If the panel container scrolls, the backing canvas height is
@@ -39,6 +40,7 @@
interface Attrs {
panels: AnyAttrsVnode[];
doesScroll: boolean;
+ kind: 'TRACKS'|'OVERVIEW'|'DETAILS';
}
export class PanelContainer implements m.ClassComponent<Attrs> {
@@ -149,10 +151,15 @@
const parentSizeChanged = this.readParentSizeFromDom(vnodeDom.dom);
const canvasSizeShouldChange =
- this.attrs.doesScroll ? parentSizeChanged : totalPanelHeightChanged;
+ parentSizeChanged || !this.attrs.doesScroll && totalPanelHeightChanged;
if (canvasSizeShouldChange) {
this.updateCanvasDimensions();
this.repositionCanvas();
+ if (this.attrs.kind === 'TRACKS') {
+ globals.frontendLocalState.timeScale.setLimitsPx(
+ 0, this.parentWidth - TRACK_SHELL_WIDTH);
+ }
+ this.redrawCanvas();
}
}