diff --git a/tools/winscope-ng/protractor.config.js b/tools/winscope-ng/protractor.config.js index dd049504f..1053b50d5 100644 --- a/tools/winscope-ng/protractor.config.js +++ b/tools/winscope-ng/protractor.config.js @@ -30,7 +30,7 @@ exports.config = { args: ["--headless", "--disable-gpu", "--window-size=1280x1024"] } }, - chromeDriver: "./node_modules/webdriver-manager/selenium/chromedriver_105.0.5195.52", + chromeDriver: "./node_modules/webdriver-manager/selenium/chromedriver_106.0.5249.61", allScriptsTimeout: 10000, getPageTimeout: 10000, diff --git a/tools/winscope-ng/src/app/components/adb_proxy.component.spec.ts b/tools/winscope-ng/src/app/components/adb_proxy.component.spec.ts index 24139b8e1..e079a8897 100644 --- a/tools/winscope-ng/src/app/components/adb_proxy.component.spec.ts +++ b/tools/winscope-ng/src/app/components/adb_proxy.component.spec.ts @@ -68,7 +68,7 @@ describe("AdbProxyComponent", () => { it("check correct icon and message displays if unauthorised proxy", () => { component.proxy.setState(ProxyState.UNAUTH); fixture.detectChanges(); - expect(htmlElement.querySelector(".adb-info")?.innerHTML).toBe("Proxy authorisation required"); + expect(htmlElement.querySelector(".adb-info")?.innerHTML).toBe("Proxy authorisation required."); expect(htmlElement.querySelector(".adb-icon")?.innerHTML).toBe("lock"); }); diff --git a/tools/winscope-ng/src/app/components/adb_proxy.component.ts b/tools/winscope-ng/src/app/components/adb_proxy.component.ts index 42daada24..0cab76d1d 100644 --- a/tools/winscope-ng/src/app/components/adb_proxy.component.ts +++ b/tools/winscope-ng/src/app/components/adb_proxy.component.ts @@ -19,52 +19,64 @@ import { proxyClient, ProxyClient, ProxyState } from "trace_collection/proxy_cli @Component({ selector: "adb-proxy", template: ` -
-
-

Launch the Winscope ADB Connect proxy to capture traces directly from your browser.
Python 3.5+ and ADB are required.

-

Run:
python3 $ANDROID_BUILD_TOP/development/tools/winscope-ng/src/adb/winscope_proxy.py

-

Or get it from the AOSP repository.

-
+
+

Launch the Winscope ADB Connect proxy to capture traces directly from your browser.

+

Python 3.5+ and ADB are required.

+

Run: python3 $ANDROID_BUILD_TOP/development/tools/winscope-ng/src/adb/winscope_proxy.py

+

Or get it from the AOSP repository.

- - + +
-
-
+
+

update Your local proxy version is incompatible with Winscope. -

-
-

Please update the proxy to version {{ proxyVersion }}.

-

Run:
python3 $ANDROID_BUILD_TOP/development/tools/winscope-ng/src/adb/winscope_proxy.py

-

Or get it from the AOSP repository.

-
+

+

Please update the proxy to version {{ proxyVersion }}.

+

Run: python3 $ANDROID_BUILD_TOP/development/tools/winscope-ng/src/adb/winscope_proxy.py

+

Or get it from the AOSP repository.

- - + +
-
-
+
+

lock - Proxy authorisation required -

-
-

Enter Winscope proxy token:

- - - -

The proxy token is printed to console on proxy launch, copy and paste it above.

-
+ Proxy authorisation required. +

+

Enter Winscope proxy token:

+ + + +

The proxy token is printed to console on proxy launch, copy and paste it above.

- +
`, - styles: [".proxy-key-field {width: 30rem}"] + styles: [ + ` + .icon-information { + display: flex; + flex-direction: row; + align-items: center; + } + .further-adb-info { + overflow-wrap: break-word; + } + .further-adb-info p { + margin: 10px 0; + } + .proxy-key-field { + width: 30rem + } + ` + ] }) export class AdbProxyComponent { @Input() diff --git a/tools/winscope-ng/src/app/components/app.component.spec.ts b/tools/winscope-ng/src/app/components/app.component.spec.ts index 2206d3c7f..6667ff93b 100644 --- a/tools/winscope-ng/src/app/components/app.component.spec.ts +++ b/tools/winscope-ng/src/app/components/app.component.spec.ts @@ -83,7 +83,7 @@ describe("AppComponent", () => { component.dataLoaded = false; fixture.detectChanges(); expect(htmlElement.querySelector(".welcome-info")).toBeTruthy(); - expect(htmlElement.querySelector(".viewers.hide")).toBeTruthy(); + expect(htmlElement.querySelector("#viewers")).toBeNull(); }); it("displays correct elements when data loaded", async () => { @@ -91,6 +91,6 @@ describe("AppComponent", () => { fixture.detectChanges(); expect(htmlElement.querySelector("#collect-traces-card")).toBeFalsy(); expect(htmlElement.querySelector("#upload-traces-card")).toBeFalsy(); - expect(htmlElement.querySelector(".viewers.show")).toBeTruthy(); + expect(htmlElement.querySelector("#viewers")).toBeTruthy(); }); }); diff --git a/tools/winscope-ng/src/app/components/app.component.ts b/tools/winscope-ng/src/app/components/app.component.ts index 65d006522..bc4ee9550 100644 --- a/tools/winscope-ng/src/app/components/app.component.ts +++ b/tools/winscope-ng/src/app/components/app.component.ts @@ -28,43 +28,41 @@ import { ViewerInputMethodComponent } from "viewers/components/viewer_input_meth selector: "app-root", template: ` - Winscope +

Winscope

- - + +
-
- Welcome to Winscope. Please select source to view traces. -
+

Welcome to Winscope. Please select source to view traces.

-
- - +
+ + - +
-
- -
+ > -
+
@@ -72,36 +70,50 @@ import { ViewerInputMethodComponent } from "viewers/components/viewer_input_meth `, styles: [ ` - .time-slider { - width: 100% - } - .upload-new-btn { - float: right; - position: relative; - vertical-align: middle; - display: inline-block; - } .app-toolbar { + background-color: white; border-bottom: 1px solid var(--default-border); - box-shadow: none; - background-color: rgba(1, 1, 1, 0); - height: 56px; - vertical-align: middle; - position: relative; - display: inline-block; + } + #app-title { + margin: 12px 0; } .toolbar-wrapper { width: 100%; height: 100%; - vertical-align: middle; - position: relative; - display: inline-block; - align-content: center; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; } .welcome-info { + margin: 16px 0; text-align: center; - font: inherit; - padding: 40px; + } + .homepage-card { + flex: 1; + margin: 10px; + overflow: auto; + border: 1px solid var(--default-border); + } + + .homepage-card mat-card-content { + display: flex; + flex-direction: column; + overflow: auto; + } + #viewers { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + overflow: auto; + } + #timescrub { + padding: 8px; + border-top: 1px solid var(--default-border); + } + .time-slider { + width: 100% } ` ], @@ -157,11 +169,6 @@ export class AppComponent { proxyClient.adbData = []; } - public showViewers() { - const isShown = this.dataLoaded ? "show" : "hide"; - return `viewers ${isShown}`; - } - public onDataLoadedChange(dataLoaded: boolean) { if (dataLoaded && !(this.traceCoordinator.getViewers().length > 0)) { this.allTimestamps = this.traceCoordinator.getTimestamps(); diff --git a/tools/winscope-ng/src/app/components/collect_traces.component.ts b/tools/winscope-ng/src/app/components/collect_traces.component.ts index 5e59c5081..76e890e0d 100644 --- a/tools/winscope-ng/src/app/components/collect_traces.component.ts +++ b/tools/winscope-ng/src/app/components/collect_traces.component.ts @@ -28,88 +28,90 @@ import { ParserErrorSnackBarComponent } from "./parser_error_snack_bar_component @Component({ selector: "collect-traces", template: ` - Collect Traces - + Collect Traces + -
Connecting...
+

Connecting...

-
- - +
+ +
- {{ objectKeys(connect.devices()).length > 0 ? "Connected devices:" : "No devices detected" }} - - - - {{ connect.devices()[deviceId].authorised ? "smartphone" : "screen_lock_portrait" }} - - - {{ connect.devices()[deviceId].authorised ? connect.devices()[deviceId].model : "unauthorised" }} ({{ deviceId }}) - - - +

{{ objectKeys(connect.devices()).length > 0 ? "Connected devices:" : "No devices detected" }}

+ + + + {{ connect.devices()[deviceId].authorised ? "smartphone" : "screen_lock_portrait" }} + + {{ connect.devices()[deviceId].authorised ? connect.devices()[deviceId].model : "unauthorised" }} ({{ deviceId }}) + +
-
- - - smartphone - - {{ connect.selectedDevice().model }} ({{ connect.selectedDeviceId() }}) - - - - -
+ + + smartphone + {{ connect.selectedDevice().model }} ({{ connect.selectedDeviceId() }}) + + +
- - + +
-

Dump targets

+

Dump targets

{{setTraces.DUMPS[dumpKey].name}} - +
-
- error - Error: -
-            {{ connect.proxy?.errorText }}
-        
- +
+

+ error + Error: +

+
 {{ connect.proxy?.errorText }} 
+
-
- Tracing... +
+

Tracing...

- +
-
- Loading data... +
+

Loading data...

- + `, styles: [ - ".device-choice {cursor: pointer}", + ` + .change-btn { + margin-left: 5px; + } + .error-wrapper { + display: flex; + flex-direction: row; + align-items: center; + } + ` ] }) export class CollectTracesComponent implements OnInit, OnDestroy { diff --git a/tools/winscope-ng/src/app/components/parser_error_snack_bar_component.ts b/tools/winscope-ng/src/app/components/parser_error_snack_bar_component.ts index 329b9433c..d521cec24 100644 --- a/tools/winscope-ng/src/app/components/parser_error_snack_bar_component.ts +++ b/tools/winscope-ng/src/app/components/parser_error_snack_bar_component.ts @@ -21,15 +21,28 @@ import { ParserError, ParserErrorType } from "parsers/parser_factory"; @Component({ selector: "upload-snack-bar", template: ` -
-
-

{{msg}}

-
-
`, + styles: [ + ` + .snack-bar-container { + display: flex; + flex-direction: row; + align-items: center; + } + .snack-bar-content { + color: white; + } + .snack-bar-action { + margin-left: 12px; + } + ` + ] }) export class ParserErrorSnackBarComponent { diff --git a/tools/winscope-ng/src/app/components/trace_config.component.ts b/tools/winscope-ng/src/app/components/trace_config.component.ts index bb622e5eb..4db0b3efa 100644 --- a/tools/winscope-ng/src/app/components/trace_config.component.ts +++ b/tools/winscope-ng/src/app/components/trace_config.component.ts @@ -20,57 +20,61 @@ import { EnableConfiguration, SelectionConfiguration, TraceConfiguration, TraceC selector: "trace-config", template: `
-

Trace targets

-
    -
    +

    Trace targets

    +
    + {{traces[traceKey].name}} +
    + + +

    {{traces[traceKey].name}} configuration

    + +
    {{traces[traceKey].name}} -
    -
+ *ngFor="let enableConfig of traceEnableConfigs(traces[traceKey])" + color="primary" + class="enable-config" + [disabled]="!traces[traceKey].run && !traces[traceKey].isTraceCollection" + [(ngModel)]="enableConfig.enabled" + (ngModelChange)="changeTraceCollectionConfig(traces[traceKey])" + >{{enableConfig.name}} -
-

{{traces[traceKey].name}} configuration

-
-
- {{enableConfig.name}} - -
+
{{selectionConfig.name}} - - {{ option }} - + *ngFor="let selectionConfig of traceSelectionConfigs(traces[traceKey])" + class="config-selection" + appearance="fill"> + {{selectionConfig.name}} + + {{ option }} +
-
+
`, styles: [ ` - .checkboxes { - columns: 3 10em; - padding: 0; + .card-block { + margin: 15px; } - .config-opt { - position: relative; - display: inline-block; + .checkboxes { + padding: 0; + display: grid; + grid-template-columns: repeat(3, 1fr); + } + .config-selection { + margin: 0 5px; } ` ] diff --git a/tools/winscope-ng/src/app/components/trace_view.component.ts b/tools/winscope-ng/src/app/components/trace_view.component.ts index 914f283f0..665322554 100644 --- a/tools/winscope-ng/src/app/components/trace_view.component.ts +++ b/tools/winscope-ng/src/app/components/trace_view.component.ts @@ -27,54 +27,47 @@ import { Viewer } from "viewers/viewer"; @Component({ selector: "trace-view", template: ` - - - - - - - - - - +
+ + +
+
+
`, styles: [ ` - :host /deep/ .trace-view-header .mat-card-header-text { - margin: 0; - } - .header-items-wrapper { width: 100%; - vertical-align: middle; - position: relative; - display: inline-block; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; } .viewer-nav-bar { - vertical-align: middle; - display: inline-block; + height: 100%; + } + + .trace-view-content { + height: 0; + flex-grow: 1; } .save-btn { - float: right; - vertical-align: middle; - border: none; height: 100%; - margin: 0; - display: inline-block; } ` ] diff --git a/tools/winscope-ng/src/app/components/upload_traces.component.ts b/tools/winscope-ng/src/app/components/upload_traces.component.ts index edd702835..6f54e1b2d 100644 --- a/tools/winscope-ng/src/app/components/upload_traces.component.ts +++ b/tools/winscope-ng/src/app/components/upload_traces.component.ts @@ -24,98 +24,70 @@ import { ParserError } from "parsers/parser_factory"; @Component({ selector: "upload-traces", template: ` - Upload Traces - -
- - - - - {{TRACE_INFO[trace.type].icon}} - {{trace.name}} ({{TRACE_INFO[trace.type].name}}) - - - - - Drag your .winscope file(s) or click to upload -
+ Upload Traces + +
+ + + + {{TRACE_INFO[trace.type].icon}} + {{trace.name}} ({{TRACE_INFO[trace.type].name}}) + + + +

Drag your .winscope file(s) or click to upload

+
-
- - - -
-
+
+ + + +
+
`, styles: [ ` .drop-box { - outline: 2px dashed var(--default-border); - outline-offset: -10px; - background: white; - padding: 10px 10px 10px 10px; height: 400px; - position: relative; - cursor: pointer; + padding: 10px; display: flex; flex-direction: column; overflow: auto; - text-align: center; - align-items: center; - justify-items: center; - vertical-align: middle; - } - .drop-info { - font-weight: normal; - pointer-events: none; - margin: auto; - } - #inputfile { - margin: auto; + outline: 2px dashed var(--default-border); + outline-offset: -10px; + cursor: pointer; } .uploaded-files { - text-align: left; - height: 400px; - overflow: auto; - width: 100%; - } - .listed-file { - width: 100%; - position: relative; - display: inline-block; height: 100%; width: 100%; - } - .listed-file-item { - position: relative; - display: inline-block; - vertical-align: middle; - align-items: center; + overflow: auto; } .close-btn { - float: right; + margin-left: auto; + } + .drop-info { + pointer-events: none; + margin: auto; } ` ] diff --git a/tools/winscope-ng/src/app/components/web_adb.component.ts b/tools/winscope-ng/src/app/components/web_adb.component.ts index 08a6ca9d1..3f1f59a14 100644 --- a/tools/winscope-ng/src/app/components/web_adb.component.ts +++ b/tools/winscope-ng/src/app/components/web_adb.component.ts @@ -18,19 +18,23 @@ import {Component} from "@angular/core"; @Component({ selector: "web-adb", template: ` -
+

info Add new device -

-
-

Click the button below to follow instructions in the Chrome pop-up.

-

Selecting a device will kill all existing ADB connections.

-
-
- -
+

+

Click the button below to follow instructions in the Chrome pop-up.

+

Selecting a device will kill all existing ADB connections.

+ `, - styles: [".icon-message {vertical-align: middle;}"] + styles: [ + ` + .text-icon-wrapper { + display: flex; + flex-direction: row; + align-items: center; + } + ` + ] }) export class WebAdbComponent { adbDevice = null; diff --git a/tools/winscope-ng/src/material-theme.scss b/tools/winscope-ng/src/material-theme.scss new file mode 100644 index 000000000..041a4d84b --- /dev/null +++ b/tools/winscope-ng/src/material-theme.scss @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@use '@angular/material' as mat; + +@import 'https://fonts.googleapis.com/icon?family=Material+Icons'; +@import '//fonts.googleapis.com/css2?family=Google+Sans'; + +$primary: mat.define-palette(mat.$blue-palette, 700); +$accent: mat.define-palette(mat.$pink-palette, A200, A100, A400); + +$typography: mat.define-typography-config( + $font-family: 'Roboto, sans-serif' +); + +@include mat.core($typography); + +$theme: mat.define-light-theme(( + color: ( + primary: $primary, + accent: $accent, + ) +)); + +@include mat.core-theme($theme); + +@include mat.button-theme($theme); +@include mat.card-theme($theme); +@include mat.checkbox-theme($theme); +@include mat.form-field-theme($theme); +@include mat.grid-list-theme($theme); +@include mat.icon-theme($theme); +@include mat.input-theme($theme); +@include mat.list-theme($theme); +@include mat.progress-bar-theme($theme); +@include mat.progress-spinner-theme($theme); +@include mat.radio-theme($theme); +@include mat.select-theme($theme); +@include mat.slider-theme($theme); +@include mat.snack-bar-theme($theme); +@include mat.tabs-theme($theme); +@include mat.tooltip-theme($theme); +@include mat.toolbar-theme($theme); diff --git a/tools/winscope-ng/src/styles.css b/tools/winscope-ng/src/styles.css index 821ececfc..7f4ca53c6 100644 --- a/tools/winscope-ng/src/styles.css +++ b/tools/winscope-ng/src/styles.css @@ -13,95 +13,46 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@import "~@angular/material/prebuilt-themes/indigo-pink.css"; -@import 'https://fonts.googleapis.com/icon?family=Material+Icons'; -@import '//fonts.googleapis.com/css2?family=Google+Sans'; -:root { +html { + height: 100%; + width: 100%; --default-border: #DADCE0; - --default-blue: #1A73E8; } -:root .mat-stroked-button { - margin: 10px; +body { + margin: 0; + height: 100%; + width: 100%; } -.mat-snack-bar-container, .close-snackbar { - color: white; -} - -.mat-snack-bar-container .flex { - display: inline-flex; - align-items: baseline; - position: relative; - vertical-align: middle; - justify-content: space-between; -} - -.mat-snack-bar-container .data { - display: block; -} - -.mat-snack-bar-container .message-wrapper, .mat-snack-bar-container .close { - vertical-align: middle; - position: relative; - display: inline-block; -} - -#app-title { - font-family: 'Google Sans', sans-serif; - font-size: 30; -} - -#title { - font-family: 'Google Sans', sans-serif; - font-size: 18px; -} - -.labels-canvas div { - font-family: 'Google Sans', sans-serif; -} - -h1, p, span { - font-family: 'Google Sans Text', sans-serif; - font-weight: 400; -} - -button span { - font-family: 'Google Sans', sans-serif; - font-weight: 500; -} - -button { - cursor: pointer; -} - -.homepage-card { - border: 1px solid var(--default-border); - width: 50%; - height: 48rem; - display: flex; - overflow: auto; - margin: 10px; -} - -.homepage-card mat-card-content { +app-root { + height: 100%; + width: 100%; display: flex; flex-direction: column; - overflow: auto; } -.trace-card { - padding: 0 !important; - margin: 0 !important; - border: none; - box-shadow: none !important; - height: 100%; - overflow: auto; - display: flex; +.mat-headline, .mat-title, .mat-subheading-2, .mat-body-1, .mat-body-2, .mat-small { + margin: 0; +} + +button.mat-raised-button { margin: 10px; } +button.mat-stroked-button { + margin: 10px; +} + +mat-checkbox { + margin-left: 12px; +} + +mat-icon { + margin: 5px; +} + .card-grid { width: 100%; height: 100%; @@ -109,159 +60,3 @@ button { flex-direction: row; overflow: auto; } - -mat-checkbox { - margin-left: 5px; -} - - -.mat-form-field { - margin: 2px; - padding: 0; -} - -mat-icon { - margin: 5px; -} - -.icon-message, .adb-icon, .adb-info { - vertical-align: middle; -} - -.file-icon { - vertical-align: middle; - outline: none; - background: none; -} - -.card-block { - margin: 15px; -} - -button.mat-raised-button { - background-color: var(--default-blue); - color: white; - margin: 10px; -} - -button.mat-raised-button span { - font-weight: 500; -} - -.tab.inactive { - background-color:white; - color: black; -} - -.input { - opacity: 0; - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; -} - -.subtitle { - font-size: 16px; - line-height: 24px; - font-weight: 500; -} - -.file-input-prompt { - color: white; - background-color: var(--default-blue); - border-radius: 21.5px; - cursor: pointer; -} - -.viewers.hide { - display: none !important; -} - - -.icon-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; -} - -#trace-collection-config button { - background: none; - box-shadow: none; - color: var(--default-blue); -} - -.device-choice button { - border: none; -} - -.trace-section button, .dump-section button { - border: 1px solid var(--default-border); -} - -/* changing colors of pre-built theme */ -.mat-accent .mat-option.mat-selected:not(.mat-option-disabled){color: var(--default-blue)} -.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-indeterminate,.mat-accent .mat-pseudo-checkbox-checked,.mat-accent .mat-pseudo-checkbox-indeterminate{background:var(--default-blue)} -.mat-badge-accent .mat-badge-content{background:var(--default-blue);} -.mat-button.mat-accent,.mat-icon-button.mat-accent,.mat-stroked-button.mat-accent, .mat-stroked-button{color:var(--default-blue)} -.mat-button.mat-accent .mat-button-focus-overlay,.mat-icon-button.mat-accent .mat-button-focus-overlay,.mat-stroked-button.mat-accent .mat-button-focus-overlay{background-color:var(--default-blue)} -.mat-flat-button.mat-accent,.mat-raised-button.mat-accent,.mat-fab.mat-accent,.mat-mini-fab.mat-accent{background-color:var(--default-blue)} -.mat-checkbox-checked.mat-accent .mat-checkbox-background{background-color:var(--default-blue)} -.mat-checkbox-checked:not(.mat-checkbox-disabled).mat-accent .mat-ripple-element,.mat-checkbox:active:not(.mat-checkbox-disabled).mat-accent .mat-ripple-element{background:var(--default-blue)} -.mat-chip.mat-standard-chip.mat-chip-selected.mat-accent{background-color:var(--default-blue);} -.mat-datepicker-content.mat-accent .mat-calendar-body-selected{background-color:var(--default-blue);} -.mat-datepicker-toggle-active.mat-accent{color:var(--default-blue)} -.mat-form-field.mat-focused .mat-form-field-label.mat-accent{color:var(--default-blue)} -.mat-focused .mat-form-field-required-marker{color:var(--default-blue)} -.mat-form-field.mat-focused .mat-form-field-ripple.mat-accent{background-color:var(--default-blue)} -.mat-form-field-type-mat-native-select.mat-focused:not(.mat-form-field-invalid).mat-accent .mat-form-field-infix::after{color:var(--default-blue)} -.mat-form-field-appearance-outline.mat-focused.mat-accent .mat-form-field-outline-thick{color:var(--default-blue)} -.mat-icon.mat-accent{color:var(--default-blue)} -.mat-form-field.mat-accent .mat-input-element{caret-color:var(--default-blue)} -.mat-progress-bar.mat-accent .mat-progress-bar-fill::after{background-color:var(--default-blue)} -.mat-progress-spinner.mat-accent circle,.mat-spinner.mat-accent circle{stroke:var(--default-blue)} -.mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{border-color:var(--default-blue)} -.mat-radio-button.mat-accent .mat-radio-inner-circle,.mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple),.mat-radio-button.mat-accent.mat-radio-checked .mat-radio-persistent-ripple,.mat-radio-button.mat-accent:active .mat-radio-persistent-ripple{background-color:var(--default-blue)} -.mat-form-field.mat-focused.mat-accent .mat-select-arrow{color:var(--default-blue)} -.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb{background-color:var(--default-blue)} -.mat-slide-toggle.mat-checked .mat-ripple-element{background-color:var(--default-blue)} -.mat-slider.mat-accent .mat-slider-track-fill,.mat-slider.mat-accent .mat-slider-thumb,.mat-slider.mat-accent .mat-slider-thumb-label{background-color:var(--default-blue)} -.mat-step-header.mat-accent .mat-step-icon-selected,.mat-step-header.mat-accent .mat-step-icon-state-done,.mat-step-header.mat-accent .mat-step-icon-state-edit{background-color:var(--default-blue);} -.mat-tab-group.mat-accent .mat-ink-bar,.mat-tab-nav-bar.mat-accent .mat-ink-bar{background-color:var(--default-blue)} -.mat-tab-group.mat-background-accent>.mat-tab-header,.mat-tab-group.mat-background-accent>.mat-tab-link-container,.mat-tab-group.mat-background-accent>.mat-tab-header-pagination,.mat-tab-nav-bar.mat-background-accent>.mat-tab-header,.mat-tab-nav-bar.mat-background-accent>.mat-tab-link-container,.mat-tab-nav-bar.mat-background-accent>.mat-tab-header-pagination{background-color:var(--default-blue)} -.mat-toolbar.mat-accent{background:var(--default-blue);} -.mat-simple-snackbar-action{color:var(--default-blue)} - -/* changing fonts of pre-built theme */ -.mat-h1,.mat-headline,.mat-typography .mat-h1,.mat-typography .mat-headline,.mat-typography h1{font:400 24px/32px "Google Sans", sans-serif;letter-spacing:normal;margin:0 0 16px} -.mat-h2,.mat-title,.mat-typography .mat-h2,.mat-typography .mat-title,.mat-typography h2{font:500 20px/32px "Google Sans", sans-serif;letter-spacing:normal;margin:0 0 16px} -.mat-h3,.mat-subheading-2,.mat-typography .mat-h3,.mat-typography .mat-subheading-2,.mat-typography h3{font:400 16px/28px "Google Sans", sans-serif;letter-spacing:normal;margin:0 0 16px} -.mat-h4,.mat-subheading-1,.mat-typography .mat-h4,.mat-typography .mat-subheading-1,.mat-typography h4{font:400 15px/24px "Google Sans", sans-serif;letter-spacing:normal;margin:0 0 16px} -.mat-h5,.mat-typography .mat-h5,.mat-typography h5{font:400 calc(14px * 0.83)/20px "Google Sans", sans-serif;margin:0 0 12px} -.mat-h6,.mat-typography .mat-h6,.mat-typography h6{font:400 calc(14px * 0.67)/20px "Google Sans", sans-serif;margin:0 0 12px} -.mat-body-strong,.mat-body-2,.mat-typography .mat-body-strong,.mat-typography .mat-body-2{font:500 14px/24px "Google Sans Text", sans-serif;letter-spacing:normal} -.mat-body,.mat-body-1,.mat-typography .mat-body,.mat-typography .mat-body-1,.mat-typography{font-family:"Google Sans Text", sans-serif;} -.mat-small,.mat-caption,.mat-typography .mat-small,.mat-typography .mat-caption{font:400 12px/20px "Google Sans Text", sans-serif;letter-spacing:normal} -.mat-display-4,.mat-typography .mat-display-4{font:300 112px/112px "Google Sans", sans-serif;letter-spacing:-0.05em;margin:0 0 56px} -.mat-display-3,.mat-typography .mat-display-3{font:400 56px/56px "Google Sans", sans-serif;letter-spacing:-0.02em;margin:0 0 64px} -.mat-display-2,.mat-typography .mat-display-2{font:400 45px/48px "Google Sans", sans-serif;letter-spacing:-0.005em;margin:0 0 64px} -.mat-display-1,.mat-typography .mat-display-1{font:400 34px/40px "Google Sans", sans-serif;letter-spacing:normal;margin:0 0 64px} -.mat-select-trigger{font-family:"Google Sans", sans-serif;} -.mat-radio-button{font-family:"Google Sans", sans-serif} -.mat-select{font-family:"Google Sans", sans-serif} -.mat-slide-toggle-content{font-family:"Google Sans", sans-serif} -.mat-slider-thumb-label-text{font-family:"Google Sans", sans-serif} -.mat-stepper-vertical,.mat-stepper-horizontal{font-family:"Google Sans", sans-serif} -.mat-tab-group{font-family:"Google Sans", sans-serif} -.mat-tab-label,.mat-tab-link{font-family:"Google Sans", sans-serif; font-weight: 500;} -.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:"Google Sans", sans-serif;} -.mat-tooltip{font-family:"Google Sans", sans-serif;} -.mat-list-item{font-family:"Google Sans", sans-serif} -.mat-list-option{font-family:"Google Sans", sans-serif} -.mat-list-base .mat-subheader{font-family:"Google Sans", sans-serif;} -.mat-list-base[dense] .mat-subheader{font-family:"Google Sans", sans-serif;} -.mat-option{font-family:"Google Sans", sans-serif;} -.mat-optgroup-label{font-family:"Google Sans", sans-serif} -.mat-simple-snackbar{font-family:"Google Sans", sans-serif;} diff --git a/tools/winscope-ng/src/viewers/components/coordinates_table.component.ts b/tools/winscope-ng/src/viewers/components/coordinates_table.component.ts index c9274f065..2d2730123 100644 --- a/tools/winscope-ng/src/viewers/components/coordinates_table.component.ts +++ b/tools/winscope-ng/src/viewers/components/coordinates_table.component.ts @@ -18,44 +18,54 @@ import { Component, Input } from "@angular/core"; @Component({ selector: "coordinates-table", template: ` - null -
- - - - - - - - - - - - - -
LeftTopRightBottom
{{ coordinates.left }}{{ coordinates.top }}{{ coordinates.right }}{{ coordinates.bottom }}
-
+

null

+ + + + + + + + + + + + + +
+

Left

+
+

Top

+
+

Right

+
+

Bottom

+
+

{{ coordinates.left }}

+
+

{{ coordinates.top }}

+
+

{{ coordinates.right }}

+
+

{{ coordinates.bottom }}

+
`, styles: [ ` - .coord-null-value { - color: rgba(0, 0, 0, 0.75); + .table { + width: 100%; + border-collapse: collapse; } - .coord-table-wrapper { - margin-left: 10px; - display: inline-flex; - padding: 3px 0px; + .table td { + padding: 1px 5px; + border: 1px solid var(--default-border); + text-align: center; + overflow-wrap: anywhere; } - .coord-table-wrapper td, .coord-table-wrapper th { - height: auto; - border: 1px solid ar(--default-border); - } - - .coord-table-wrapper .header-row td { + .header-row td { color: gray; - font-weight: 600; } ` ], diff --git a/tools/winscope-ng/src/viewers/components/hierarchy.component.ts b/tools/winscope-ng/src/viewers/components/hierarchy.component.ts index 1090a2a6d..d4b0f5b40 100644 --- a/tools/winscope-ng/src/viewers/components/hierarchy.component.ts +++ b/tools/winscope-ng/src/viewers/components/hierarchy.component.ts @@ -25,10 +25,10 @@ import { TableProperties } from "viewers/common/table_properties"; @Component({ selector: "hierarchy-view", template: ` - +
- Hierarchy - +

Hierarchy

+ Filter...
-
+
- - +
+
- +
`, styles: [ ` .view-header { - position: relative; - display: block; - width: 100%; - min-height: 3.75rem; - align-items: center; + display: flex; + flex-direction: column; border-bottom: 1px solid var(--default-border); + padding-bottom: 12px; } .title-filter { - position: relative; display: flex; - align-items: center; - width: 100%; - margin-bottom: 12px; - } - - .hierarchy-title { - font-weight: medium; - font-size: 16px; - } - - .filter-field { - font-size: 16px; - transform: scale(0.7); - right: 0px; - position: absolute; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; } .view-controls { - display: inline-block; - font-size: 12px; - font-weight: normal; - margin-left: 5px; - } - - .hierarchy-content { display: flex; - flex-direction: column; - overflow-y: auto; - overflow-x: hidden; - } - - .tree-view { - white-space: pre-line; - flex: 1 0 0; - height: 100%; - overflow-y: auto; + flex-direction: row; + flex-wrap: wrap; } .properties-table { padding-top: 5px; - position: relative; - display: block; - width: 100%; + } + + .hierarchy-content { + height: 0; + flex-grow: 1; + overflow-y: auto; } .pinned-items { - border: 2px solid yellow; - position: relative; - display: block; width: 100%; + box-sizing: border-box; + border: 2px solid yellow; + } + + .tree-wrapper { + overflow-y: auto } `, nodeStyles @@ -179,14 +155,6 @@ export class HierarchyComponent { return this.userOptions["flat"]?.enabled; } - public maxHierarchyHeight() { - const headerHeight = this.elementRef.nativeElement.querySelector(".view-header").clientHeight; - const max = this.tableProperties ? 400 : 800; - return { - height: `${max - headerHeight}px` - }; - } - public onPinnedNodeClick(event: MouseEvent, pinnedItem: HierarchyTreeNode) { event.preventDefault(); if (window.getSelection()?.type === "range") { diff --git a/tools/winscope-ng/src/viewers/components/ime_additional_properties.component.ts b/tools/winscope-ng/src/viewers/components/ime_additional_properties.component.ts index 1e3ec34d6..28021f1f3 100644 --- a/tools/winscope-ng/src/viewers/components/ime_additional_properties.component.ts +++ b/tools/winscope-ng/src/viewers/components/ime_additional_properties.component.ts @@ -21,343 +21,289 @@ import { ViewerEvents } from "viewers/common/viewer_events"; @Component({ selector: "ime-additional-properties", template: ` - -
- WM & SF Properties -
-
- +

WM & SF Properties

+
- There is no corresponding WM / SF additionalProperties for this IME entry – - no WM / SF entry is recorded before this IME entry in time. - View later frames for WM & SF properties. +

+ There is no corresponding WM / SF additionalProperties for this IME entry – + no WM / SF entry is recorded before this IME entry in time. + View later frames for WM & SF properties. +

-
+
- WMState -
- {{ - additionalProperties.wm.name }} - There is no corresponding WMState entry. +

WMState

+
+

+ {{ additionalProperties.wm.name }} +

+

+ There is no corresponding WMState entry. +

-
+
-
-
- Source Frame: - -
- Source Visible: - {{ - wmInsetsSourceProviderSourceVisibleOrNull() }} -
- Source Visible Frame: - -
- Position: - {{ wmInsetsSourceProviderPositionOrNull() }} -
- IsLeashReadyForDispatching: - {{ - wmInsetsSourceProviderIsLeashReadyOrNull() }} -
- Controllable: - {{ - wmInsetsSourceProviderControllableOrNull() }} -
+
+

Source Frame:

+ +

+ Source Visible: + &ngsp; + {{ wmInsetsSourceProviderSourceVisibleOrNull() }} +

+

Source Visible Frame:

+ +

+ Position: + &ngsp; + {{ wmInsetsSourceProviderPositionOrNull() }} +

+

+ IsLeashReadyForDispatching: + &ngsp; + {{ wmInsetsSourceProviderIsLeashReadyOrNull() }} +

+

+ Controllable: + &ngsp; + {{ wmInsetsSourceProviderControllableOrNull() }} +

-
+
-
- Title: - {{ - wmImeControlTargetTitleOrNull() }} +
+

+ Title: + &ngsp; + {{ wmImeControlTargetTitleOrNull() }} +

-
+
-
- Title: - {{ - wmImeInputTargetTitleOrNull() }} +
+

+ Title: + &ngsp; + {{ wmImeInputTargetTitleOrNull() }} +

-
+
-
- Title: - {{ - wmImeLayeringTargetTitleOrNull() }} +
+

+ Title: + &ngsp; + {{ wmImeLayeringTargetTitleOrNull() }} +

-
+ -
+
- WMState -
- {{ - additionalProperties.wm.name }} - There is no corresponding WMState entry. +

WMState

+
+

{{ + additionalProperties.wm.name + }}

+

+ There is no corresponding WMState entry. +

- SFLayer -
- {{ - additionalProperties.sf.name }} - There is no corresponding SFLayer entry. +

SFLayer

+
+

{{ + additionalProperties.sf.name + }}

+

+ There is no corresponding SFLayer entry. +

-
- Focus -
- Focused App: - {{ additionalProperties.wm.focusedApp }} -
- Focused Activity: - {{ additionalProperties.wm.focusedActivity }} -
- Focused Window: - {{ additionalProperties.wm.focusedWindow }} -
- Focused Window Color: - {{ - additionalProperties.sf.focusedWindow.color - }} -
- Input Control Target Frame: - -
+
+

Focus

+
+

+ Focused App: + &ngsp; + {{ additionalProperties.wm.focusedApp }} +

+

+ Focused Activity: + &ngsp; + {{ additionalProperties.wm.focusedActivity }} +

+

+ Focused Window: + &ngsp; + {{ additionalProperties.wm.focusedWindow }} +

+

+ Focused Window Color: + &ngsp; + {{ additionalProperties.sf.focusedWindow.color }} +

+

Input Control Target Frame:

+
- Visibility -
- InputMethod Window: - {{ - additionalProperties.wm.isInputMethodWindowVisible - }} -
- InputMethod Surface: - {{ - additionalProperties.sf.inputMethodSurface.isInputMethodSurfaceVisible }} -
+

Visibility

+
+

+ InputMethod Window: + &ngsp; + {{ additionalProperties.wm.isInputMethodWindowVisible }} +

+

+ InputMethod Surface: + &ngsp; + {{ additionalProperties.sf.inputMethodSurface.isInputMethodSurfaceVisible }} +

-
+
-
- ZOrderRelativeOfId: - {{ - additionalProperties.sf.imeContainer.zOrderRelativeOfId - }} -
- Z: - {{ additionalProperties.sf.imeContainer.z }} -
+
+

+ ZOrderRelativeOfId: + &ngsp; + {{ additionalProperties.sf.imeContainer.zOrderRelativeOfId }} +

+

+ Z: + &ngsp; + {{ additionalProperties.sf.imeContainer.z }} +

-
+
-
- ScreenBounds: - -
- Rect: - -
+
+

ScreenBounds:

+ +
+
+

Rect:

+
-
- + +
`, styles: [ ` .view-header { - width: 100%; - height: 2.5rem; border-bottom: 1px solid var(--default-border); } - .title-filter { - position: relative; - display: flex; - align-items: center; - width: 100%; - margin-bottom: 12px; - } - - .additional-properties-title { - font-weight: medium; - font-size: 16px; - } - .additional-properties-content { - display: flex; - flex-direction: column; - height: 375px; + height: 0; + flex-grow: 1; overflow-y: auto; - overflow-x: hidden; - } - - .container { - overflow: auto; } .group { - padding: 0.5rem; - border-bottom: thin solid rgba(0, 0, 0, 0.12); - flex-direction: row; + padding: 8px; display: flex; + flex-direction: row; + border-bottom: 1px solid var(--default-border); } - .group .key { - font-weight: bold; - } - - .group .value { - color: rgba(0, 0, 0, 0.75); - word-break: break-all !important; + .mat-body-1 { + overflow-wrap: anywhere; } .group-header { - justify-content: center; - text-align: left; - padding: 0px 5px; - width: 95px; - display: inline-block; - font-size: bigger; + height: 100%; + width: 80px; + padding: 0; + text-align: center; + line-height: normal; + white-space: normal; + } + + p.group-header { color: grey; - word-break: break-word; } .left-column { - width: 320px; - max-width: 100%; - display: inline-block; - vertical-align: top; - overflow: auto; - padding-right: 20px; + flex: 1; + padding: 0 5px; } .right-column { - width: 320px; - max-width: 100%; - display: inline-block; - vertical-align: top; - overflow: auto; + flex: 1; + padding: 0 5px; } - - .full-width { - width: 100%; - display: inline-block; - vertical-align: top; - overflow: auto; - } - - .column-header { - font-weight: medium; - font-size: smaller; - } - - .element-summary { - padding-top: 1rem; - } - - .element-summary .key { - font-weight: bold; - } - - .element-summary .value { - color: rgba(0, 0, 0, 0.75); - } - - .tree-view { - overflow: auto; - } - - .text-button { - border: none; - cursor: pointer; - font-size: 14px; - font-family: roboto; - color: blue; - text-decoration: underline; - text-decoration-color: blue; - background-color: inherit; - } - - .text-button:focus { - color: purple; - } - - .text-button.selected { - color: purple; - } - - ` ], }) diff --git a/tools/winscope-ng/src/viewers/components/properties.component.ts b/tools/winscope-ng/src/viewers/components/properties.component.ts index cd9af4b00..1d562c286 100644 --- a/tools/winscope-ng/src/viewers/components/properties.component.ts +++ b/tools/winscope-ng/src/viewers/components/properties.component.ts @@ -22,10 +22,10 @@ import { PropertiesTreeNode, Terminal} from "viewers/common/ui_tree_utils"; @Component({ selector: "properties-view", template: ` - +
- Properties - +

Properties

+ Filter... {{userOptions[option].name}}
-
- -
- - - Properties - Proto Dump + +
+
+

Properties - Proto Dump

- +
`, styles: [ ` .view-header { - display: block; - width: 100%; - min-height: 3.75rem; - align-items: center; - border-bottom: 1px solid lightgrey; + flex: 1; + display: flex; + flex-direction: column; + border-bottom: 1px solid var(--default-border); + padding-bottom: 12px; + overflow-y: auto; } .title-filter { - position: relative; display: flex; - align-items: center; - width: 100%; - margin-bottom: 12px; - } - - .properties-title { - font-size: 16px; - } - - .filter-field { - font-size: 16px; - transform: scale(0.7); - right: 0px; - position: absolute; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; } .view-controls { - display: inline-block; - font-size: 12px; - font-weight: normal; - margin-left: 5px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + margin-bottom: 16px; } - .properties-content{ + .properties-content { + flex: 1; display: flex; flex-direction: column; overflow-y: auto; - overflow-x:hidden } - .element-summary { - padding: 1rem; - border-bottom: thin solid rgba(0,0,0,.12); + .property-groups { + overflow-y: auto; } - .element-summary .key { - font-weight: 500; - } - - .element-summary .value { - color: rgba(0, 0, 0, 0.75); - } - - .tree-view { - white-space: pre-line; - flex: 1 0 0; - height: 100%; + .tree-wrapper { overflow-y: auto } `, @@ -144,13 +121,6 @@ export class PropertiesComponent { @Inject(ElementRef) private elementRef: ElementRef, ) {} - public maxPropertiesHeight() { - const headerHeight = this.elementRef.nativeElement.querySelector(".view-header").clientHeight; - return { - height: `${800 - headerHeight}px` - }; - } - public filterTree() { const event: CustomEvent = new CustomEvent( ViewerEvents.PropertiesFilterChange, diff --git a/tools/winscope-ng/src/viewers/components/properties_table.component.ts b/tools/winscope-ng/src/viewers/components/properties_table.component.ts index 7aa66ef87..faae432e6 100644 --- a/tools/winscope-ng/src/viewers/components/properties_table.component.ts +++ b/tools/winscope-ng/src/viewers/components/properties_table.component.ts @@ -19,49 +19,33 @@ import { TableProperties } from "viewers/common/table_properties"; @Component({ selector: "properties-table", template: ` -
- {{ entry[0] }} +

{{ entry[0] }}

- {{ entry[1] != undefined ? entry[1] : 'undefined' }} +

{{ entry[1] != undefined ? entry[1] : 'undefined' }}

-
`, styles: [ ` - .properties-table-wrapper { - border-bottom: 1px solid var(--default-border); - } - - .properties-table-wrapper .table-cell-name { - background-color: rgba(158, 192, 200, 0.281); - border: 1px solid var(--default-border); - height: 20px; - padding: 0; - width: 20%; - } - - .properties-table-wrapper .table-cell-value { - overflow-wrap: anywhere; - border: 1px solid var(--default-border); - height: 20px; - padding: 0; - width: 80%; - } - - .properties-table-wrapper table { - height: auto; - border-collapse: collapse; + .table { width: 100%; + border-collapse: collapse; } - .properties-table-wrapper span { - padding: 5px; + .table-cell-name, .table-cell-value { + padding: 1px 5px; + border: 1px solid var(--default-border); + overflow-wrap: anywhere; + } + + .table-cell-name { + width: 20%; + background-color: rgba(158, 192, 200, 0.281); } ` ], diff --git a/tools/winscope-ng/src/viewers/components/property_groups.component.ts b/tools/winscope-ng/src/viewers/components/property_groups.component.ts index bf462a410..337c329ba 100644 --- a/tools/winscope-ng/src/viewers/components/property_groups.component.ts +++ b/tools/winscope-ng/src/viewers/components/property_groups.component.ts @@ -19,263 +19,258 @@ import { Layer } from "common/trace/flickerlib/common"; @Component({ selector: "property-groups", template: ` -
- - Visibility - -
- Flags: - {{ item.flags }} -
-
-
- {{ reason.key }}: - {{ reason.value }} -
-
-
+

Visibility

+
+

+ Flags: + &ngsp; + {{ item.flags }} +

+

+ {{ reason.key }}: + &ngsp; + {{ reason.value }} +

-
- Geometry -
-
Calculated
- Transform: - -
+
+
+

Geometry

+
+

Calculated

+

Transform:

+ +

Crop: - {{ item.bounds }} -

+ &ngsp; + {{ item.bounds }} +

Final Bounds: - {{ item.screenBounds }} -

-
-
Requested
- Transform: - -
- Crop: - {{ item.crop ? item.crop : "[empty]" }} -
+ &ngsp; + {{ item.screenBounds }} +

-
- - Buffer - -
-
- Size: - {{ item.activeBuffer }} -
- Frame Number: - {{ item.currFrame }} -
+
+

Requested

+

Transform:

+ +

+ Crop: + &ngsp; + {{ item.crop + ? item.crop + : "[empty]" + }} +

+
+
+
+

Buffer

+
+

+ Size: + &ngsp; + {{ item.activeBuffer }} +

+

+ Frame Number: + &ngsp; + {{ item.currFrame }} +

+

Transform: - {{ item.bufferTransform }} -

-
-
+ &ngsp; + {{ item.bufferTransform }} +

+
+
+

Destination Frame: - {{ getDestinationFrame() }} -

- Destination Frame ignored because item has eIgnoreDestinationFrame - flag set. - -
-
- - Container item -
-
- - Effect item -
+ &ngsp; + {{ getDestinationFrame() }} +

+

+ Destination Frame ignored because item has eIgnoreDestinationFrame + flag set. +

-
- - Hierarchy - -
-
- z-order: - {{ item.z }} -
+
+
+

Hierarchy

+
+

+ z-order: + &ngsp; + {{ item.z }} +

+

relative parent: - - {{ item.zOrderRelativeOfId == -1 ? "none" : item.zOrderRelativeOfId }} - -

+ &ngsp; + {{ + item.zOrderRelativeOfId == -1 + ? "none" + : item.zOrderRelativeOfId + }} +

-
- - Effects - -
-
Calculated
- Color: - {{ item.color }} -
- Shadow: - {{ item.shadowRadius }} px -
- Corner Radius: - {{ formatFloat(item.cornerRadius) }} px -
+
+
+

Effects

+
+

Calculated

+

+ Color: + &ngsp; + {{ item.color }} +

+

+ Shadow: + &ngsp; + {{ item.shadowRadius }} px +

+

+ Corner Radius: + &ngsp; + {{ formatFloat(item.cornerRadius) }} px +

+

Corner Radius Crop: - {{ item.cornerRadiusCrop }} -

- Blur: - - {{ - item.proto?.backgroundBlurRadius - ? item.proto?.backgroundBlurRadius - : 0 - }} px - -
-
-
Requested
- Color: - {{ item.requestedColor }} -
- Shadow: - - {{ - item.proto?.requestedShadowRadius - ? item.proto?.requestedShadowRadius - : 0 - }} px - -
- Corner Radius: - - {{ - item.proto?.requestedCornerRadius - ? formatFloat(item.proto?.requestedCornerRadius) - : 0 - }} px - -
+ &ngsp; + {{ item.cornerRadiusCrop }} +

+

+ Blur: + &ngsp; + {{ + item.proto?.backgroundBlurRadius + ? item.proto?.backgroundBlurRadius + : 0 + }} px +

-
- - Input - -
- To Display Transform: - -
- Touchable Region: - {{ item.inputRegion }} -
-
- Config: - -
- Focusable: - {{ item.proto?.inputWindowInfo.focusable }} -
- Crop touch region with item: - - {{ - item.proto?.inputWindowInfo.cropLayerId <= 0 - ? "none" - : item.proto?.inputWindowInfo.cropLayerId - }} - -
- Replace touch region with crop: - - {{ - item.proto?.inputWindowInfo.replaceTouchableRegionWithCrop - }} - -
-
- - No input channel set -
+
+

Requested

+

+ Color: + &ngsp; + {{ item.requestedColor }} +

+

+ Shadow: + &ngsp; + {{ + item.proto?.requestedShadowRadius + ? item.proto?.requestedShadowRadius + : 0 + }} px +

+

+ Corner Radius: + &ngsp; + {{ + item.proto?.requestedCornerRadius + ? formatFloat(item.proto?.requestedCornerRadius) + : 0 + }} px +

+
+
+
+

Input

+
+

To Display Transform:

+ +

+ Touchable Region: + &ngsp; + {{ item.inputRegion }} +

+
+
+

Config

+

+ Focusable: + &ngsp; + {{ item.proto?.inputWindowInfo.focusable }} +

+

+ Crop touch region with item: + &ngsp; + {{ + item.proto?.inputWindowInfo.cropLayerId <= 0 + ? "none" + : item.proto?.inputWindowInfo.cropLayerId + }} +

+

+ Replace touch region with crop: + &ngsp; + {{ item.proto?.inputWindowInfo.replaceTouchableRegionWithCrop }} +

+
+
+

+ Input channel: + &ngsp; + not set +

`, styles: [ ` .group { - padding: 0.5rem; - border-bottom: thin solid rgba(0, 0, 0, 0.12); - flex-direction: row; display: flex; - } - - .group .key { - font-weight: 500; - padding-right: 5px; - } - - .group .value { - color: rgba(0, 0, 0, 0.75); + flex-direction: row; + padding: 8px; + border-bottom: 1px solid var(--default-border); } .group-header { - justify-content: center; - padding: 0px 5px; width: 80px; - display: inline-block; - font-size: bigger; color: grey; } .left-column { - width: 320px; - max-width: 100%; - display: inline-block; - vertical-align: top; - overflow: auto; - border-right: 5px solid rgba(#000, 0.12); - padding-right: 20px; + flex: 1; + padding: 0 5px; } .right-column { - width: 320px; - max-width: 100%; - display: inline-block; - vertical-align: top; - overflow: auto; - border: 1px solid rgba(#000, 0.12); + flex: 1; + border: 1px solid var(--default-border); + border-left-width: 5px; + padding: 0 5px; } .column-header { - font-weight: lighter; - font-size: smaller; + color: grey; } ` ], diff --git a/tools/winscope-ng/src/viewers/components/rects/canvas_graphics.ts b/tools/winscope-ng/src/viewers/components/rects/canvas_graphics.ts index e777da493..6675362c5 100644 --- a/tools/winscope-ng/src/viewers/components/rects/canvas_graphics.ts +++ b/tools/winscope-ng/src/viewers/components/rects/canvas_graphics.ts @@ -48,7 +48,7 @@ export class CanvasGraphics { //set canvas size this.canvas.style.width = "100%"; - this.canvas.style.height = "40rem"; + this.canvas.style.height = "100%"; this.orbit?.reset(); @@ -71,7 +71,7 @@ export class CanvasGraphics { this.labelRenderer.domElement.style.position = "absolute"; this.labelRenderer.domElement.style.top = "0px"; this.labelRenderer.domElement.style.width = "100%"; - this.labelRenderer.domElement.style.height = "40rem"; + this.labelRenderer.domElement.style.height = "100%"; this.labelRenderer.domElement.className = "labels-canvas"; this.labelRenderer.domElement.style.pointerEvents = "none"; this.canvasContainer?.appendChild(this.labelRenderer.domElement); @@ -87,8 +87,8 @@ export class CanvasGraphics { let xShift = 0, yShift = 3.5, labelYShift = 0; if (this.isLandscape) { - xShift = 1; - yShift = 1.5; + xShift = -1; + yShift = 2.5; labelYShift = 1.25; } @@ -477,7 +477,7 @@ export class CanvasGraphics { private readonly MAX_LABEL_SHIFT = 0.305; private readonly MAX_ZOOM = 2.5; private readonly MIN_ZOOM = 0.5; - private readonly INIT_ZOOM = 1; + private readonly INIT_ZOOM = 0.75; private readonly INIT_FONT_SIZE = 10; private readonly INIT_CAMERA_POS = new THREE.Vector3(4, 4, 6); private readonly INIT_TARGET = new THREE.Vector3(0, 0, 0); diff --git a/tools/winscope-ng/src/viewers/components/rects/rects.component.ts b/tools/winscope-ng/src/viewers/components/rects/rects.component.ts index 0dcb760d8..2c155b453 100644 --- a/tools/winscope-ng/src/viewers/components/rects/rects.component.ts +++ b/tools/winscope-ng/src/viewers/components/rects/rects.component.ts @@ -23,49 +23,46 @@ import { ViewerEvents } from "viewers/common/viewer_events"; @Component({ selector: "rects-view", template: ` - -
- Layers -
+
+

Layers

-
- Only visible - Show virtual -
- - - -
+ Only visible + Show virtual +
+ + +
- Rotation +

Rotation

- Spacing +

Spacing

- - +
+
-
- +
+
- +
`, styles: [ ` - @import 'https://fonts.googleapis.com/icon?family=Material+Icons'; - - :host /deep/ .mat-card-header-text { - width: 100%; - margin: 0; + .view-controls { + display: flex; + flex-direction: column; + border-bottom: 1px solid var(--default-border); } - .rects-title { - font-size: 16px; - font-weight: medium; - font-family: inherit; - width: 100%; + .top-view-controls, .slider-view-controls { + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; margin-bottom: 12px; } - .rects-content { - position: relative; + .right-btn-container { + margin-left: auto; } - .canvas-container { - height: 40rem; - width: 100%; - position: relative; - } - .labels-canvas, .rects-canvas { - height: 40rem; - width: 100%; - position: absolute; - top: 0px; - } - .rects-canvas { - cursor: pointer; - } - .view-controls { - display: inline-block; - position: relative; - min-height: 4rem; - width: 100%; - } - .slider-view-controls, .top-view-controls { - display: inline-block; - position: relative; - height: 3rem; - width: 100%; - } - .top-view-controls { - vertical-align: middle; + .slider-view-controls { + justify-content: space-between; } .slider { - display: inline-block; + position: relative; } .slider-label { position: absolute; top: 0; } - .slider.spacing { - float: right; + .rects-content { + height: 0; + flex-grow: 1; } - .slider span, .slider mat-slider { - display: block; - padding-left: 0px; - padding-top: 0px; - font-weight: bold; - } - .right-btn-container { + .canvas-container { + height: 100%; + width: 100%; position: relative; - vertical-align: middle; - float: right; } - .right-btn { - position: relative; - display: inline-flex; - background: none; - border: none; - padding: 0; + .labels-canvas, .rects-canvas { + position: absolute; + top: 0; } - .rects-checkbox { - font-size: 14px; - font-weight: normal; - margin-left: 5px; - } - mat-icon { - margin: 5px - } - .mat-checkbox .mat-checkbox-frame, .mat-checkbox-checked .mat-checkbox-background, .mat-checkbox-indeterminate .mat-checkbox-background { - transform: scale(0.7); - } - .control-item { - position: relative; - display: inline-block; - vertical-align: middle; - align-items: center; + .rects-canvas { + cursor: pointer; } ` ] diff --git a/tools/winscope-ng/src/viewers/components/styles/node.styles.ts b/tools/winscope-ng/src/viewers/components/styles/node.styles.ts index 0f03eaf20..01b859cbd 100644 --- a/tools/winscope-ng/src/viewers/components/styles/node.styles.ts +++ b/tools/winscope-ng/src/viewers/components/styles/node.styles.ts @@ -14,7 +14,7 @@ * limitations under the License. */ export const nodeStyles = ` - .node {position: relative;display: inline-block;padding: 2px; height: 100%; width: 100%;} + .node {position: relative;display: inline-block;padding: 2px 0; width: 100%;} .node.clickable {cursor: pointer;} .node:not(.selected).added, .node:not(.selected).addedMove { @@ -59,12 +59,18 @@ export const nodeInnerItemStyles = ` .pin-node-btn {padding: 0; transform: scale(0.7)} .description {align-items: center; flex: 1 1 auto; vertical-align: middle; word-break: break-all;} .leaf-node-icon-wrapper{padding-left: 6px; padding-right: 6px; min-height: 24px; width: 24px; position:relative; align-content: center; vertical-align: middle;} - .icon-button { background: none;border: none;display: inline-block;vertical-align: middle;} + + .icon-button { + background: none; + border: none; + display: inline-block; + vertical-align: middle; + } .expand-tree-btn { float: right; - padding-left: 0px; - padding-right: 0px; + padding-left: 0; + padding-right: 0; } .expand-tree-btn.modified { diff --git a/tools/winscope-ng/src/viewers/components/styles/tree_node_data_view.styles.ts b/tools/winscope-ng/src/viewers/components/styles/tree_node_data_view.styles.ts index cea15e028..20a9a3a7c 100644 --- a/tools/winscope-ng/src/viewers/components/styles/tree_node_data_view.styles.ts +++ b/tools/winscope-ng/src/viewers/components/styles/tree_node_data_view.styles.ts @@ -14,15 +14,12 @@ * limitations under the License. */ export const treeNodeDataViewStyles = ` - .kind {font-weight: bold} - - span {overflow-wrap: break-word; flex: 1 1 auto; width: 0; word-break: break-all} - .tree-view-internal-chip { display: inline-block; } .tree-view-chip { + margin: 0 5px; padding: 0 10px; border-radius: 10px; background-color: #aaa; @@ -31,22 +28,18 @@ export const treeNodeDataViewStyles = ` .tree-view-chip.tree-view-chip-warn { background-color: #ffaa6b; - color: black; } .tree-view-chip.tree-view-chip-error { background-color: #ff6b6b; - color: black; } .tree-view-chip.tree-view-chip-gpu { background-color: #00c853; - color: black; } .tree-view-chip.tree-view-chip-hwc { background-color: #448aff; - color: black; } `; diff --git a/tools/winscope-ng/src/viewers/components/transform_matrix.component.ts b/tools/winscope-ng/src/viewers/components/transform_matrix.component.ts index 015fc27ee..7173101f9 100644 --- a/tools/winscope-ng/src/viewers/components/transform_matrix.component.ts +++ b/tools/winscope-ng/src/viewers/components/transform_matrix.component.ts @@ -19,22 +19,36 @@ import { Transform } from "common/trace/flickerlib/common"; @Component({ selector: "transform-matrix", template: ` -
-
{{ formatFloat(transform.matrix.dsdx) }}
-
{{ formatFloat(transform.matrix.dsdy) }}
-
+
+

+ {{ formatFloat(transform.matrix.dsdx) }} +

+

+ {{ formatFloat(transform.matrix.dsdy) }} +

+

{{ formatFloat(transform.matrix.tx) }} -

+

-
{{ formatFloat(transform.matrix.dtdx) }}
-
{{ formatFloat(transform.matrix.dtdy) }}
-
+

+ {{ formatFloat(transform.matrix.dtdx) }} +

+

+ {{ formatFloat(transform.matrix.dtdy) }} +

+

{{ formatFloat(transform.matrix.ty) }} -

+

-
0
-
0
-
1
+

+ 0 +

+

+ 0 +

+

+ 1 +

`, styles: [ @@ -43,10 +57,10 @@ import { Transform } from "common/trace/flickerlib/common"; display: grid; grid-gap: 1px; grid-template-columns: repeat(3, 1fr); + text-align: center; } .cell { - padding-left: 10px; background-color: #F8F9FA; } ` diff --git a/tools/winscope-ng/src/viewers/components/tree.component.ts b/tools/winscope-ng/src/viewers/components/tree.component.ts index 9459a6ae0..d25428087 100644 --- a/tools/winscope-ng/src/viewers/components/tree.component.ts +++ b/tools/winscope-ng/src/viewers/components/tree.component.ts @@ -22,56 +22,53 @@ import { TraceType } from "common/trace/trace_type"; @Component({ selector: "tree-view", template: ` -
- + -
- - - -
-
+
+ +
`, styles: [nodeStyles, treeNodeDataViewStyles] }) diff --git a/tools/winscope-ng/src/viewers/components/tree_node.component.ts b/tools/winscope-ng/src/viewers/components/tree_node.component.ts index 0e6e3bcd8..2501c6cd3 100644 --- a/tools/winscope-ng/src/viewers/components/tree_node.component.ts +++ b/tools/winscope-ng/src/viewers/components/tree_node.component.ts @@ -21,53 +21,50 @@ import { UiTreeUtils, UiTreeNode, DiffType, HierarchyTreeNode } from "viewers/co selector: "tree-node", template: ` -
+
diff --git a/tools/winscope-ng/src/viewers/components/tree_node_data_view.component.ts b/tools/winscope-ng/src/viewers/components/tree_node_data_view.component.ts index 3d7e86117..57d73798f 100644 --- a/tools/winscope-ng/src/viewers/components/tree_node_data_view.component.ts +++ b/tools/winscope-ng/src/viewers/components/tree_node_data_view.component.ts @@ -21,11 +21,11 @@ import Chip from "viewers/common/chip"; @Component({ selector: "tree-node-data-view", template: ` - - {{item.kind}} - - + + {{item.kind}} + &ngsp;-&ngsp; {{ itemShortName() }} - {{item.name}} + {{item.name}}
+

{{ item.propertyKey }} - : - {{ item.propertyValue }} - + + :&ngsp; + {{ item.propertyValue }} + +

`, styles: [ treeNodePropertiesDataViewStyles ] }) @@ -52,6 +54,7 @@ export class TreeNodePropertiesDataViewComponent { if (!isNaN(Number(this.item.propertyValue))) { return "number"; } + return null; } } diff --git a/tools/winscope-ng/src/viewers/components/viewer_input_method.component.ts b/tools/winscope-ng/src/viewers/components/viewer_input_method.component.ts index 3c75648cd..c6fb63707 100644 --- a/tools/winscope-ng/src/viewers/components/viewer_input_method.component.ts +++ b/tools/winscope-ng/src/viewers/components/viewer_input_method.component.ts @@ -25,98 +25,54 @@ import { ImeUiData } from "viewers/common/ime_ui_data"; @Component({ selector: "viewer-input-method", template: ` -
+
- - - - - - + +
- - - +
`, styles: [ ` - @import 'https://fonts.googleapis.com/icon?family=Material+Icons'; - :root { - --default-border: #DADCE0; - } - - mat-icon { - margin: 5px - } - - .icon-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; - } - - .header-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; - } - - .card-grid { - width: 100%; - height: 100%; - display: flex; - flex-direction: row; - overflow: auto; - } - .left-views { - font: inherit; - margin: 0px; - width: 50%; - height: 100%; + flex: 1; display: flex; flex-direction: column; - overflow: auto; } .hierarchy-view, .ime-additional-properties-view { - font: inherit; - margin: 0px; - border-radius: 0; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); border-right: 1px solid var(--default-border); - box-shadow: none !important; - } - - .ime-additional-properties-view { - height: 404px; } .properties-view { - font: inherit; - margin: 0px; - width: 50%; - height: 52.5rem; - border-radius: 0; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); - border-left: 1px solid var(--default-border); - box-shadow: none !important; } `, ] @@ -127,10 +83,4 @@ export class ViewerInputMethodComponent { @Input() active = false; TRACE_INFO = TRACE_INFO; TraceType = TraceType; - - public hierarchyHeight() { - return { - height: `${this.inputData?.additionalProperties ? 404 : 840}px` - }; - } } diff --git a/tools/winscope-ng/src/viewers/viewer_surface_flinger/viewer_surface_flinger.component.ts b/tools/winscope-ng/src/viewers/viewer_surface_flinger/viewer_surface_flinger.component.ts index 0ade7d4e7..d1e1d2c1b 100644 --- a/tools/winscope-ng/src/viewers/viewer_surface_flinger/viewer_surface_flinger.component.ts +++ b/tools/winscope-ng/src/viewers/viewer_surface_flinger/viewer_surface_flinger.component.ts @@ -25,102 +25,63 @@ import { PersistentStore } from "common/persistent_store"; @Component({ selector: "viewer-surface-flinger", template: ` -
- - - -
- - - - - - -
-
+
+ + + +
`, styles: [ ` - @import 'https://fonts.googleapis.com/icon?family=Material+Icons'; - :root { - --default-border: #DADCE0; - } - - mat-icon { - margin: 5px - } - - .icon-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; - } - - .header-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; - } - - .card-grid { - width: 100%; - height: 100%; - display: flex; - flex-direction: row; - overflow: auto; - } - .rects-view { - font: inherit; - flex: none; - width: 350px; - height: 52.5rem; - margin: 0px; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); border-right: 1px solid var(--default-border); - border-radius: 0; } .hierarchy-view { - font: inherit; - margin: 0px; - width: 50%; - height: 52.5rem; - border-radius: 0; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); border-right: 1px solid var(--default-border); - border-left: 1px solid var(--default-border); } .properties-view { - font: inherit; - margin: 0px; - width: 50%; - height: 52.5rem; - border-radius: 0; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); - border-left: 1px solid var(--default-border); } `, ] diff --git a/tools/winscope-ng/src/viewers/viewer_window_manager/viewer_window_manager.component.ts b/tools/winscope-ng/src/viewers/viewer_window_manager/viewer_window_manager.component.ts index 3e915dcb8..e2f27627e 100644 --- a/tools/winscope-ng/src/viewers/viewer_window_manager/viewer_window_manager.component.ts +++ b/tools/winscope-ng/src/viewers/viewer_window_manager/viewer_window_manager.component.ts @@ -25,99 +25,60 @@ import { PersistentStore } from "common/persistent_store"; @Component({ selector: "viewer-window-manager", template: ` -
- - - -
- - - - - - -
+
+ + +
`, styles: [ ` - @import 'https://fonts.googleapis.com/icon?family=Material+Icons'; - :root { - --default-border: #DADCE0; - } - - mat-icon { - margin: 5px - } - - .icon-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; - } - - .header-button { - background: none; - border: none; - display: inline-block; - vertical-align: middle; - } - - .card-grid { - width: 100%; - height: 100%; - display: flex; - flex-direction: row; - overflow: auto; - } - .rects-view { - font: inherit; - flex: none; - width: 350px; - height: 52.5rem; - margin: 0px; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); border-right: 1px solid var(--default-border); - border-radius: 0; } .hierarchy-view { - font: inherit; - margin: 0px; - width: 50%; - height: 52.5rem; - border-radius: 0; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); border-right: 1px solid var(--default-border); - border-left: 1px solid var(--default-border); } .properties-view { - font: inherit; - margin: 0px; - width: 50%; - height: 52.5rem; - border-radius: 0; + flex: 1; + padding: 16px; + display: flex; + flex-direction: column; border-top: 1px solid var(--default-border); - border-left: 1px solid var(--default-border); } `, ] diff --git a/tools/winscope-ng/webpack.config.common.js b/tools/winscope-ng/webpack.config.common.js index 6e4d99251..e731f2b17 100644 --- a/tools/winscope-ng/webpack.config.common.js +++ b/tools/winscope-ng/webpack.config.common.js @@ -46,6 +46,10 @@ module.exports = { test: /\.css$/, use: ["style-loader", "css-loader"] }, + { + test: /\.s[ac]ss$/i, + use: ["style-loader", "css-loader", "sass-loader"] + }, { test: /\.proto$/, loader: 'proto-loader', diff --git a/tools/winscope-ng/webpack.config.dev.js b/tools/winscope-ng/webpack.config.dev.js index 3d2a37c26..7d3b22326 100644 --- a/tools/winscope-ng/webpack.config.dev.js +++ b/tools/winscope-ng/webpack.config.dev.js @@ -20,7 +20,10 @@ const configDev = { mode: 'development', entry: { polyfills: "./src/polyfills.ts", - styles: "./src/styles.css", + styles: [ + "./src/material-theme.scss", + "./src/styles.css" + ], app: "./src/main.dev.ts" }, devtool: "source-map", diff --git a/tools/winscope-ng/webpack.config.prod.js b/tools/winscope-ng/webpack.config.prod.js index bfdddf815..2328fd0a8 100644 --- a/tools/winscope-ng/webpack.config.prod.js +++ b/tools/winscope-ng/webpack.config.prod.js @@ -23,7 +23,10 @@ const configProd = { mode: 'production', entry: { polyfills: "./src/polyfills.ts", - styles: "./src/styles.css", + styles: [ + "./src/material-theme.scss", + "./src/styles.css" + ], app: "./src/main.prod.ts" }, output: {