PopupLayout
- class PopupLayout(**kwargs)
- Constructors:
new(anchor_rect:Gdk.Rectangle, rect_anchor:Gdk.Gravity, surface_anchor:Gdk.Gravity) -> Gdk.PopupLayout
Constructors
- class PopupLayout
- classmethod new(anchor_rect: Rectangle, rect_anchor: Gravity, surface_anchor: Gravity) PopupLayout
Create a popup layout description.
Used together with
present
to describe how a popup surface should be placed and behave on-screen.anchor_rect
is relative to the top-left corner of the surface’s parent.rect_anchor
andsurface_anchor
determine anchor points onanchor_rect
and surface to pin together.The position of
anchor_rect
’s anchor point can optionally be offset usingset_offset
, which is equivalent to offsetting the position of surface.- Parameters:
anchor_rect – the anchor
GdkRectangle
to alignsurface
withrect_anchor – the point on
anchor_rect
to align withsurface
’s anchor pointsurface_anchor – the point on
surface
to align withrect
’s anchor point
Methods
- class PopupLayout
- equal(other: PopupLayout) bool
Check whether
layout
andother
has identical layout properties.- Parameters:
other – another
GdkPopupLayout
- get_anchor_hints() AnchorHints
Get the
GdkAnchorHints
.
- get_shadow_width() tuple[int, int, int, int]
Obtains the shadow widths of this layout.
Added in version 4.2.
- set_anchor_hints(anchor_hints: AnchorHints) None
Set new anchor hints.
The set
anchor_hints
determines howsurface
will be moved if the anchor points cause it to move off-screen. For example,FLIP_X
will replaceNORTH_WEST
withNORTH_EAST
and vice versa ifsurface
extends beyond the left or right edges of the monitor.- Parameters:
anchor_hints – the new
GdkAnchorHints
- set_anchor_rect(anchor_rect: Rectangle) None
Set the anchor rectangle.
- Parameters:
anchor_rect – the new anchor rectangle
- set_offset(dx: int, dy: int) None
Offset the position of the anchor rectangle with the given delta.
- Parameters:
dx – x delta to offset the anchor rectangle with
dy – y delta to offset the anchor rectangle with
- set_rect_anchor(anchor: Gravity) None
Set the anchor on the anchor rectangle.
- Parameters:
anchor – the new rect anchor
- set_shadow_width(left: int, right: int, top: int, bottom: int) None
Sets the shadow width of the popup.
The shadow width corresponds to the part of the computed surface size that would consist of the shadow margin surrounding the window, would there be any.
Added in version 4.2.
- Parameters:
left – width of the left part of the shadow
right – width of the right part of the shadow
top – height of the top part of the shadow
bottom – height of the bottom part of the shadow