Skip to content

Commit

Permalink
fixes to the tooltip z-index and dialog scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
nodeful committed Nov 13, 2021
1 parent 36ed8eb commit be5a385
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import { FadeInOutAnimation } from '../../animations/fade-in-out'
</eqm-tooltip>
</div>
`,
animations: [ FadeInOutAnimation ]
animations: [ FadeInOutAnimation ],
styles: [
`:host {
z-index: 10000;
}`
]
})
export class TooltipContainerComponent {
@Input() scale = 1
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@

<eqm-outputs *ngIf="ui.settings.outputFeatureEnabled" #outputs></eqm-outputs>

<eqm-tooltip-container [scale]="ui.scale"></eqm-tooltip-container>
</div>
<eqm-tooltip-container class="tooltip-container" [scale]="ui.scale" [ngStyle]="containerStyle"></eqm-tooltip-container>
9 changes: 9 additions & 0 deletions ui/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,12 @@ $noise: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyA

}

.tooltip-container {
position: absolute;
pointer-events: none;
transform-origin: top left;
z-index: 9999;
min-width: 400px;
top: 0;
left: 0;
}
6 changes: 5 additions & 1 deletion ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export class AppComponent implements OnInit, AfterContentInit {
style.height = `${this.containerHeight / this.ui.scale}px`
style.transform = `scale(${this.ui.scale})`

const cdkOverlays = document.getElementsByClassName('cdk-overlay-pane')
for (let i = 0; i < cdkOverlays.length; i++) {
cdkOverlays[i].setAttribute('style', `transform: scale(${this.ui.scale.toFixed(2)}); max-width: ${Math.round(90 / this.ui.scale)}vw`)
}
return style
}

Expand Down Expand Up @@ -133,7 +137,7 @@ export class AppComponent implements OnInit, AfterContentInit {
this.ui.getSettings()
])

if (typeof uiSettings.privacyFormSeen !== 'boolean') {
if (typeof uiSettings.privacyFormSeen !== 'boolean' || true) {
let doCollectTelemetry = uiSettings.doCollectTelemetry ?? false
let doCollectCrashReports = await this.settings.getDoCollectCrashReports()
let saving = false
Expand Down
15 changes: 13 additions & 2 deletions ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { SettingsComponent } from './sections/settings/settings.component'
import { OptionsComponent } from './components/options/options.component'
import { HelpComponent } from './sections/help/help.component'
import { MatDialogModule } from '@angular/material/dialog'
import { MatDialogConfig, MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog'
import { ConfirmDialogComponent } from './components/confirm-dialog/confirm-dialog.component'
import { EqualizerPresetsComponent } from './sections/effects/equalizers/presets/equalizer-presets.component'
import { PromptDialogComponent } from './components/prompt-dialog/prompt-dialog.component'
import { OptionsDialogComponent } from './components/options-dialog/options-dialog.component'
import { MatSnackBarModule } from '@angular/material/snack-bar'
import { UIService } from './services/ui.service'

@NgModule({
imports: [
Expand Down Expand Up @@ -114,7 +115,17 @@ import { MatSnackBarModule } from '@angular/material/snack-bar'
PromptDialogComponent,
OptionsDialogComponent
],
providers: [],
providers: [
{
provide: MAT_DIALOG_DEFAULT_OPTIONS,
useValue: {
...new MatDialogConfig(),
hasBackdrop: true,
maxWidth: 10,
width: '10px'
} as MatDialogConfig
}
],
bootstrap: [ AppComponent ]
})
export class AppModule {}

0 comments on commit be5a385

Please sign in to comment.