lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
66 lines (65 loc) • 2.67 kB
TypeScript
import { Widget, WidgetProperties } from './Widget.js';
import { SingleParent } from './SingleParent.js';
import type { Rect } from '../helpers/Rect.js';
import type { WidgetAutoXML } from '../xml/WidgetAutoXML.js';
import { TooltipAxisBias } from '../core/TooltipAxisBias.js';
import { type WidgetEvent } from '../events/WidgetEvent.js';
export interface TooltipContainerProperties extends WidgetProperties {
/** Sets {@link TooltipContainer#horizontalBias}. */
horizontalBias?: TooltipAxisBias;
/** Sets {@link TooltipContainer#verticalBias}. */
verticalBias?: TooltipAxisBias;
}
/**
* A container widget for a widget that will be shown when a {@link Tooltip} is
* hovered.
*
* @category Widget
*/
export declare class TooltipContainer<W extends Widget = Widget> extends SingleParent<W> {
static autoXML: WidgetAutoXML;
/**
* The horizontal component of the position to place this tooltip around.
* Automatically set by {@link Tooltip} widget. Used for positioning.
*/
anchorX: number;
/**
* The vertical component of the position to place this tooltip around.
* Automatically set by {@link Tooltip} widget. Used for positioning.
*/
anchorY: number;
/**
* @deprecated Use {@link TooltipContainer#anchorX} instead.
*/
cursorX: number;
/**
* @deprecated Use {@link TooltipContainer#anchorX} instead.
*/
cursorY: number;
/**
* Horizontal bias to apply to tooltip container. After anchor position by
* default (tooltip will tend to the right of the anchor).
*/
horizontalBias: TooltipAxisBias;
/**
* Vertical bias to apply to tooltip container. Automatically decided from
* anchor position by default (tooltip will tend to be above the wrapper if
* the anchor is on the top half of the wrapper, or below otherwise).
*/
verticalBias: TooltipAxisBias;
/**
* A rectangle representing the dimensions and position of the
* {@link Tooltip} that binds this box. Used for positioning.
*/
tooltipRect: Rect;
private idealTooltipWidth;
private idealTooltipHeight;
constructor(child: W, properties?: Readonly<TooltipContainerProperties>);
protected onThemeUpdated(property?: string | null): void;
protected handleEvent(event: WidgetEvent): Widget | null;
protected handlePreLayoutUpdate(): void;
protected handlePostLayoutUpdate(): void;
protected handleResolveDimensions(_minWidth: number, maxWidth: number, _minHeight: number, maxHeight: number): void;
resolvePosition(x: number, y: number): void;
protected handlePainting(dirtyRects: Array<Rect>): void;
}