gi-handy-0.0.8: libhandy bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Handy.Objects.Dialog

Description

A Dialog that adapts to smaller displays.

Small is defined as:

C code

is_small = ((             width <= 400 && height <= 800) ||
            (maximized && width <= 800 && height <= 400));

In the smaller view a HdyDialog matches its size to that of its parent and for "Presentation Dialogs" uses a back button rather than close button to dismiss.

It's recommended that dialog contents are wrapped in a ScrolledWindow to ensure they don't overflow the screen.

Dialog works best when Dialog:use-header-bar is True (which is the case when using dialogNew).

Design Information: GitLab Issue

Ideally when using Dialog you shouldn't need to know you are using it rather than Dialog however there are some notable differences: Window:modal is True by default as is Window:destroy-with-parent as the behaviour demonstrated by Dialog would be a bad user experience when not modal.

If you want to replace the titlebar by your own, we recommend using HeaderBar as it will retain the abiity to present a back button when the dialog is small. HeaderBar doesn't have to be its direct child and you can use any complex contraption you like as the dialog's titlebar.

Since: 0.0.7

Synopsis

Exported types

newtype Dialog Source #

Memory-managed wrapper type.

Constructors

Dialog (ManagedPtr Dialog) 

Instances

Instances details
Eq Dialog Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

Methods

(==) :: Dialog -> Dialog -> Bool #

(/=) :: Dialog -> Dialog -> Bool #

GObject Dialog Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

ManagedPtrNewtype Dialog Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

Methods

toManagedPtr :: Dialog -> ManagedPtr Dialog

TypedObject Dialog Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

Methods

glibType :: IO GType

HasParentTypes Dialog Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

IsGValue (Maybe Dialog) Source #

Convert Dialog to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Handy.Objects.Dialog

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Dialog -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Dialog)

type ParentTypes Dialog Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

type ParentTypes Dialog = '[Dialog, Window, Bin, Container, Widget, Object, ImplementorIface, Buildable]

class (GObject o, IsDescendantOf Dialog o) => IsDialog o Source #

Type class for types which can be safely cast to Dialog, for instance with toDialog.

Instances

Instances details
(GObject o, IsDescendantOf Dialog o) => IsDialog o Source # 
Instance details

Defined in GI.Handy.Objects.Dialog

toDialog :: (MonadIO m, IsDialog o) => o -> m Dialog Source #

Cast to Dialog, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

activate, activateDefault, activateFocus, activateKey, add, addAccelGroup, addAccelerator, addActionWidget, addButton, addChild, addDeviceEvents, addEvents, addMnemonic, addMnemonicLabel, addTickCallback, beginMoveDrag, beginResizeDrag, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, close, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, deiconify, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, fullscreen, fullscreenOnMonitor, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasGroup, hasRcStyle, hasScreen, hasToplevelFocus, hasVisibleFocus, hide, hideOnDelete, iconify, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isActive, isAncestor, isComposited, isDrawable, isFloating, isFocus, isMaximized, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, maximize, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, move, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parseGeometry, parserFinished, path, present, presentWithTime, propagateDraw, propagateKeyEvent, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelGroup, removeAccelerator, removeMnemonic, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, reshowWithInitialSize, resize, resizeChildren, resizeGripIsVisible, resizeToGeometry, response, run, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, stick, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unfullscreen, unmap, unmaximize, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, unstick, watchClosure.

Getters

getAcceptFocus, getAccessible, getActionArea, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getApplication, getAttachedTo, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getContentArea, getData, getDecorated, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocus, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusOnMap, getFocusVadjustment, getFocusVisible, getFontMap, getFontOptions, getFrameClock, getGravity, getGroup, getHalign, getHasResizeGrip, getHasTooltip, getHasWindow, getHeaderBar, getHexpand, getHexpandSet, getHideTitlebarWhenMaximized, getIcon, getIconList, getIconName, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMnemonicModifier, getMnemonicsVisible, getModal, getModifierMask, getModifierStyle, getName, getNarrow, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPosition, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizable, getResizeGripArea, getResizeMode, getResponseForWidget, getRole, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSize, getSizeRequest, getSkipPagerHint, getSkipTaskbarHint, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTitle, getTitlebar, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getTransientFor, getTypeHint, getUrgencyHint, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWidgetForResponse, getWindow, getWindowType.

Setters

setAccelPath, setAcceptFocus, setAllocation, setAlternativeButtonOrderFromArray, setAppPaintable, setApplication, setAttachedTo, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDecorated, setDefault, setDefaultGeometry, setDefaultResponse, setDefaultSize, setDeletable, setDestroyWithParent, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocus, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusOnMap, setFocusVadjustment, setFocusVisible, setFontMap, setFontOptions, setGeometryHints, setGravity, setHalign, setHasResizeGrip, setHasTooltip, setHasUserRefCount, setHasWindow, setHexpand, setHexpandSet, setHideTitlebarWhenMaximized, setIcon, setIconFromFile, setIconList, setIconName, setKeepAbove, setKeepBelow, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setMnemonicModifier, setMnemonicsVisible, setModal, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setPosition, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizable, setResizeMode, setResponseSensitive, setRole, setScreen, setSensitive, setSizeRequest, setSkipPagerHint, setSkipTaskbarHint, setStartupId, setState, setStateFlags, setStyle, setSupportMultidevice, setTitle, setTitlebar, setTooltipMarkup, setTooltipText, setTooltipWindow, setTransientFor, setTypeHint, setUrgencyHint, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow, setWmclass.

getNarrow

dialogGetNarrow Source #

Arguments

:: (HasCallStack, MonadIO m, IsDialog a) 
=> a

self: a Dialog

-> m Bool

Returns: True if self is narrow, False otherwise.

Gets whether self is narrow.

Since: 0.0.11

new

dialogNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsWindow a) 
=> a

parent: Window this dialog is a child of

-> m Dialog 

Create a Dialog with Window:transient-for set to parent

C Usage

C code

GtkWidget *dlg = hdy_dialog_new (GTK_WINDOW (main_window));

Vala Usage

Vala code

var dlg = new Hdy.Dialog (main_window);

Python Usage

Python code

dlg = Handy.Dialog.new (main_window);

Since: 0.0.7

Properties

narrow

True if the dialog is narrow.

Since: 0.0.11

getDialogNarrow :: (MonadIO m, IsDialog o) => o -> m Bool Source #

Get the value of the “narrow” property. When overloading is enabled, this is equivalent to

get dialog #narrow