Package ch.bailu.gtk.adw
Klasse ToolbarView
- Alle implementierten Schnittstellen:
PointerInterface
A widget containing a page, as well as top and/or bottom bars.
<picture>
<source srcset="toolbar-view-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view.png" alt="toolbar-view">
</picture>
`AdwToolbarView` has a single content widget and one or multiple top and
bottom bars, shown at the top and bottom sides respectively.
Example of an `AdwToolbarView` UI definition:
```xml
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
<property name="content">
<object class="AdwPreferencesPage">
<!-- ... -->
</object>
</property>
</object>
```
The following kinds of top and bottom bars are supported:
- [class@HeaderBar]
- [class@TabBar]
- [class@ViewSwitcherBar]
- [class@Gtk.ActionBar]
- [class@Gtk.HeaderBar]
- [class@Gtk.PopoverMenuBar]
- [class@Gtk.SearchBar]
- Any [class@Gtk.Box] or a similar widget with the
[`.toolbar`](style-classes.html#toolbars) style class
By default, top and bottom bars are flat and scrolling content has a subtle
undershoot shadow, same as when using the
[`.undershoot-top`](style-classes.html#undershoot-indicators) and
[`.undershoot-bottom`](style-classes.html#undershoot-indicators) style
classes. This works well in most cases, e.g. with [class@StatusPage] or
[class@PreferencesPage], where the background at the top and bottom parts of
the page is uniform. Additionally, windows with sidebars should always use
this style.
[property@ToolbarView:top-bar-style] and
[property@ToolbarView:bottom-bar-style] properties can be used add an opaque
background and a persistent shadow to top and bottom bars, this can be useful
for content such as [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
where some elements are adjacent to the top/bottom bars, or [class@TabView],
where each page can have a different background.
<picture style="min-width: 33%; display: inline-block;">
<source srcset="toolbar-view-flat-1-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-flat-1.png" alt="toolbar-view-flat-1">
</picture>
<picture style="min-width: 33%; display: inline-block;">
<source srcset="toolbar-view-flat-2-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-flat-2.png" alt="toolbar-view-flat-2">
</picture>
<picture style="min-width: 33%; display: inline-block;">
<source srcset="toolbar-view-raised-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-raised.png" alt="toolbar-view-raised">
</picture>
`AdwToolbarView` ensures the top and bottom bars have consistent backdrop
styles and vertical spacing. For comparison:
<picture style="min-width: 40%; display: inline-block;">
<source srcset="toolbar-view-spacing-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-spacing.png" alt="toolbar-view-spacing">
</picture>
<picture style="min-width: 40%; display: inline-block;">
<source srcset="toolbar-view-spacing-box-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-spacing-box.png" alt="toolbar-view-spacing-box">
</picture>
Any top and bottom bars can also be dragged to move the window, equivalent
to putting them into a [class@Gtk.WindowHandle].
Content is typically place between top and bottom bars, but can also extend
behind them. This is controlled with the
[property@ToolbarView:extend-content-to-top-edge] and
[property@ToolbarView:extend-content-to-bottom-edge] properties.
Top and bottom bars can be hidden and revealed with an animation using the
[property@ToolbarView:reveal-top-bars] and
[property@ToolbarView:reveal-bottom-bars] properties.
## `AdwToolbarView` as `GtkBuildable`
The `AdwToolbarView` implementation of the [iface@Gtk.Buildable] interface
supports adding a top bar by specifying “top” as the “type” attribute of a
`<child>` element, or adding a bottom bar by specifying “bottom”.
## Accessibility
`AdwToolbarView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
<picture>
<source srcset="toolbar-view-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view.png" alt="toolbar-view">
</picture>
`AdwToolbarView` has a single content widget and one or multiple top and
bottom bars, shown at the top and bottom sides respectively.
Example of an `AdwToolbarView` UI definition:
```xml
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
<property name="content">
<object class="AdwPreferencesPage">
<!-- ... -->
</object>
</property>
</object>
```
The following kinds of top and bottom bars are supported:
- [class@HeaderBar]
- [class@TabBar]
- [class@ViewSwitcherBar]
- [class@Gtk.ActionBar]
- [class@Gtk.HeaderBar]
- [class@Gtk.PopoverMenuBar]
- [class@Gtk.SearchBar]
- Any [class@Gtk.Box] or a similar widget with the
[`.toolbar`](style-classes.html#toolbars) style class
By default, top and bottom bars are flat and scrolling content has a subtle
undershoot shadow, same as when using the
[`.undershoot-top`](style-classes.html#undershoot-indicators) and
[`.undershoot-bottom`](style-classes.html#undershoot-indicators) style
classes. This works well in most cases, e.g. with [class@StatusPage] or
[class@PreferencesPage], where the background at the top and bottom parts of
the page is uniform. Additionally, windows with sidebars should always use
this style.
[property@ToolbarView:top-bar-style] and
[property@ToolbarView:bottom-bar-style] properties can be used add an opaque
background and a persistent shadow to top and bottom bars, this can be useful
for content such as [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
where some elements are adjacent to the top/bottom bars, or [class@TabView],
where each page can have a different background.
<picture style="min-width: 33%; display: inline-block;">
<source srcset="toolbar-view-flat-1-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-flat-1.png" alt="toolbar-view-flat-1">
</picture>
<picture style="min-width: 33%; display: inline-block;">
<source srcset="toolbar-view-flat-2-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-flat-2.png" alt="toolbar-view-flat-2">
</picture>
<picture style="min-width: 33%; display: inline-block;">
<source srcset="toolbar-view-raised-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-raised.png" alt="toolbar-view-raised">
</picture>
`AdwToolbarView` ensures the top and bottom bars have consistent backdrop
styles and vertical spacing. For comparison:
<picture style="min-width: 40%; display: inline-block;">
<source srcset="toolbar-view-spacing-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-spacing.png" alt="toolbar-view-spacing">
</picture>
<picture style="min-width: 40%; display: inline-block;">
<source srcset="toolbar-view-spacing-box-dark.png" media="(prefers-color-scheme: dark)">
<img src="toolbar-view-spacing-box.png" alt="toolbar-view-spacing-box">
</picture>
Any top and bottom bars can also be dragged to move the window, equivalent
to putting them into a [class@Gtk.WindowHandle].
Content is typically place between top and bottom bars, but can also extend
behind them. This is controlled with the
[property@ToolbarView:extend-content-to-top-edge] and
[property@ToolbarView:extend-content-to-bottom-edge] properties.
Top and bottom bars can be hidden and revealed with an animation using the
[property@ToolbarView:reveal-top-bars] and
[property@ToolbarView:reveal-bottom-bars] properties.
## `AdwToolbarView` as `GtkBuildable`
The `AdwToolbarView` implementation of the [iface@Gtk.Buildable] interface
supports adding a top bar by specifying “top” as the “type” attribute of a
`<child>` element, or adding a bottom bar by specifying “bottom”.
## Accessibility
`AdwToolbarView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ToolbarView.html
-
Verschachtelte Klassen - Übersicht
Von 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.OnUnrealize
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von 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_UNREALIZE
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addBottomBar
(Widget widget) Adds a bottom bar to @self.void
Adds a top bar to @self.Implements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceConstraintTarget
.int
Gets the current bottom bar height for @self.int
Gets appearance of the bottom bars for @self.static ClassHandler
Gets the content widget for @self.boolean
Gets whether the content widget can extend behind bottom bars.boolean
Gets whether the content widget can extend behind top bars.static int
static long
static TypeSystem.TypeSize
boolean
Gets whether bottom bars are revealed for @self.boolean
Gets whether top bars are revealed for @self.int
Gets the current top bar height for @self.int
Gets appearance of the top bars for @self.static long
static TypeSystem.TypeSize
void
Removes a child from @self.void
setBottomBarStyle
(int style) Sets appearance of the bottom bars for @self.void
setContent
(Widget content) Sets the content widget for @self.void
setExtendContentToBottomEdge
(boolean extend) Sets whether the content widget can extend behind bottom bars.void
setExtendContentToTopEdge
(boolean extend) Sets whether the content widget can extend behind top bars.void
setRevealBottomBars
(boolean reveal) Sets whether bottom bars are revealed for @self.void
setRevealTopBars
(boolean reveal) Sets whether top bars are revealed for @self.void
setTopBarStyle
(int style) Sets appearance of the top bars for @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, unsetStateFlags
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von 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, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
ToolbarView
-
ToolbarView
public ToolbarView()Creates a new `AdwToolbarView`.
-
-
Methodendetails
-
getClassHandler
-
addBottomBar
Adds a bottom bar to @self.- Parameter:
widget
- a widget
-
addTopBar
Adds a top bar to @self.- Parameter:
widget
- a widget
-
getBottomBarHeight
public int getBottomBarHeight()Gets the current bottom bar height for @self.
Bottom bar height does change depending on
[property@ToolbarView:reveal-bottom-bars], including during the transition.
See [method@ToolbarView.get_top_bar_height].- Gibt zurück:
- the current bottom bar height
-
getBottomBarStyle
public int getBottomBarStyle()Gets appearance of the bottom bars for @self.- Gibt zurück:
- bottom bar style
-
getContent
Gets the content widget for @self.- Gibt zurück:
- the content widget
-
getExtendContentToBottomEdge
public boolean getExtendContentToBottomEdge()Gets whether the content widget can extend behind bottom bars.- Gibt zurück:
- whether content extends behind bottom bars
-
getExtendContentToTopEdge
public boolean getExtendContentToTopEdge()Gets whether the content widget can extend behind top bars.- Gibt zurück:
- whether content extends behind top bars
-
getRevealBottomBars
public boolean getRevealBottomBars()Gets whether bottom bars are revealed for @self.- Gibt zurück:
- whether bottom bars are revealed
-
getRevealTopBars
public boolean getRevealTopBars()Gets whether top bars are revealed for @self.- Gibt zurück:
- whether top bars are revealed
-
getTopBarHeight
public int getTopBarHeight()Gets the current top bar height for @self.
Top bar height does change depending on
[property@ToolbarView:reveal-top-bars], including during the transition.
See [method@ToolbarView.get_bottom_bar_height].- Gibt zurück:
- the current top bar height
-
getTopBarStyle
public int getTopBarStyle()Gets appearance of the top bars for @self.- Gibt zurück:
- top bar style
-
remove
Removes a child from @self.- Parameter:
widget
- the child to be removed
-
setBottomBarStyle
public void setBottomBarStyle(int style) Sets appearance of the bottom bars for @self.
If set to `ADW_TOOLBAR_FLAT`, bottom bars are flat and scrolling content has
a subtle undershoot shadow when touching them, same as the
[`.undershoot-bottom`](style-classes.html#undershoot-indicators)
style class. This works well for simple content, e.g. [class@StatusPage] or
[class@PreferencesPage], where the background at the bottom of the page is
uniform. Additionally, windows with sidebars should always use this style.
Undershoot shadow is only present if a bottom bar is actually present and
visible. It is also never present if
[property@ToolbarView:extend-content-to-bottom-edge] is set to `TRUE`.
If set to `ADW_TOOLBAR_RAISED`, bottom bars have an opaque background and a
persistent shadow, this is suitable for content such as
[utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
where some elements are directly adjacent to the bottom bars, or
[class@TabView], where each page can have a different background.
`ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the
shadow is replaced with a more subtle border. This can be useful for
applications like image viewers.
See also [method@ToolbarView.set_top_bar_style].- Parameter:
style
- bottom bar style
-
setContent
Sets the content widget for @self.- Parameter:
content
- the content widget
-
setExtendContentToBottomEdge
public void setExtendContentToBottomEdge(boolean extend) Sets whether the content widget can extend behind bottom bars.
This can be used in combination with [property@ToolbarView:reveal-bottom-bars]
to show and hide toolbars in fullscreen.
See [method@ToolbarView.set_extend_content_to_top_edge].- Parameter:
extend
- whether content extends behind bottom bars
-
setExtendContentToTopEdge
public void setExtendContentToTopEdge(boolean extend) Sets whether the content widget can extend behind top bars.
This can be used in combination with [property@ToolbarView:reveal-top-bars]
to show and hide toolbars in fullscreen.
See [method@ToolbarView.set_extend_content_to_bottom_edge].- Parameter:
extend
- whether content extends behind top bars
-
setRevealBottomBars
public void setRevealBottomBars(boolean reveal) Sets whether bottom bars are revealed for @self.
The transition will be animated.
This can be used in combination with
[property@ToolbarView:extend-content-to-bottom-edge] to show and hide
toolbars in fullscreen.
See [method@ToolbarView.set_reveal_top_bars].- Parameter:
reveal
- whether to reveal bottom bars
-
setRevealTopBars
public void setRevealTopBars(boolean reveal) Sets whether top bars are revealed for @self.
The transition will be animated.
This can be used in combination with
[property@ToolbarView:extend-content-to-top-edge] to show and hide toolbars
in fullscreen.
See [method@ToolbarView.set_reveal_bottom_bars].- Parameter:
reveal
- whether to reveal top bars
-
setTopBarStyle
public void setTopBarStyle(int style) Sets appearance of the top bars for @self.
If set to `ADW_TOOLBAR_FLAT`, top bars are flat and scrolling content has a
subtle undershoot shadow when touching them, same as the
[`.undershoot-top`](style-classes.html#undershoot-indicators)
style class. This works well for simple content, e.g. [class@StatusPage] or
[class@PreferencesPage], where the background at the top of the page is
uniform. Additionally, windows with sidebars should always use this style.
Undershoot shadow is only present if a top bar is actually present and
visible. It is also never present if
[property@ToolbarView:extend-content-to-top-edge] is set to `TRUE`.
If set to `ADW_TOOLBAR_RAISED`, top bars have an opaque background and a
persistent shadow, this is suitable for content such as
[utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html),
where some elements are directly adjacent to the top bars, or
[class@TabView], where each page can have a different background.
`ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the
shadow is replaced with a more subtle border. This can be useful for
applications like image viewers.
See also [method@ToolbarView.set_bottom_bar_style].- Parameter:
style
- top bar style
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Setzt außer Kraft:
asAccessible
in KlasseWidget
- Gibt zurück:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Setzt außer Kraft:
asBuildable
in KlasseWidget
- Gibt zurück:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Setzt außer Kraft:
asConstraintTarget
in KlasseWidget
- Gibt zurück:
ConstraintTarget
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-