Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Adw.Objects.Window
Description
A freeform window.
<picture> <source srcset="window-dark.png" media="(prefers-color-scheme: dark)"> <img src="window.png" alt="window"> </picture>
The AdwWindow
widget is a subclass of Window
which has no
titlebar area. Instead, [classtoolbarView
] can be used together with
[classheaderBar
] or HeaderBar
as follows:
xml code
<object class="AdwWindow"> <property name="content"> <object class="AdwToolbarView"> <child type="top"> <object class="AdwHeaderBar"/> </child> <property name="content"> <!-- ... --> </property> </object> </property> </object>
Using Window:titlebar or Window:child
is not supported and will result in a crash. Use [propertywindow
:content]
instead.
Dialogs
AdwWindow
can contain [classdialog
]. Use [methoddialog
.present] with the
window or a widget within a window to show a dialog.
Breakpoints
AdwWindow
can be used with [classbreakpoint
] the same way as
[classbreakpointBin
]. Refer to that widget's documentation for details.
Example:
xml code
<object class="AdwWindow"> <property name="width-request">360</property> <property name="height-request">200</property> <property name="content"> <object class="AdwToolbarView"> <child type="top"> <object class="AdwHeaderBar"/> </child> <property name="content"> <!-- ... --> </property> <child type="bottom"> <object class="GtkActionBar" id="bottom_bar"> <property name="revealed">True</property> <property name="visible">False</property> </object> </child> </object> </property> <child> <object class="AdwBreakpoint"> <condition>max-width: 500px</condition> <setter object="bottom_bar" property="visible">True</setter> </object> </child> </object>
Like AdwBreakpointBin
, if breakpoints are used, AdwWindow
doesn't have a
minimum size, and Widget:widthRequest and
Widget:heightRequest properties must be set manually.
Synopsis
- newtype Window = Window (ManagedPtr Window)
- class (GObject o, IsDescendantOf Window o) => IsWindow o
- toWindow :: (MonadIO m, IsWindow o) => o -> m Window
- windowAddBreakpoint :: (HasCallStack, MonadIO m, IsWindow a, IsBreakpoint b) => a -> b -> m ()
- windowGetContent :: (HasCallStack, MonadIO m, IsWindow a) => a -> m (Maybe Widget)
- windowGetCurrentBreakpoint :: (HasCallStack, MonadIO m, IsWindow a) => a -> m (Maybe Breakpoint)
- windowGetDialogs :: (HasCallStack, MonadIO m, IsWindow a) => a -> m ListModel
- windowGetVisibleDialog :: (HasCallStack, MonadIO m, IsWindow a) => a -> m (Maybe Dialog)
- windowNew :: (HasCallStack, MonadIO m) => m Window
- windowSetContent :: (HasCallStack, MonadIO m, IsWindow a, IsWidget b) => a -> Maybe b -> m ()
- clearWindowContent :: (MonadIO m, IsWindow o) => o -> m ()
- constructWindowContent :: (IsWindow o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getWindowContent :: (MonadIO m, IsWindow o) => o -> m (Maybe Widget)
- setWindowContent :: (MonadIO m, IsWindow o, IsWidget a) => o -> a -> m ()
- getWindowCurrentBreakpoint :: (MonadIO m, IsWindow o) => o -> m (Maybe Breakpoint)
- getWindowDialogs :: (MonadIO m, IsWindow o) => o -> m (Maybe ListModel)
- getWindowVisibleDialog :: (MonadIO m, IsWindow o) => o -> m (Maybe Dialog)
Exported types
Memory-managed wrapper type.
Instances
Eq Window Source # | |
GObject Window Source # | |
Defined in GI.Adw.Objects.Window | |
ManagedPtrNewtype Window Source # | |
Defined in GI.Adw.Objects.Window Methods toManagedPtr :: Window -> ManagedPtr Window | |
TypedObject Window Source # | |
Defined in GI.Adw.Objects.Window | |
HasParentTypes Window Source # | |
Defined in GI.Adw.Objects.Window | |
IsGValue (Maybe Window) Source # | Convert |
Defined in GI.Adw.Objects.Window Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Window -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Window) | |
type ParentTypes Window Source # | |
Defined in GI.Adw.Objects.Window type ParentTypes Window = '[Window, Widget, Object, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager] |
class (GObject o, IsDescendantOf Window o) => IsWindow o Source #
Instances
(GObject o, IsDescendantOf Window o) => IsWindow o Source # | |
Defined in GI.Adw.Objects.Window |
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addBreakpoint, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, close, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, destroy, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, fullscreen, fullscreenOnMonitor, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasGroup, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isActive, isAncestor, isDrawable, isFloating, isFocus, isFullscreen, isMaximized, isSensitive, isSuspended, isVisible, keynavFailed, listMnemonicLabels, map, maximize, measure, minimize, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, present, presentWithTime, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unfullscreen, unmap, unmaximize, unminimize, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getApplication, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getContent, getCssClasses, getCssName, getCurrentBreakpoint, getCursor, getData, getDecorated, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getDialogs, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocus, getFocusChild, getFocusOnClick, getFocusVisible, getFocusable, getFontMap, getFontOptions, getFrameClock, getGroup, getHalign, getHandleMenubarAccel, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHideOnClose, getIconName, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMnemonicsVisible, getModal, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getResizable, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSurface, getSurfaceTransform, getTemplateChild, getTitle, getTitlebar, getTooltipMarkup, getTooltipText, getTransientFor, getValign, getVexpand, getVexpandSet, getVisible, getVisibleDialog, getWidth.
Setters
setAccessibleParent, setApplication, setCanFocus, setCanTarget, setChild, setChildVisible, setContent, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDecorated, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDirection, setDisplay, setFocus, setFocusChild, setFocusOnClick, setFocusVisible, setFocusable, setFontMap, setFontOptions, setHalign, setHandleMenubarAccel, setHasTooltip, setHexpand, setHexpandSet, setHideOnClose, setIconName, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMnemonicsVisible, setModal, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setResizable, setSensitive, setSizeRequest, setStartupId, setStateFlags, setTitle, setTitlebar, setTooltipMarkup, setTooltipText, setTransientFor, setValign, setVexpand, setVexpandSet, setVisible.
addBreakpoint
Arguments
:: (HasCallStack, MonadIO m, IsWindow a, IsBreakpoint b) | |
=> a |
|
-> b |
|
-> m () |
Adds breakpoint
to self
.
Since: 1.4
getContent
Arguments
:: (HasCallStack, MonadIO m, IsWindow a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the content widget of |
Gets the content widget of self
.
This method should always be used instead of windowGetChild
.
getCurrentBreakpoint
windowGetCurrentBreakpoint Source #
Arguments
:: (HasCallStack, MonadIO m, IsWindow a) | |
=> a |
|
-> m (Maybe Breakpoint) | Returns: the current breakpoint |
Gets the current breakpoint.
Since: 1.4
getDialogs
Arguments
:: (HasCallStack, MonadIO m, IsWindow a) | |
=> a |
|
-> m ListModel | Returns: a list model for the dialogs of |
Returns a ListModel
that contains the open dialogs of self
.
This can be used to keep an up-to-date view.
Since: 1.5
getVisibleDialog
windowGetVisibleDialog Source #
Arguments
:: (HasCallStack, MonadIO m, IsWindow a) | |
=> a |
|
-> m (Maybe Dialog) | Returns: the visible dialog |
Returns the currently visible dialog in self
, if there's one.
Since: 1.5
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Window | Returns: the newly created |
Creates a new AdwWindow
.
setContent
Arguments
:: (HasCallStack, MonadIO m, IsWindow a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the content widget of self
.
This method should always be used instead of windowSetChild
.
Properties
content
The content widget.
This property should always be used instead of Window:child.
clearWindowContent :: (MonadIO m, IsWindow o) => o -> m () Source #
Set the value of the “content
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#content
constructWindowContent :: (IsWindow o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “content
” property. This is rarely needed directly, but it is used by new
.
getWindowContent :: (MonadIO m, IsWindow o) => o -> m (Maybe Widget) Source #
Get the value of the “content
” property.
When overloading is enabled, this is equivalent to
get
window #content
setWindowContent :: (MonadIO m, IsWindow o, IsWidget a) => o -> a -> m () Source #
Set the value of the “content
” property.
When overloading is enabled, this is equivalent to
set
window [ #content:=
value ]
currentBreakpoint
The current breakpoint.
Since: 1.4
getWindowCurrentBreakpoint :: (MonadIO m, IsWindow o) => o -> m (Maybe Breakpoint) Source #
Get the value of the “current-breakpoint
” property.
When overloading is enabled, this is equivalent to
get
window #currentBreakpoint
dialogs
The open dialogs.
Since: 1.5
getWindowDialogs :: (MonadIO m, IsWindow o) => o -> m (Maybe ListModel) Source #
Get the value of the “dialogs
” property.
When overloading is enabled, this is equivalent to
get
window #dialogs
visibleDialog
The currently visible dialog
Since: 1.5
getWindowVisibleDialog :: (MonadIO m, IsWindow o) => o -> m (Maybe Dialog) Source #
Get the value of the “visible-dialog
” property.
When overloading is enabled, this is equivalent to
get
window #visibleDialog