mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-20 19:39:54 +00:00

New standard theme that follows your chosen terminal colors, Bootstrap 5 & Angular 15 upgrade
20 lines
752 B
TypeScript
20 lines
752 B
TypeScript
import { HostBinding, ElementRef, Component } from '@angular/core'
|
|
import { BaseComponent } from './base.component'
|
|
|
|
@Component({})
|
|
export abstract class SelfPositioningComponent extends BaseComponent {
|
|
@HostBinding('style.left') cssLeft = ''
|
|
@HostBinding('style.top') cssTop = ''
|
|
@HostBinding('style.width') cssWidth: string | null = null
|
|
@HostBinding('style.height') cssHeight: string | null = null
|
|
|
|
constructor (protected element: ElementRef) { super() }
|
|
|
|
protected setDimensions (x: number, y: number, w: number, h: number, unit = '%'): void {
|
|
this.cssLeft = `${x}${unit}`
|
|
this.cssTop = `${y}${unit}`
|
|
this.cssWidth = w ? `${w}${unit}` : null
|
|
this.cssHeight = h ? `${h}${unit}` : null
|
|
}
|
|
}
|