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 |
- Exported types
- Methods
- addPage
- addShortcuts
- append
- appendPinned
- closeOtherPages
- closePage
- closePageFinish
- closePagesAfter
- closePagesBefore
- getDefaultIcon
- getIsTransferringPage
- getMenuModel
- getNPages
- getNPinnedPages
- getNthPage
- getPage
- getPagePosition
- getPages
- getSelectedPage
- getShortcuts
- insert
- insertPinned
- invalidateThumbnails
- new
- prepend
- prependPinned
- removeShortcuts
- reorderBackward
- reorderFirst
- reorderForward
- reorderLast
- reorderPage
- selectNextPage
- selectPreviousPage
- setDefaultIcon
- setMenuModel
- setPagePinned
- setSelectedPage
- setShortcuts
- transferPage
- Properties
- Signals
A dynamic tabbed container.
AdwTabView
is a container which shows one child at a time. While it
provides keyboard shortcuts for switching between pages, it does not provide
a visible tab switcher and relies on external widgets for that, such as
[classtabBar
], [classtabOverview
] and [classtabButton
].
AdwTabView
maintains a [classtabPage
] object for each page, which holds
additional per-page properties. You can obtain the AdwTabPage
for a page
with [methodtabView
.get_page], and as the return value for
[methodtabView
.append] and other functions for adding children.
AdwTabView
only aims to be useful for dynamic tabs in multi-window
document-based applications, such as web browsers, file managers, text
editors or terminals. It does not aim to replace Notebook
for use
cases such as tabbed dialogs.
As such, it does not support disabling page reordering or detaching.
AdwTabView
adds a number of global page switching and reordering shortcuts.
The [propertytabView
:shortcuts] property can be used to manage them.
See [flagstabViewShortcuts
] for the list of the available shortcuts. All of
the shortcuts are enabled by default.
- method
tabView
.add_shortcuts - and [method
tabView
.remove_shortcuts] can be used to manage shortcuts in a convenient way, for example:
c code
adw_tab_view_remove_shortcuts (view, ADW_TAB_VIEW_SHORTCUT_CONTROL_HOME | ADW_TAB_VIEW_SHORTCUT_CONTROL_END);
CSS nodes
AdwTabView
has a main CSS node with the name tabview
.
Accessibility
AdwTabView
uses the GTK_ACCESSIBLE_ROLE_TAB_PANEL
for the tab pages which
are the accessible parent objects of the child widgets.
Synopsis
- newtype TabView = TabView (ManagedPtr TabView)
- class (GObject o, IsDescendantOf TabView o) => IsTabView o
- toTabView :: (MonadIO m, IsTabView o) => o -> m TabView
- tabViewAddPage :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b, IsTabPage c) => a -> b -> Maybe c -> m TabPage
- tabViewAddShortcuts :: (HasCallStack, MonadIO m, IsTabView a) => a -> [TabViewShortcuts] -> m ()
- tabViewAppend :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> m TabPage
- tabViewAppendPinned :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> m TabPage
- tabViewCloseOtherPages :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m ()
- tabViewClosePage :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m ()
- tabViewClosePageFinish :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> Bool -> m ()
- tabViewClosePagesAfter :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m ()
- tabViewClosePagesBefore :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m ()
- tabViewGetDefaultIcon :: (HasCallStack, MonadIO m, IsTabView a) => a -> m Icon
- tabViewGetIsTransferringPage :: (HasCallStack, MonadIO m, IsTabView a) => a -> m Bool
- tabViewGetMenuModel :: (HasCallStack, MonadIO m, IsTabView a) => a -> m (Maybe MenuModel)
- tabViewGetNPages :: (HasCallStack, MonadIO m, IsTabView a) => a -> m Int32
- tabViewGetNPinnedPages :: (HasCallStack, MonadIO m, IsTabView a) => a -> m Int32
- tabViewGetNthPage :: (HasCallStack, MonadIO m, IsTabView a) => a -> Int32 -> m TabPage
- tabViewGetPage :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> m TabPage
- tabViewGetPagePosition :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m Int32
- tabViewGetPages :: (HasCallStack, MonadIO m, IsTabView a) => a -> m SelectionModel
- tabViewGetSelectedPage :: (HasCallStack, MonadIO m, IsTabView a) => a -> m (Maybe TabPage)
- tabViewGetShortcuts :: (HasCallStack, MonadIO m, IsTabView a) => a -> m [TabViewShortcuts]
- tabViewInsert :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> Int32 -> m TabPage
- tabViewInsertPinned :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> Int32 -> m TabPage
- tabViewInvalidateThumbnails :: (HasCallStack, MonadIO m, IsTabView a) => a -> m ()
- tabViewNew :: (HasCallStack, MonadIO m) => m TabView
- tabViewPrepend :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> m TabPage
- tabViewPrependPinned :: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) => a -> b -> m TabPage
- tabViewRemoveShortcuts :: (HasCallStack, MonadIO m, IsTabView a) => a -> [TabViewShortcuts] -> m ()
- tabViewReorderBackward :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m Bool
- tabViewReorderFirst :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m Bool
- tabViewReorderForward :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m Bool
- tabViewReorderLast :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m Bool
- tabViewReorderPage :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> Int32 -> m Bool
- tabViewSelectNextPage :: (HasCallStack, MonadIO m, IsTabView a) => a -> m Bool
- tabViewSelectPreviousPage :: (HasCallStack, MonadIO m, IsTabView a) => a -> m Bool
- tabViewSetDefaultIcon :: (HasCallStack, MonadIO m, IsTabView a, IsIcon b) => a -> b -> m ()
- tabViewSetMenuModel :: (HasCallStack, MonadIO m, IsTabView a, IsMenuModel b) => a -> Maybe b -> m ()
- tabViewSetPagePinned :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> Bool -> m ()
- tabViewSetSelectedPage :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) => a -> b -> m ()
- tabViewSetShortcuts :: (HasCallStack, MonadIO m, IsTabView a) => a -> [TabViewShortcuts] -> m ()
- tabViewTransferPage :: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b, IsTabView c) => a -> b -> c -> Int32 -> m ()
- constructTabViewDefaultIcon :: (IsTabView o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o)
- getTabViewDefaultIcon :: (MonadIO m, IsTabView o) => o -> m Icon
- setTabViewDefaultIcon :: (MonadIO m, IsTabView o, IsIcon a) => o -> a -> m ()
- getTabViewIsTransferringPage :: (MonadIO m, IsTabView o) => o -> m Bool
- clearTabViewMenuModel :: (MonadIO m, IsTabView o) => o -> m ()
- constructTabViewMenuModel :: (IsTabView o, MonadIO m, IsMenuModel a) => a -> m (GValueConstruct o)
- getTabViewMenuModel :: (MonadIO m, IsTabView o) => o -> m (Maybe MenuModel)
- setTabViewMenuModel :: (MonadIO m, IsTabView o, IsMenuModel a) => o -> a -> m ()
- getTabViewNPages :: (MonadIO m, IsTabView o) => o -> m Int32
- getTabViewNPinnedPages :: (MonadIO m, IsTabView o) => o -> m Int32
- getTabViewPages :: (MonadIO m, IsTabView o) => o -> m (Maybe SelectionModel)
- constructTabViewSelectedPage :: (IsTabView o, MonadIO m, IsTabPage a) => a -> m (GValueConstruct o)
- getTabViewSelectedPage :: (MonadIO m, IsTabView o) => o -> m (Maybe TabPage)
- setTabViewSelectedPage :: (MonadIO m, IsTabView o, IsTabPage a) => o -> a -> m ()
- constructTabViewShortcuts :: (IsTabView o, MonadIO m) => [TabViewShortcuts] -> m (GValueConstruct o)
- getTabViewShortcuts :: (MonadIO m, IsTabView o) => o -> m [TabViewShortcuts]
- setTabViewShortcuts :: (MonadIO m, IsTabView o) => o -> [TabViewShortcuts] -> m ()
- type TabViewClosePageCallback = TabPage -> IO Bool
- afterTabViewClosePage :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewClosePageCallback) -> m SignalHandlerId
- onTabViewClosePage :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewClosePageCallback) -> m SignalHandlerId
- type TabViewCreateWindowCallback = IO (Maybe TabView)
- afterTabViewCreateWindow :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewCreateWindowCallback) -> m SignalHandlerId
- onTabViewCreateWindow :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewCreateWindowCallback) -> m SignalHandlerId
- type TabViewIndicatorActivatedCallback = TabPage -> IO ()
- afterTabViewIndicatorActivated :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewIndicatorActivatedCallback) -> m SignalHandlerId
- onTabViewIndicatorActivated :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewIndicatorActivatedCallback) -> m SignalHandlerId
- type TabViewPageAttachedCallback = TabPage -> Int32 -> IO ()
- afterTabViewPageAttached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageAttachedCallback) -> m SignalHandlerId
- onTabViewPageAttached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageAttachedCallback) -> m SignalHandlerId
- type TabViewPageDetachedCallback = TabPage -> Int32 -> IO ()
- afterTabViewPageDetached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageDetachedCallback) -> m SignalHandlerId
- onTabViewPageDetached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageDetachedCallback) -> m SignalHandlerId
- type TabViewPageReorderedCallback = TabPage -> Int32 -> IO ()
- afterTabViewPageReordered :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageReorderedCallback) -> m SignalHandlerId
- onTabViewPageReordered :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageReorderedCallback) -> m SignalHandlerId
- type TabViewSetupMenuCallback = Maybe TabPage -> IO ()
- afterTabViewSetupMenu :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewSetupMenuCallback) -> m SignalHandlerId
- onTabViewSetupMenu :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewSetupMenuCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq TabView Source # | |
GObject TabView Source # | |
Defined in GI.Adw.Objects.TabView | |
ManagedPtrNewtype TabView Source # | |
Defined in GI.Adw.Objects.TabView toManagedPtr :: TabView -> ManagedPtr TabView | |
TypedObject TabView Source # | |
Defined in GI.Adw.Objects.TabView | |
HasParentTypes TabView Source # | |
Defined in GI.Adw.Objects.TabView | |
IsGValue (Maybe TabView) Source # | Convert |
Defined in GI.Adw.Objects.TabView gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TabView -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TabView) | |
type ParentTypes TabView Source # | |
Defined in GI.Adw.Objects.TabView type ParentTypes TabView = '[Widget, Object, Accessible, Buildable, ConstraintTarget] |
class (GObject o, IsDescendantOf TabView o) => IsTabView o Source #
Instances
(GObject o, IsDescendantOf TabView o) => IsTabView o Source # | |
Defined in GI.Adw.Objects.TabView |
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addPage, addShortcuts, addTickCallback, allocate, append, appendPinned, bindProperty, bindPropertyFull, childFocus, closeOtherPages, closePage, closePageFinish, closePagesAfter, closePagesBefore, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insert, insertActionGroup, insertAfter, insertBefore, insertPinned, invalidateThumbnails, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, prepend, prependPinned, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeShortcuts, removeTickCallback, reorderBackward, reorderFirst, reorderForward, reorderLast, reorderPage, resetProperty, resetRelation, resetState, runDispose, selectNextPage, selectPreviousPage, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, transferPage, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDefaultIcon, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIsTransferringPage, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMenuModel, getNPages, getNPinnedPages, getName, getNative, getNextAccessibleSibling, getNextSibling, getNthPage, getOpacity, getOverflow, getPage, getPagePosition, getPages, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSelectedPage, getSensitive, getSettings, getShortcuts, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDefaultIcon, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMenuModel, setName, setOpacity, setOverflow, setPagePinned, setParent, setProperty, setReceivesDefault, setSelectedPage, setSensitive, setShortcuts, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
addPage
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b, IsTabPage c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> m TabPage | Returns: the page object representing |
Adds child
to self
with parent
as the parent.
This function can be used to automatically position new pages, and to select
the correct page when this page is closed while being selected (see
[methodtabView
.close_page]).
If parent
is NULL
, this function is equivalent to [methodtabView
.append].
addShortcuts
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> [TabViewShortcuts] |
|
-> m () |
Adds shortcuts
for self
.
See [propertytabView
:shortcuts] for details.
Since: 1.2
append
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> m TabPage | Returns: the page object representing |
Inserts child
as the last non-pinned page.
appendPinned
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> m TabPage | Returns: the page object representing |
Inserts child
as the last pinned page.
closeOtherPages
tabViewCloseOtherPages Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m () |
Requests to close all pages other than page
.
closePage
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m () |
Requests to close page
.
Calling this function will result in the signaltabView
[closePage] signal
being emitted for page
. Closing the page can then be confirmed or
denied via [methodtabView
.close_page_finish].
If the page is waiting for a [methodtabView
.close_page_finish] call, this
function will do nothing.
The default handler for signaltabView
[closePage] will immediately confirm
closing the page if it's non-pinned, or reject it if it's pinned. This
behavior can be changed by registering your own handler for that signal.
If page
was selected, another page will be selected instead:
If the [propertytabPage
:parent] value is NULL
, the next page will be
selected when possible, or if the page was already last, the previous page
will be selected instead.
If it's not NULL
, the previous page will be selected if it's a descendant
(possibly indirect) of the parent. If both the previous page and the parent
are pinned, the parent will be selected instead.
closePageFinish
tabViewClosePageFinish Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> m () |
Completes a [methodtabView
.close_page] call for page
.
If confirm
is TRUE
, page
will be closed. If it's FALSE
, it will be
reverted to its previous state and [methodtabView
.close_page] can be called
for it again.
This function should not be called unless a custom handler for
signaltabView
[closePage] is used.
closePagesAfter
tabViewClosePagesAfter Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m () |
Requests to close all pages after page
.
closePagesBefore
tabViewClosePagesBefore Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m () |
Requests to close all pages before page
.
getDefaultIcon
tabViewGetDefaultIcon Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m Icon | Returns: the default icon of |
Gets the default icon of self
.
getIsTransferringPage
tabViewGetIsTransferringPage Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m Bool | Returns: whether a page is being transferred |
Whether a page is being transferred.
The corresponding property will be set to TRUE
when a drag-n-drop tab
transfer starts on any AdwTabView
, and to FALSE
after it ends.
During the transfer, children cannot receive pointer input and a tab can be safely dropped on the tab view.
getMenuModel
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m (Maybe MenuModel) | Returns: the tab context menu model for |
Gets the tab context menu model for self
.
getNPages
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m Int32 | Returns: the number of pages in |
Gets the number of pages in self
.
getNPinnedPages
tabViewGetNPinnedPages Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m Int32 | Returns: the number of pinned pages in |
Gets the number of pinned pages in self
.
See [methodtabView
.set_page_pinned].
getNthPage
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> Int32 |
|
-> m TabPage | Returns: the page object at |
Gets the [classtabPage
] representing the child at position
.
getPage
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> m TabPage | Returns: the page object for |
Gets the [classtabPage
] object representing child
.
getPagePosition
tabViewGetPagePosition Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m Int32 | Returns: the position of |
Finds the position of page
in self
, starting from 0.
getPages
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m SelectionModel | Returns: a |
Returns a ListModel
that contains the pages of self
.
This can be used to keep an up-to-date view. The model also implements
SelectionModel
and can be used to track and change the selected
page.
getSelectedPage
tabViewGetSelectedPage Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m (Maybe TabPage) | Returns: the selected page |
Gets the currently selected page in self
.
getShortcuts
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m [TabViewShortcuts] | Returns: the shortcut mask |
Gets the enabled shortcuts for self
.
Since: 1.2
insert
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m TabPage | Returns: the page object representing |
Inserts a non-pinned page at position
.
It's an error to try to insert a page before a pinned page, in that case
[methodtabView
.insert_pinned] should be used instead.
insertPinned
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m TabPage | Returns: the page object representing |
Inserts a pinned page at position
.
It's an error to try to insert a pinned page after a non-pinned page, in
that case [methodtabView
.insert] should be used instead.
invalidateThumbnails
tabViewInvalidateThumbnails Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m () |
Invalidates thumbnails for all pages in self
.
This is a convenience method, equivalent to calling
[methodtabPage
.invalidate_thumbnail] on each page.
Since: 1.3
new
:: (HasCallStack, MonadIO m) | |
=> m TabView | Returns: the newly created |
Creates a new AdwTabView
.
prepend
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> m TabPage | Returns: the page object representing |
Inserts child
as the first non-pinned page.
prependPinned
:: (HasCallStack, MonadIO m, IsTabView a, IsWidget b) | |
=> a |
|
-> b |
|
-> m TabPage | Returns: the page object representing |
Inserts child
as the first pinned page.
removeShortcuts
tabViewRemoveShortcuts Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> [TabViewShortcuts] |
|
-> m () |
Removes shortcuts
from self
.
See [propertytabView
:shortcuts] for details.
Since: 1.2
reorderBackward
tabViewReorderBackward Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Reorders page
to before its previous page if possible.
reorderFirst
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Reorders page
to the first possible position.
reorderForward
tabViewReorderForward Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Reorders page
to after its next page if possible.
reorderLast
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Reorders page
to the last possible position.
reorderPage
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m Bool | Returns: whether |
Reorders page
to position
.
It's a programmer error to try to reorder a pinned page after a non-pinned one, or a non-pinned page before a pinned one.
selectNextPage
tabViewSelectNextPage Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m Bool | Returns: whether the selected page was changed |
Selects the page after the currently selected page.
If the last page was already selected, this function does nothing.
selectPreviousPage
tabViewSelectPreviousPage Source #
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> m Bool | Returns: whether the selected page was changed |
Selects the page before the currently selected page.
If the first page was already selected, this function does nothing.
setDefaultIcon
tabViewSetDefaultIcon Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsIcon b) | |
=> a |
|
-> b |
|
-> m () |
Sets the default page icon for self
.
If a page doesn't provide its own icon via [propertytabPage
:icon], a default
icon may be used instead for contexts where having an icon is necessary.
- class
tabBar
- will use default icon for pinned tabs in case the page is not loading, doesn't have an icon and an indicator. Default icon is never used for tabs that aren't pinned.
- class
tabOverview
- will use default icon for pages with missing thumbnails.
By default, the adw-tab-icon-missing-symbolic
icon is used.
setMenuModel
:: (HasCallStack, MonadIO m, IsTabView a, IsMenuModel b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the tab context menu model for self
.
When a context menu is shown for a tab, it will be constructed from the
provided menu model. Use the signaltabView
[setupMenu] signal to set up
the menu actions for the particular tab.
setPagePinned
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> m () |
Pins or unpins page
.
Pinned pages are guaranteed to be placed before all non-pinned pages; at any
given moment the first [propertytabView
:n-pinned-pages] pages in self
are
guaranteed to be pinned.
When a page is pinned or unpinned, it's automatically reordered: pinning a page moves it after other pinned pages; unpinning a page moves it before other non-pinned pages.
Pinned pages can still be reordered between each other.
- class
tabBar
- will display pinned pages in a compact form, never showing the title or close button, and only showing a single icon, selected in the following order:
- [property
tabPage
:indicator-icon] - A spinner if [property
tabPage
:loading] isTRUE
- [property
tabPage
:icon] - [property
tabView
:default-icon]
- class
tabOverview
- will not show a thumbnail for pinned pages, and replace
the close button with an unpin button. Unlike
AdwTabBar
, it will still display the page's title, icon and indicator separately.
Pinned pages cannot be closed by default, see signaltabView
[closePage]
for how to override that behavior.
Changes the value of the [propertytabPage
:pinned] property.
setSelectedPage
tabViewSetSelectedPage Source #
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b) | |
=> a |
|
-> b |
|
-> m () |
Sets the currently selected page in self
.
setShortcuts
:: (HasCallStack, MonadIO m, IsTabView a) | |
=> a |
|
-> [TabViewShortcuts] |
|
-> m () |
Sets the enabled shortcuts for self
.
See [flagstabViewShortcuts
] for the list of the available shortcuts. All of
the shortcuts are enabled by default.
- method
tabView
.add_shortcuts - and [method
tabView
.remove_shortcuts] provide a convenient way to manage individual shortcuts.
Since: 1.2
transferPage
:: (HasCallStack, MonadIO m, IsTabView a, IsTabPage b, IsTabView c) | |
=> a |
|
-> b |
|
-> c |
|
-> Int32 |
|
-> m () |
Transfers page
from self
to otherView
.
The page
object will be reused.
It's a programmer error to try to insert a pinned page after a non-pinned one, or a non-pinned page before a pinned one.
Properties
defaultIcon
Default page icon.
If a page doesn't provide its own icon via [propertytabPage
:icon], a
default icon may be used instead for contexts where having an icon is
necessary.
- class
tabBar
- will use default icon for pinned tabs in case the page is not loading, doesn't have an icon and an indicator. Default icon is never used for tabs that aren't pinned.
- class
tabOverview
- will use default icon for pages with missing thumbnails.
By default, the adw-tab-icon-missing-symbolic
icon is used.
constructTabViewDefaultIcon :: (IsTabView o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “default-icon
” property. This is rarely needed directly, but it is used by new
.
getTabViewDefaultIcon :: (MonadIO m, IsTabView o) => o -> m Icon Source #
Get the value of the “default-icon
” property.
When overloading is enabled, this is equivalent to
get
tabView #defaultIcon
setTabViewDefaultIcon :: (MonadIO m, IsTabView o, IsIcon a) => o -> a -> m () Source #
Set the value of the “default-icon
” property.
When overloading is enabled, this is equivalent to
set
tabView [ #defaultIcon:=
value ]
isTransferringPage
Whether a page is being transferred.
This property will be set to TRUE
when a drag-n-drop tab transfer starts
on any AdwTabView
, and to FALSE
after it ends.
During the transfer, children cannot receive pointer input and a tab can be safely dropped on the tab view.
getTabViewIsTransferringPage :: (MonadIO m, IsTabView o) => o -> m Bool Source #
Get the value of the “is-transferring-page
” property.
When overloading is enabled, this is equivalent to
get
tabView #isTransferringPage
menuModel
Tab context menu model.
When a context menu is shown for a tab, it will be constructed from the
provided menu model. Use the signaltabView
[setupMenu] signal to set up
the menu actions for the particular tab.
clearTabViewMenuModel :: (MonadIO m, IsTabView o) => o -> m () Source #
Set the value of the “menu-model
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#menuModel
constructTabViewMenuModel :: (IsTabView o, MonadIO m, IsMenuModel a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “menu-model
” property. This is rarely needed directly, but it is used by new
.
getTabViewMenuModel :: (MonadIO m, IsTabView o) => o -> m (Maybe MenuModel) Source #
Get the value of the “menu-model
” property.
When overloading is enabled, this is equivalent to
get
tabView #menuModel
setTabViewMenuModel :: (MonadIO m, IsTabView o, IsMenuModel a) => o -> a -> m () Source #
Set the value of the “menu-model
” property.
When overloading is enabled, this is equivalent to
set
tabView [ #menuModel:=
value ]
nPages
The number of pages in the tab view.
getTabViewNPages :: (MonadIO m, IsTabView o) => o -> m Int32 Source #
Get the value of the “n-pages
” property.
When overloading is enabled, this is equivalent to
get
tabView #nPages
nPinnedPages
The number of pinned pages in the tab view.
See [methodtabView
.set_page_pinned].
getTabViewNPinnedPages :: (MonadIO m, IsTabView o) => o -> m Int32 Source #
Get the value of the “n-pinned-pages
” property.
When overloading is enabled, this is equivalent to
get
tabView #nPinnedPages
pages
A selection model with the tab view's pages.
This can be used to keep an up-to-date view. The model also implements
SelectionModel
and can be used to track and change the selected
page.
getTabViewPages :: (MonadIO m, IsTabView o) => o -> m (Maybe SelectionModel) Source #
Get the value of the “pages
” property.
When overloading is enabled, this is equivalent to
get
tabView #pages
selectedPage
The currently selected page.
constructTabViewSelectedPage :: (IsTabView o, MonadIO m, IsTabPage a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “selected-page
” property. This is rarely needed directly, but it is used by new
.
getTabViewSelectedPage :: (MonadIO m, IsTabView o) => o -> m (Maybe TabPage) Source #
Get the value of the “selected-page
” property.
When overloading is enabled, this is equivalent to
get
tabView #selectedPage
setTabViewSelectedPage :: (MonadIO m, IsTabView o, IsTabPage a) => o -> a -> m () Source #
Set the value of the “selected-page
” property.
When overloading is enabled, this is equivalent to
set
tabView [ #selectedPage:=
value ]
shortcuts
The enabled shortcuts.
See [flagstabViewShortcuts
] for the list of the available shortcuts. All
of the shortcuts are enabled by default.
- method
tabView
.add_shortcuts - and [method
tabView
.remove_shortcuts] provide a convenient way to manage individual shortcuts.
Since: 1.2
constructTabViewShortcuts :: (IsTabView o, MonadIO m) => [TabViewShortcuts] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “shortcuts
” property. This is rarely needed directly, but it is used by new
.
getTabViewShortcuts :: (MonadIO m, IsTabView o) => o -> m [TabViewShortcuts] Source #
Get the value of the “shortcuts
” property.
When overloading is enabled, this is equivalent to
get
tabView #shortcuts
setTabViewShortcuts :: (MonadIO m, IsTabView o) => o -> [TabViewShortcuts] -> m () Source #
Set the value of the “shortcuts
” property.
When overloading is enabled, this is equivalent to
set
tabView [ #shortcuts:=
value ]
Signals
closePage
type TabViewClosePageCallback Source #
Emitted after [methodtabView
.close_page] has been called for page
.
The handler is expected to call [methodtabView
.close_page_finish] to
confirm or reject the closing.
The default handler will immediately confirm closing for non-pinned pages, or reject it for pinned pages, equivalent to the following example:
c code
static gboolean close_page_cb (AdwTabView *view, AdwTabPage *page, gpointer user_data) { adw_tab_view_close_page_finish (view, page, !adw_tab_page_get_pinned (page)); return GDK_EVENT_STOP; }
The [methodtabView
.close_page_finish] call doesn't have to happen inside
the handler, so can be used to do asynchronous checks before confirming the
closing.
A typical reason to connect to this signal is to show a confirmation dialog for closing a tab.
afterTabViewClosePage :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewClosePageCallback) -> m SignalHandlerId Source #
Connect a signal handler for the closePage signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #closePage 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.
onTabViewClosePage :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewClosePageCallback) -> m SignalHandlerId Source #
Connect a signal handler for the closePage signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #closePage callback
createWindow
type TabViewCreateWindowCallback Source #
Emitted when a tab should be transferred into a new window.
This can happen after a tab has been dropped on desktop.
The signal handler is expected to create a new window, position it as
needed and return its AdwTabView
that the page will be transferred into.
afterTabViewCreateWindow :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewCreateWindowCallback) -> m SignalHandlerId Source #
Connect a signal handler for the createWindow signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #createWindow 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.
onTabViewCreateWindow :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewCreateWindowCallback) -> m SignalHandlerId Source #
Connect a signal handler for the createWindow signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #createWindow callback
indicatorActivated
type TabViewIndicatorActivatedCallback Source #
Emitted after the indicator icon on page
has been activated.
See [propertytabPage
:indicator-icon] and
[propertytabPage
:indicator-activatable].
afterTabViewIndicatorActivated :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewIndicatorActivatedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the indicatorActivated signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #indicatorActivated 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.
onTabViewIndicatorActivated :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewIndicatorActivatedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the indicatorActivated signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #indicatorActivated callback
pageAttached
type TabViewPageAttachedCallback Source #
Emitted when a page has been created or transferred to self
.
A typical reason to connect to this signal would be to connect to page signals for things such as updating window title.
afterTabViewPageAttached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageAttachedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pageAttached signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #pageAttached 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.
onTabViewPageAttached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageAttachedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pageAttached signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #pageAttached callback
pageDetached
type TabViewPageDetachedCallback Source #
= TabPage |
|
-> Int32 |
|
-> IO () |
Emitted when a page has been removed or transferred to another view.
A typical reason to connect to this signal would be to disconnect signal
handlers connected in the signaltabView
[pageAttached] handler.
It is important not to try and destroy the page child in the handler of
this function as the child might merely be moved to another window; use
child dispose handler for that or do it in sync with your
[methodtabView
.close_page_finish] calls.
afterTabViewPageDetached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageDetachedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pageDetached signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #pageDetached 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.
onTabViewPageDetached :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageDetachedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pageDetached signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #pageDetached callback
pageReordered
type TabViewPageReorderedCallback Source #
= TabPage |
|
-> Int32 |
|
-> IO () |
Emitted after page
has been reordered to position
.
afterTabViewPageReordered :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageReorderedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pageReordered signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #pageReordered 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.
onTabViewPageReordered :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewPageReorderedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pageReordered signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #pageReordered callback
setupMenu
type TabViewSetupMenuCallback Source #
Emitted when a context menu is opened or closed for page
.
If the menu has been closed, page
will be set to NULL
.
It can be used to set up menu actions before showing the menu, for example
disable actions not applicable to page
.
afterTabViewSetupMenu :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewSetupMenuCallback) -> m SignalHandlerId Source #
Connect a signal handler for the setupMenu signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
tabView #setupMenu 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.
onTabViewSetupMenu :: (IsTabView a, MonadIO m) => a -> ((?self :: a) => TabViewSetupMenuCallback) -> m SignalHandlerId Source #
Connect a signal handler for the setupMenu signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
tabView #setupMenu callback