Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 2.19 KB

File metadata and controls

53 lines (40 loc) · 2.19 KB

WindowControlsOverlayGeometryChangeEvent

Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: Event
Source: JSObjects/WindowControlsOverlayGeometryChangeEvent.cs
MDN Reference: WindowControlsOverlayGeometryChangeEvent on MDN

The WindowControlsOverlayGeometryChangeEvent interface of the Window Controls Overlay API is passed to geometrychange when the size or visibility of a desktop Progress Web App's title bar region changes. https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlayGeometryChangeEvent

Constructors

Signature Description
WindowControlsOverlayGeometryChangeEvent(SpawnJSObjectReference _ref) Deserialization constructor

Properties

Property Type Access Description
Visible bool get A Boolean that indicates whether the window controls overlay is visible or not.

Methods

Method Return Type Description
TitlebarAreaRect() DOMRectReadOnly A DOMRect representing the position and size of the title bar region.

Examples

SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:

  • Properties and methods use PascalCase (e.g., readyState becomes ReadyState)
  • Events use ActionEvent with +=/-= (e.g., addEventListener("click", fn) becomes OnClick += handler)
  • Async methods return Task<T> instead of Promise<T>
  • Objects should be disposed with using statements
  • Access via JS.Get<WindowControlsOverlayGeometryChangeEvent>(...) or constructor new WindowControlsOverlayGeometryChangeEvent(...)
if ("windowControlsOverlay" in navigator) {
  navigator.windowControlsOverlay.addEventListener(
    "geometrychange",
    (event) => {
      if (event.visible) {
        const rect = event.titlebarAreaRect;
        // Do something with the coordinates of the title bar area.
      }
    },
  );
}

See full example on MDN