ControlManager
Properties
The color scheme that media queries like (prefers-color-scheme: dark) see, dark or light; the window size is what (min-width: 600px) sees
true while something is dragged in drag and drop
The distance in pixels the mouse has to move while a button is held before it counts as a drag. Smaller movements are ignored, so that a press that moves slightly still results in a click.
Draws only the areas of the elements that changed, when the layout did not change; false draws all elements in every redraw.
true while a color is picked from the window, see pickColor
true when the styles of elements have to be computed again, see Element.invalidateStyle
Functions
Opens the command palette: a dialog with a field that searches the commands by their names, see Commands.search; up and down choose a command, enter runs it, escape closes the palette. Opened by mod+k.
Asks to confirm message like the confirm that takes a callback, and suspends until the dialog closes: true when it is confirmed, false when it is cancelled. Cancelling the coroutine closes the dialog. For use in a coroutine on the thread of the program, like one that launch starts.
Asks to confirm message in a modal dialog, under title when it is set, with the buttons cancelLabel and confirmLabel. onResult is called once, when the dialog closes: with true when it is confirmed, false when it is cancelled, by its button, escape, a click on the backdrop or Dialog.close. Enter presses the button with the keyboard focus, which starts on the confirming button, or on the cancelling one when the action is destructive.
Shows a modal dialog that init builds, over a backdrop that covers the window: the keyboard focus moves into the dialog and stays in it, escape closes it, and a click on the backdrop closes it when dismissable is set. The backdrop is a dialog-backdrop, the dialog a dialog with classes.
Shows a popover that init builds, next to the area of the window that anchor gives in every frame, on side of it, or on the other side when it does not fit there, and moved along the side to stay inside the window; while anchor gives null it is hidden. It is not modal: the rest of the panel keeps working. When it is dismissable a press outside it and outside the anchor, or escape, closes it. Opening a popover of a group closes the other one of that group. With focus, the keyboard focus moves to its first control; the focus leaves it when it closes.