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 |
A tab bar for [classtabView
].
<picture> <source srcset="tab-bar-dark.png" media="(prefers-color-scheme: dark)"> <img src="tab-bar.png" alt="tab-bar"> </picture>
The AdwTabBar
widget is a tab bar that can be used with conjunction with
AdwTabView
.
AdwTabBar
can autohide and can optionally contain action widgets on both
sides of the tabs.
When there's not enough space to show all the tabs, AdwTabBar
will scroll
them. Pinned tabs always stay visible and aren't a part of the scrollable
area.
CSS nodes
AdwTabBar
has a single CSS node with name tabbar
.
Since: 1.0
Synopsis
- newtype TabBar = TabBar (ManagedPtr TabBar)
- class (GObject o, IsDescendantOf TabBar o) => IsTabBar o
- toTabBar :: (MonadIO m, IsTabBar o) => o -> m TabBar
- tabBarGetAutohide :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m Bool
- tabBarGetEndActionWidget :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m (Maybe Widget)
- tabBarGetExpandTabs :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m Bool
- tabBarGetInverted :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m Bool
- tabBarGetIsOverflowing :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m Bool
- tabBarGetStartActionWidget :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m (Maybe Widget)
- tabBarGetTabsRevealed :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m Bool
- tabBarGetView :: (HasCallStack, MonadIO m, IsTabBar a) => a -> m (Maybe TabView)
- tabBarNew :: (HasCallStack, MonadIO m) => m TabBar
- tabBarSetAutohide :: (HasCallStack, MonadIO m, IsTabBar a) => a -> Bool -> m ()
- tabBarSetEndActionWidget :: (HasCallStack, MonadIO m, IsTabBar a, IsWidget b) => a -> Maybe b -> m ()
- tabBarSetExpandTabs :: (HasCallStack, MonadIO m, IsTabBar a) => a -> Bool -> m ()
- tabBarSetInverted :: (HasCallStack, MonadIO m, IsTabBar a) => a -> Bool -> m ()
- tabBarSetStartActionWidget :: (HasCallStack, MonadIO m, IsTabBar a, IsWidget b) => a -> Maybe b -> m ()
- tabBarSetView :: (HasCallStack, MonadIO m, IsTabBar a, IsTabView b) => a -> Maybe b -> m ()
- tabBarSetupExtraDropTarget :: (HasCallStack, MonadIO m, IsTabBar a) => a -> [DragAction] -> Maybe [GType] -> m ()
- constructTabBarAutohide :: (IsTabBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTabBarAutohide :: (MonadIO m, IsTabBar o) => o -> m Bool
- setTabBarAutohide :: (MonadIO m, IsTabBar o) => o -> Bool -> m ()
- clearTabBarEndActionWidget :: (MonadIO m, IsTabBar o) => o -> m ()
- constructTabBarEndActionWidget :: (IsTabBar o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getTabBarEndActionWidget :: (MonadIO m, IsTabBar o) => o -> m (Maybe Widget)
- setTabBarEndActionWidget :: (MonadIO m, IsTabBar o, IsWidget a) => o -> a -> m ()
- constructTabBarExpandTabs :: (IsTabBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTabBarExpandTabs :: (MonadIO m, IsTabBar o) => o -> m Bool
- setTabBarExpandTabs :: (MonadIO m, IsTabBar o) => o -> Bool -> m ()
- constructTabBarInverted :: (IsTabBar o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTabBarInverted :: (MonadIO m, IsTabBar o) => o -> m Bool
- setTabBarInverted :: (MonadIO m, IsTabBar o) => o -> Bool -> m ()
- getTabBarIsOverflowing :: (MonadIO m, IsTabBar o) => o -> m Bool
- clearTabBarStartActionWidget :: (MonadIO m, IsTabBar o) => o -> m ()
- constructTabBarStartActionWidget :: (IsTabBar o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getTabBarStartActionWidget :: (MonadIO m, IsTabBar o) => o -> m (Maybe Widget)
- setTabBarStartActionWidget :: (MonadIO m, IsTabBar o, IsWidget a) => o -> a -> m ()
- getTabBarTabsRevealed :: (MonadIO m, IsTabBar o) => o -> m Bool
- clearTabBarView :: (MonadIO m, IsTabBar o) => o -> m ()
- constructTabBarView :: (IsTabBar o, MonadIO m, IsTabView a) => a -> m (GValueConstruct o)
- getTabBarView :: (MonadIO m, IsTabBar o) => o -> m (Maybe TabView)
- setTabBarView :: (MonadIO m, IsTabBar o, IsTabView a) => o -> a -> m ()
- type TabBarExtraDragDropCallback = TabPage -> GValue -> IO Bool
- afterTabBarExtraDragDrop :: (IsTabBar a, MonadIO m) => a -> ((?self :: a) => TabBarExtraDragDropCallback) -> m SignalHandlerId
- onTabBarExtraDragDrop :: (IsTabBar a, MonadIO m) => a -> ((?self :: a) => TabBarExtraDragDropCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq TabBar Source # | |
GObject TabBar Source # | |
Defined in GI.Adw.Objects.TabBar | |
ManagedPtrNewtype TabBar Source # | |
Defined in GI.Adw.Objects.TabBar toManagedPtr :: TabBar -> ManagedPtr TabBar | |
TypedObject TabBar Source # | |
Defined in GI.Adw.Objects.TabBar | |
HasParentTypes TabBar Source # | |
Defined in GI.Adw.Objects.TabBar | |
IsGValue (Maybe TabBar) Source # | Convert |
Defined in GI.Adw.Objects.TabBar gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TabBar -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TabBar) | |
type ParentTypes TabBar Source # | |
Defined in GI.Adw.Objects.TabBar type ParentTypes TabBar = '[Widget, Object, Accessible, Buildable, ConstraintTarget] |
class (GObject o, IsDescendantOf TabBar o) => IsTabBar o Source #
Instances
(GObject o, IsDescendantOf TabBar o) => IsTabBar o Source # | |
Defined in GI.Adw.Objects.TabBar |
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, setupExtraDropTarget, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAutohide, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getEndActionWidget, getExpandTabs, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getInverted, getIsOverflowing, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStartActionWidget, getStateFlags, getStyleContext, getTabsRevealed, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getView, getVisible, getWidth.
Setters
setAutohide, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setEndActionWidget, setExpandTabs, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setInverted, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStartActionWidget, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setView, setVisible.
getAutohide
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m Bool | Returns: whether the tabs automatically hide |
Gets whether the tabs automatically hide.
Since: 1.0
getEndActionWidget
tabBarGetEndActionWidget Source #
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the widget shown after the tabs |
Gets the widget shown after the tabs.
Since: 1.0
getExpandTabs
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m Bool | Returns: whether tabs expand to full width. |
Gets whether tabs expand to full width.
Since: 1.0
getInverted
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m Bool | Returns: whether tabs use inverted layout |
Gets whether tabs use inverted layout.
Since: 1.0
getIsOverflowing
tabBarGetIsOverflowing Source #
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
is overflowing.
Since: 1.0
getStartActionWidget
tabBarGetStartActionWidget Source #
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the widget shown before the tabs |
Gets the widget shown before the tabs.
Since: 1.0
getTabsRevealed
tabBarGetTabsRevealed Source #
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m Bool | Returns: whether the tabs are currently revealed |
Gets whether the tabs are currently revealed.
Since: 1.0
getView
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> m (Maybe TabView) | Returns: the view |
Gets the tab view self
controls.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m TabBar | Returns: the newly created |
Creates a new AdwTabBar
.
Since: 1.0
setAutohide
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the tabs automatically hide.
Since: 1.0
setEndActionWidget
tabBarSetEndActionWidget Source #
:: (HasCallStack, MonadIO m, IsTabBar a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the widget to show after the tabs.
Since: 1.0
setExpandTabs
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether tabs expand to full width.
Since: 1.0
setInverted
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether tabs tabs use inverted layout.
Since: 1.0
setStartActionWidget
tabBarSetStartActionWidget Source #
:: (HasCallStack, MonadIO m, IsTabBar a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the widget to show before the tabs.
Since: 1.0
setView
:: (HasCallStack, MonadIO m, IsTabBar a, IsTabView b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the tab view self
controls.
Since: 1.0
setupExtraDropTarget
tabBarSetupExtraDropTarget Source #
:: (HasCallStack, MonadIO m, IsTabBar a) | |
=> a |
|
-> [DragAction] |
|
-> Maybe [GType] |
|
-> m () |
Sets the supported types for this drop target.
Sets up an extra drop target on tabs.
This allows to drag arbitrary content onto tabs, for example URLs in a web browser.
If a tab is hovered for a certain period of time while dragging the content, it will be automatically selected.
The signaltabBar
[extraDragDrop] signal can be used to handle the drop.
Since: 1.0
Properties
autohide
Whether the tabs automatically hide.
If set to TRUE
, the tab bar disappears when [propertytabBar
:view] has 0
or 1 tab, no pinned tabs, and no tab is being transferred.
See [propertytabBar
:tabs-revealed].
Since: 1.0
constructTabBarAutohide :: (IsTabBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “autohide
” property. This is rarely needed directly, but it is used by new
.
getTabBarAutohide :: (MonadIO m, IsTabBar o) => o -> m Bool Source #
Get the value of the “autohide
” property.
When overloading is enabled, this is equivalent to
get
tabBar #autohide
setTabBarAutohide :: (MonadIO m, IsTabBar o) => o -> Bool -> m () Source #
Set the value of the “autohide
” property.
When overloading is enabled, this is equivalent to
set
tabBar [ #autohide:=
value ]
endActionWidget
The widget shown after the tabs.
Since: 1.0
clearTabBarEndActionWidget :: (MonadIO m, IsTabBar o) => o -> m () Source #
Set the value of the “end-action-widget
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#endActionWidget
constructTabBarEndActionWidget :: (IsTabBar o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “end-action-widget
” property. This is rarely needed directly, but it is used by new
.
getTabBarEndActionWidget :: (MonadIO m, IsTabBar o) => o -> m (Maybe Widget) Source #
Get the value of the “end-action-widget
” property.
When overloading is enabled, this is equivalent to
get
tabBar #endActionWidget
setTabBarEndActionWidget :: (MonadIO m, IsTabBar o, IsWidget a) => o -> a -> m () Source #
Set the value of the “end-action-widget
” property.
When overloading is enabled, this is equivalent to
set
tabBar [ #endActionWidget:=
value ]
expandTabs
Whether tabs expand to full width.
If set to TRUE
, the tabs will always vary width filling the whole width
when possible, otherwise tabs will always have the minimum possible size.
Since: 1.0
constructTabBarExpandTabs :: (IsTabBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “expand-tabs
” property. This is rarely needed directly, but it is used by new
.
getTabBarExpandTabs :: (MonadIO m, IsTabBar o) => o -> m Bool Source #
Get the value of the “expand-tabs
” property.
When overloading is enabled, this is equivalent to
get
tabBar #expandTabs
setTabBarExpandTabs :: (MonadIO m, IsTabBar o) => o -> Bool -> m () Source #
Set the value of the “expand-tabs
” property.
When overloading is enabled, this is equivalent to
set
tabBar [ #expandTabs:=
value ]
inverted
Whether tabs use inverted layout.
If set to TRUE
, non-pinned tabs will have the close button at the
beginning and the indicator at the end rather than the opposite.
Since: 1.0
constructTabBarInverted :: (IsTabBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “inverted
” property. This is rarely needed directly, but it is used by new
.
getTabBarInverted :: (MonadIO m, IsTabBar o) => o -> m Bool Source #
Get the value of the “inverted
” property.
When overloading is enabled, this is equivalent to
get
tabBar #inverted
setTabBarInverted :: (MonadIO m, IsTabBar o) => o -> Bool -> m () Source #
Set the value of the “inverted
” property.
When overloading is enabled, this is equivalent to
set
tabBar [ #inverted:=
value ]
isOverflowing
Whether the tab bar is overflowing.
If TRUE
, all tabs cannot be displayed at once and require scrolling.
Since: 1.0
getTabBarIsOverflowing :: (MonadIO m, IsTabBar o) => o -> m Bool Source #
Get the value of the “is-overflowing
” property.
When overloading is enabled, this is equivalent to
get
tabBar #isOverflowing
startActionWidget
The widget shown before the tabs.
Since: 1.0
clearTabBarStartActionWidget :: (MonadIO m, IsTabBar o) => o -> m () Source #
Set the value of the “start-action-widget
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#startActionWidget
constructTabBarStartActionWidget :: (IsTabBar o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “start-action-widget
” property. This is rarely needed directly, but it is used by new
.
getTabBarStartActionWidget :: (MonadIO m, IsTabBar o) => o -> m (Maybe Widget) Source #
Get the value of the “start-action-widget
” property.
When overloading is enabled, this is equivalent to
get
tabBar #startActionWidget
setTabBarStartActionWidget :: (MonadIO m, IsTabBar o, IsWidget a) => o -> a -> m () Source #
Set the value of the “start-action-widget
” property.
When overloading is enabled, this is equivalent to
set
tabBar [ #startActionWidget:=
value ]
tabsRevealed
Whether the tabs are currently revealed.
See [propertytabBar
:autohide].
Since: 1.0
getTabBarTabsRevealed :: (MonadIO m, IsTabBar o) => o -> m Bool Source #
Get the value of the “tabs-revealed
” property.
When overloading is enabled, this is equivalent to
get
tabBar #tabsRevealed
view
The tab view the tab bar controls.
Since: 1.0
clearTabBarView :: (MonadIO m, IsTabBar o) => o -> m () Source #
Set the value of the “view
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#view
constructTabBarView :: (IsTabBar o, MonadIO m, IsTabView a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “view
” property. This is rarely needed directly, but it is used by new
.
getTabBarView :: (MonadIO m, IsTabBar o) => o -> m (Maybe TabView) Source #
Get the value of the “view
” property.
When overloading is enabled, this is equivalent to
get
tabBar #view
setTabBarView :: (MonadIO m, IsTabBar o, IsTabView a) => o -> a -> m () Source #
Set the value of the “view
” property.
When overloading is enabled, this is equivalent to
set
tabBar [ #view:=
value ]
Signals
extraDragDrop
type TabBarExtraDragDropCallback Source #
= TabPage |
|
-> GValue |
|
-> IO Bool | Returns: whether the drop was accepted for |
This signal is emitted when content is dropped onto a tab.
The content must be of one of the types set up via
[methodtabBar
.setup_extra_drop_target].
See DropTarget::drop.
Since: 1.0
afterTabBarExtraDragDrop :: (IsTabBar a, MonadIO m) => a -> ((?self :: a) => TabBarExtraDragDropCallback) -> m SignalHandlerId Source #
Connect a signal handler for the extraDragDrop signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabBar #extraDragDrop callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTabBarExtraDragDrop :: (IsTabBar a, MonadIO m) => a -> ((?self :: a) => TabBarExtraDragDropCallback) -> m SignalHandlerId Source #
Connect a signal handler for the extraDragDrop signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabBar #extraDragDrop callback