gtk4::prelude

Trait PopoverExt

Source
pub trait PopoverExt: IsA<Popover> + 'static {
Show 32 methods // Provided methods fn is_autohide(&self) -> bool { ... } fn is_cascade_popdown(&self) -> bool { ... } fn child(&self) -> Option<Widget> { ... } fn has_arrow(&self) -> bool { ... } fn is_mnemonics_visible(&self) -> bool { ... } fn offset(&self) -> (i32, i32) { ... } fn pointing_to(&self) -> (bool, Rectangle) { ... } fn position(&self) -> PositionType { ... } fn popdown(&self) { ... } fn popup(&self) { ... } fn present(&self) { ... } fn set_autohide(&self, autohide: bool) { ... } fn set_cascade_popdown(&self, cascade_popdown: bool) { ... } fn set_child(&self, child: Option<&impl IsA<Widget>>) { ... } fn set_default_widget(&self, widget: Option<&impl IsA<Widget>>) { ... } fn set_has_arrow(&self, has_arrow: bool) { ... } fn set_mnemonics_visible(&self, mnemonics_visible: bool) { ... } fn set_offset(&self, x_offset: i32, y_offset: i32) { ... } fn set_pointing_to(&self, rect: Option<&Rectangle>) { ... } fn set_position(&self, position: PositionType) { ... } fn default_widget(&self) -> Option<Widget> { ... } fn connect_activate_default<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_activate_default(&self) { ... } fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_autohide_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_cascade_popdown_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_default_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_has_arrow_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_mnemonics_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_pointing_to_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_position_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Popover methods.

§Implementors

EmojiChooser, PopoverMenu, Popover

Provided Methods§

Source

fn is_autohide(&self) -> bool

Returns whether the popover is modal.

See set_autohide() for the implications of this.

§Returns

true if @self is modal

Source

fn is_cascade_popdown(&self) -> bool

Returns whether the popover will close after a modal child is closed.

§Returns

true if @self will close after a modal child.

Source

fn child(&self) -> Option<Widget>

Gets the child widget of @self.

§Returns

the child widget of @self

Source

fn has_arrow(&self) -> bool

Gets whether this popover is showing an arrow pointing at the widget that it is relative to.

§Returns

whether the popover has an arrow

Source

fn is_mnemonics_visible(&self) -> bool

Gets whether mnemonics are visible.

§Returns

true if mnemonics are supposed to be visible in this popover

Source

fn offset(&self) -> (i32, i32)

Gets the offset previous set with set_offset()()].

§Returns
§x_offset

a location for the x_offset

§y_offset

a location for the y_offset

Source

fn pointing_to(&self) -> (bool, Rectangle)

Gets the rectangle that the popover points to.

If a rectangle to point to has been set, this function will return true and fill in @rect with such rectangle, otherwise it will return false and fill in @rect with the parent widget coordinates.

§Returns

true if a rectangle to point to was set.

§rect

location to store the rectangle

Source

fn position(&self) -> PositionType

Returns the preferred position of @self.

§Returns

The preferred position.

Source

fn popdown(&self)

Pops @self down.

This may have the side-effect of closing a parent popover as well. See cascade-popdown.

Source

fn popup(&self)

Pops @self up.

Source

fn present(&self)

Allocate a size for the Popover.

This function needs to be called in size-allocate by widgets who have a Popover as child. When using a layout manager, this is happening automatically.

To make a popover appear on screen, use popup().

Source

fn set_autohide(&self, autohide: bool)

Sets whether @self is modal.

A modal popover will grab the keyboard focus on it when being displayed. Focus will wrap around within the popover. Clicking outside the popover area or pressing Esc will dismiss the popover.

Called this function on an already showing popup with a new autohide value different from the current one, will cause the popup to be hidden.

§autohide

true to dismiss the popover on outside clicks

Source

fn set_cascade_popdown(&self, cascade_popdown: bool)

If @cascade_popdown is true, the popover will be closed when a child modal popover is closed.

If false, @self will stay visible.

§cascade_popdown

true if the popover should follow a child closing

Source

fn set_child(&self, child: Option<&impl IsA<Widget>>)

Sets the child widget of @self.

§child

the child widget

Source

fn set_default_widget(&self, widget: Option<&impl IsA<Widget>>)

Sets the default widget of a Popover.

The default widget is the widget that’s activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a Popover.

§widget

a child widget of @self to set as the default, or None to unset the default widget for the popover

Source

fn set_has_arrow(&self, has_arrow: bool)

Sets whether this popover should draw an arrow pointing at the widget it is relative to.

§has_arrow

true to draw an arrow

Source

fn set_mnemonics_visible(&self, mnemonics_visible: bool)

Sets whether mnemonics should be visible.

§mnemonics_visible

the new value

Source

fn set_offset(&self, x_offset: i32, y_offset: i32)

Sets the offset to use when calculating the position of the popover.

These values are used when preparing the Gdk::PopupLayout for positioning the popover.

§x_offset

the x offset to adjust the position by

§y_offset

the y offset to adjust the position by

Source

fn set_pointing_to(&self, rect: Option<&Rectangle>)

Sets the rectangle that @self points to.

This is in the coordinate space of the @self parent.

§rect

rectangle to point to

Source

fn set_position(&self, position: PositionType)

Sets the preferred position for @self to appear.

If the @self is currently visible, it will be immediately updated.

This preference will be respected where possible, although on lack of space (eg. if close to the window edges), the Popover may choose to appear on the opposite side.

§position

preferred popover position

Source

fn default_widget(&self) -> Option<Widget>

The default widget inside the popover.

Source

fn connect_activate_default<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted whend the user activates the default widget.

This is a keybinding signal.

The default binding for this signal is Enter.

Source

fn emit_activate_default(&self)

Source

fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the popover is closed.

Source

fn connect_autohide_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_cascade_popdown_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_default_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_has_arrow_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_mnemonics_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_pointing_to_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_position_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§