跳到正文

SystemPopover

在独立的原生子窗口中显示 QuickGUI 内容,可超出所属窗口边界。

#导入

从 quickgui 导入 SystemPopover。

use quickgui::*;

#用法

SystemPopover::new(320.0, 240.0)

#结构

  • SystemPopover::root
  • SystemPopover::trigger
  • SystemPopover::content

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

SystemPopover

查看源码
pub fn new(width: f32, height: f32) -> Self
sizepub const fn size(self) -> Size—

Configures size for this part.

pub const fn size(self) -> Size
查看源码
placementpub const fn placement(mut self, placement: AnchorPlacement) -> Self—

Configures placement for this part.

pub const fn placement(mut self, placement: AnchorPlacement) -> Self
查看源码
gappub fn gap(mut self, gap: f32) -> Self—

Configures gap for this part.

pub fn gap(mut self, gap: f32) -> Self
查看源码
viewport_marginpub fn viewport_margin(mut self, margin: f32) -> Self—

Set the collision margin inside the display work area.

pub fn viewport_margin(mut self, margin: f32) -> Self
查看源码
dismiss_on_escapepub const fn dismiss_on_escape(mut self, dismiss: bool) -> Self—

Configures dismiss on escape for this part.

pub const fn dismiss_on_escape(mut self, dismiss: bool) -> Self
查看源码
dismiss_on_pointer_outsidepub const fn dismiss_on_pointer_outside(mut self, dismiss: bool) -> Self—

Configures dismiss on pointer outside for this part.

pub const fn dismiss_on_pointer_outside(mut self, dismiss: bool) -> Self
查看源码
offsetpub fn offset(mut self, x: f32, y: f32) -> Self—

Configures offset for this part.

pub fn offset(mut self, x: f32, y: f32) -> Self
查看源码
constraint_adjustmentpub const fn constraint_adjustment(mut self, constraints: PopoverConstraintAdjustment) -> Self—

Configures constraint adjustment for this part.

pub const fn constraint_adjustment(mut self, constraints: PopoverConstraintAdjustment) -> Self
查看源码
grabpub const fn grab(mut self, grab: bool) -> Self—

Select menu-style focus and outside/Escape dismissal. Passive tooltips and preview surfaces use `grab(false)` and own no event monitor.

pub const fn grab(mut self, grab: bool) -> Self
查看源码
accepts_key_focuspub const fn accepts_key_focus(mut self, accepts_key_focus: bool) -> Self—

Allow or forbid native key-window ownership after pointer interaction. `false` keeps an interactive child panel permanently non-key and also disables grabbing, which lets an owner-window text input retain keyboard and IME focus.

pub const fn accepts_key_focus(mut self, accepts_key_focus: bool) -> Self
查看源码
popover_optionspub fn popover_options(self) -> PopoverOptions—

Configures popover options for this part.

pub fn popover_options(self) -> PopoverOptions
查看源码
window_optionspub fn window_options(self, title: impl Into<String>) -> WindowOptions—

Build transparent, borderless window options without choosing application presentation.

pub fn window_options(self, title: impl Into<String>) -> WindowOptions
查看源码
openpub fn open<V: View>( self, cx: &mut EventContext, anchor: impl Into<ElementId>, title: impl Into<String>, view: V, ) -> Result<WindowHandle, WindowCommandError>—

Open the overflow-capable child using the latest retained bounds of `anchor`.

pub fn open<V: View>( self, cx: &mut EventContext, anchor: impl Into<ElementId>, title: impl Into<String>, view: V, ) -> Result<WindowHandle, WindowCommandError>
查看源码