|
Ultralight C++ API 2.0.0
|
#include <AppCore/layout/Options.h>
Configuration options for a floating panel.
Pass ForegroundPanelOptions to Foreground::AddPanel() or Foreground::AdoptPanel() to configure an overlay that floats above a window's tiled layout. A floating panel displays content such as a dialog or dropdown menu without shifting the layout beneath it.
Passing empty options creates a panel that fills the entire window.
This creates a centered dialog that closes like a native menu and takes keyboard focus:
Set width and height using logical pixels (eg, "400px") or a percentage of the window (eg, "50%").
The placement option sets where the panel sits in the window (see Anchor), defaulting to the window origin.
By default, a floating panel uses Dismiss::Manual and stays open until you hide it. Set dismiss = Dismiss::Auto to close the panel automatically like a native menu (see Dismiss). Call Panel::OnDismiss() to respond when the library dismisses the panel automatically.
By default, a floating panel uses FocusPolicy::Auto and takes keyboard focus only when clicked. Set focus = FocusPolicy::Grab for dialogs and dropdown menus that need focus immediately upon appearing (see FocusPolicy).
Set hidden = true to create the panel hidden, then call Panel::Show() once its page has loaded.
Public Attributes | |
| String | key |
| Optional identity for lookup and diagnostics. | |
| Size | width |
| The panel's width, in logical px or as a percent of the window's width. | |
| Size | height |
| The panel's height, in logical px or as a percent of the window's height. | |
| Anchor | placement |
| Where the panel sits in the window (see Anchor). | |
| Dismiss | dismiss = Dismiss::Manual |
| The auto-dismiss policy. | |
| FocusPolicy | focus = FocusPolicy::Auto |
| The keyboard-focus policy (see FocusPolicy). | |
| bool | hidden = false |
| Whether or not the panel starts hidden (create hidden, then Show() once its content has loaded). | |
| Dismiss dismiss = Dismiss::Manual |
The auto-dismiss policy.
Auto hides the panel the way native menus close, ie. when:
Panel::OnDismiss() fires each time. Scrolling never dismisses a floating panel, and Manual panels hide only when you hide them.
| FocusPolicy focus = FocusPolicy::Auto |
The keyboard-focus policy (see FocusPolicy).
| Size height |
The panel's height, in logical px or as a percent of the window's height.
Unset means 100%.
| bool hidden = false |
Whether or not the panel starts hidden (create hidden, then Show() once its content has loaded).
| String key |
Optional identity for lookup and diagnostics.
Empty means unkeyed.
| Anchor placement |
Where the panel sits in the window (see Anchor).
The default is the window origin, which with the default sizes gives a full-window panel.
| Size width |
The panel's width, in logical px or as a percent of the window's width.
Unset means 100%.