Package ch.bailu.gtk.adw
Klasse Dialog
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
AboutDialog,AlertDialog,PreferencesDialog
An adaptive dialog container.
<picture>
<source srcset="dialog-floating-dark.png" media="(prefers-color-scheme: dark)">
<img src="dialog-floating.png" alt="dialog-floating">
</picture>
<picture>
<source srcset="dialog-bottom-dark.png" media="(prefers-color-scheme: dark)">
<img src="dialog-bottom.png" alt="dialog-bottom">
</picture>
`AdwDialog` is similar to a window, but is shown within another window. It
can be used with [class@Window] and [class@ApplicationWindow], use
[method@Dialog.present] to show it.
`AdwDialog` is not resizable. Use the [property@Dialog:content-width] and
[property@Dialog:content-height] properties to set its size, or set
[property@Dialog:follows-content-size] to `TRUE` to make the dialog track the
content's size as it changes. `AdwDialog` can never be larger than its parent
window.
`AdwDialog` can be presented as a centered floating window or a bottom sheet.
By default it's automatic depending on the available size.
[property@Dialog:presentation-mode] can be used to change that.
`AdwDialog` can be closed via [method@Dialog.close].
When presented as a bottom sheet, `AdwDialog` can also be closed via swiping
it down.
The [property@Dialog:can-close] can be used to prevent closing. In that case,
[signal@Dialog::close-attempt] gets emitted instead.
Use [method@Dialog.force_close] to close the dialog even when `can-close` is set to
`FALSE`.
`AdwDialog` is transient and doesn't integrate with the window below it, for
example it's not possible to collapse it into a bottom bar. See
[class@BottomSheet] for persistent and more tightly integrated bottom sheets.
## Header Bar Integration
When placed inside an `AdwDialog`, [class@HeaderBar] will display the dialog
title instead of window title. It will also adjust the decoration layout to
ensure it always has a close button and nothing else. Set
[property@HeaderBar:show-start-title-buttons] and
[property@HeaderBar:show-end-title-buttons] to `FALSE` to remove it if it's
unwanted.
## Breakpoints
`AdwDialog` can be used with [class@Breakpoint] the same way as
[class@BreakpointBin]. Refer to that widget's documentation for details.
Like `AdwBreakpointBin`, if breakpoints are used, `AdwDialog` doesn't have a
minimum size, and [property@Gtk.Widget:width-request] and
[property@Gtk.Widget:height-request] properties must be set manually.
<picture>
<source srcset="dialog-floating-dark.png" media="(prefers-color-scheme: dark)">
<img src="dialog-floating.png" alt="dialog-floating">
</picture>
<picture>
<source srcset="dialog-bottom-dark.png" media="(prefers-color-scheme: dark)">
<img src="dialog-bottom.png" alt="dialog-bottom">
</picture>
`AdwDialog` is similar to a window, but is shown within another window. It
can be used with [class@Window] and [class@ApplicationWindow], use
[method@Dialog.present] to show it.
`AdwDialog` is not resizable. Use the [property@Dialog:content-width] and
[property@Dialog:content-height] properties to set its size, or set
[property@Dialog:follows-content-size] to `TRUE` to make the dialog track the
content's size as it changes. `AdwDialog` can never be larger than its parent
window.
`AdwDialog` can be presented as a centered floating window or a bottom sheet.
By default it's automatic depending on the available size.
[property@Dialog:presentation-mode] can be used to change that.
`AdwDialog` can be closed via [method@Dialog.close].
When presented as a bottom sheet, `AdwDialog` can also be closed via swiping
it down.
The [property@Dialog:can-close] can be used to prevent closing. In that case,
[signal@Dialog::close-attempt] gets emitted instead.
Use [method@Dialog.force_close] to close the dialog even when `can-close` is set to
`FALSE`.
`AdwDialog` is transient and doesn't integrate with the window below it, for
example it's not possible to collapse it into a bottom bar. See
[class@BottomSheet] for persistent and more tightly integrated bottom sheets.
## Header Bar Integration
When placed inside an `AdwDialog`, [class@HeaderBar] will display the dialog
title instead of window title. It will also adjust the decoration layout to
ensure it always has a close button and nothing else. Set
[property@HeaderBar:show-start-title-buttons] and
[property@HeaderBar:show-end-title-buttons] to `FALSE` to remove it if it's
unwanted.
## Breakpoints
`AdwDialog` can be used with [class@Breakpoint] the same way as
[class@BreakpointBin]. Refer to that widget's documentation for details.
Like `AdwBreakpointBin`, if breakpoints are used, `AdwDialog` doesn't have a
minimum size, and [property@Gtk.Widget:width-request] and
[property@Gtk.Widget:height-request] properties must be set manually.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Dialog.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interfacestatic interfaceVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealizeVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZEVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddBreakpoint(Breakpoint breakpoint) Adds @breakpoint to @self.Implements interfaceAccessible.Implements interfaceBuildable.Implements interfaceConstraintTarget.Implements interfaceShortcutManager.booleanclose()Attempts to close @self.voidCloses @self.booleanGets whether @self can be closed.getChild()Gets the child widget of @self.static ClassHandlerintGets the height of the dialog's contents.intGets the width of the dialog's contents.Gets the current breakpoint.Gets the default widget for @self.getFocus()Gets the focus widget for @self.booleanGets whether to size content of @self automatically.static intstatic longstatic TypeSystem.TypeSizeintGets presentation mode for @self.getTitle()Gets the title of @self.static longstatic TypeSystem.TypeSizeonCloseAttempt(Dialog.OnCloseAttempt signal) Connect to signal "close-attempt".onClosed(Dialog.OnClosed signal) Connect to signal "closed".voidPresents @self within @parent's window.voidsetCanClose(boolean can_close) Sets whether @self can be closed.voidSets the child widget of @self.voidsetContentHeight(int content_height) Sets the height of the dialog's contents.voidsetContentWidth(int content_width) Sets the width of the dialog's contents.voidsetDefaultWidget(Widget default_widget) Sets the default widget for @self.voidSets the focus widget for @self.voidsetFollowsContentSize(boolean follows_content_size) Sets whether to size content of @self automatically.voidsetPresentationMode(int presentation_mode) Sets presentation mode for @self.voidSets the title of @self.voidSets the title of @self.Von Klasse geerbte Methoden ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlagsVon Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrPropertyVon Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnrefVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_CLOSE_ATTEMPT
- Siehe auch:
-
SIGNAL_ON_CLOSED
- Siehe auch:
-
-
Konstruktordetails
-
Dialog
-
Dialog
public Dialog()Creates a new `AdwDialog`.
-
-
Methodendetails
-
getClassHandler
-
addBreakpoint
Adds @breakpoint to @self.- Parameter:
breakpoint- the breakpoint to add
-
close
public boolean close()Attempts to close @self.
If the [property@Dialog:can-close] property is set to `FALSE`, the
[signal@Dialog::close-attempt] signal is emitted.
See also: [method@Dialog.force_close].- Gibt zurück:
- whether @self was successfully closed
-
forceClose
public void forceClose()Closes @self.
Unlike [method@Dialog.close], it succeeds even if [property@Dialog:can-close]
is set to `FALSE`. -
getCanClose
public boolean getCanClose()Gets whether @self can be closed.- Gibt zurück:
- whether the dialog can be closed
-
getChild
Gets the child widget of @self.- Gibt zurück:
- the child widget of @self
-
getContentHeight
public int getContentHeight()Gets the height of the dialog's contents.- Gibt zurück:
- the content height
-
getContentWidth
public int getContentWidth()Gets the width of the dialog's contents.- Gibt zurück:
- the content width
-
getCurrentBreakpoint
Gets the current breakpoint.- Gibt zurück:
- the current breakpoint
-
getDefaultWidget
Gets the default widget for @self.- Gibt zurück:
- the default widget
-
getFocus
Gets the focus widget for @self.- Gibt zurück:
- the focus widget
-
getFollowsContentSize
public boolean getFollowsContentSize()Gets whether to size content of @self automatically.- Gibt zurück:
- whether to size content automatically
-
getPresentationMode
public int getPresentationMode()Gets presentation mode for @self.- Gibt zurück:
- the presentation mode
-
getTitle
Gets the title of @self.- Gibt zurück:
- the title
-
present
Presents @self within @parent's window.
If @self is already shown, raises it to the top instead.
If the window is an [class@Window] or [class@ApplicationWindow], the dialog
will be shown within it. Otherwise, it will be a separate window.- Parameter:
parent- a widget within the toplevel
-
setCanClose
public void setCanClose(boolean can_close) Sets whether @self can be closed.
If set to `FALSE`, the close button, shortcuts and
[method@Dialog.close] will result in [signal@Dialog::close-attempt] being
emitted instead, and bottom sheet close swipe will be disabled.
[method@Dialog.force_close] still works.- Parameter:
can_close- whether to allow closing
-
setChild
Sets the child widget of @self.- Parameter:
child- the child widget
-
setContentHeight
public void setContentHeight(int content_height) Sets the height of the dialog's contents.
Set it to -1 to reset it to the content's natural height.
See also: [property@Gtk.Window:default-height]- Parameter:
content_height- the content height
-
setContentWidth
public void setContentWidth(int content_width) Sets the width of the dialog's contents.
Set it to -1 to reset it to the content's natural width.
See also: [property@Gtk.Window:default-width]- Parameter:
content_width- the content width
-
setDefaultWidget
Sets the default widget for @self.
It's activated when the user presses Enter.- Parameter:
default_widget- the default widget
-
setFocus
Sets the focus widget for @self.
If @focus is not the current focus widget, and is focusable, sets it as the
focus widget for the dialog.
If focus is `NULL`, unsets the focus widget for this dialog. To set the focus
to a particular widget in the dialog, it is usually more convenient to use
[method@Gtk.Widget.grab_focus] instead of this function.- Parameter:
focus- the focus widget
-
setFollowsContentSize
public void setFollowsContentSize(boolean follows_content_size) Sets whether to size content of @self automatically.
If set to `TRUE`, always use the content's natural size instead of
[property@Dialog:content-width] and [property@Dialog:content-height]. If
the content resizes, the dialog will immediately resize as well.
See also: [property@Gtk.Window:resizable]- Parameter:
follows_content_size- whether to size content automatically
-
setPresentationMode
public void setPresentationMode(int presentation_mode) Sets presentation mode for @self.
When set to `ADW_DIALOG_AUTO`, the dialog appears as a bottom sheet when the
following condition is met: `max-width: 450px or max-height: 360px`, and as a
floating window otherwise.
Set it to `ADW_DIALOG_FLOATING` or `ADW_DIALOG_BOTTOM_SHEET` to always
present it a floating window or a bottom sheet respectively, regardless of
available size.
Presentation mode does nothing for dialogs presented as a window.- Parameter:
presentation_mode- the new presentation mode
-
setTitle
Sets the title of @self.- Parameter:
title- the new title
-
setTitle
Sets the title of @self.- Parameter:
title- the new title
-
onCloseAttempt
Connect to signal "close-attempt".
SeeDialog.OnCloseAttempt.onCloseAttempt()for signal description.
FieldSIGNAL_ON_CLOSE_ATTEMPTcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
onClosed
Connect to signal "closed".
SeeDialog.OnClosed.onClosed()for signal description.
FieldSIGNAL_ON_CLOSEDcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
asAccessible
Implements interfaceAccessible. Call this to get access to interface functions.- Setzt außer Kraft:
asAccessiblein KlasseWidget- Gibt zurück:
Accessible
-
asBuildable
Implements interfaceBuildable. Call this to get access to interface functions.- Setzt außer Kraft:
asBuildablein KlasseWidget- Gibt zurück:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget. Call this to get access to interface functions.- Setzt außer Kraft:
asConstraintTargetin KlasseWidget- Gibt zurück:
ConstraintTarget
-
asShortcutManager
Implements interfaceShortcutManager. Call this to get access to interface functions.- Gibt zurück:
ShortcutManager
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-