Class: Handy::TabView
- Inherits:
-
Gtk::Bin
- Object
- Gtk::Bin
- Handy::TabView
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#add_page(child, parent) ⇒ Handy::TabPage
Adds child to self with parent as the parent.
-
#append(child) ⇒ Handy::TabPage
Inserts child as the last non-pinned page.
-
#append_pinned(child) ⇒ Handy::TabPage
Inserts child as the last pinned page.
-
#close_other_pages(page) ⇒ nil
Requests to close all pages other than page.
-
#close_page(page) ⇒ nil
Requests to close page.
-
#close_page_finish(page, confirm) ⇒ nil
Completes a [methodTabView.close_page] call for page.
-
#close_pages_after(page) ⇒ nil
Requests to close all pages after page.
-
#close_pages_before(page) ⇒ nil
Requests to close all pages before page.
-
#default_icon ⇒ Gio::Icon
Default page icon.
-
#default_icon=(default_icon) ⇒ Gio::Icon
Default page icon.
-
#get_nth_page(position) ⇒ Handy::TabPage
Gets the [classTabPage] representing the child at position.
-
#get_page(child) ⇒ Handy::TabPage
Gets the [classTabPage] object representing child.
-
#get_page_position(page) ⇒ Integer
Finds the position of page in self, starting from 0.
-
#initialize ⇒ Handy::TabView
constructor
Creates a new
HdyTabView. -
#insert(child, position) ⇒ Handy::TabPage
Inserts a non-pinned page at position.
-
#insert_pinned(child, position) ⇒ Handy::TabPage
Inserts a pinned page at position.
-
#is_transferring_page ⇒ Boolean
Whether a page is being transferred.
-
#is_transferring_page=(is_transferring_page) ⇒ Boolean
Whether a page is being transferred.
-
#is_transferring_page? ⇒ Boolean
Whether a page is being transferred.
-
#menu_model ⇒ Gio::MenuModel
Tab context menu model.
-
#menu_model=(menu_model) ⇒ Gio::MenuModel
Tab context menu model.
-
#n_pages ⇒ Integer
The number of pages in the tab view.
-
#n_pages=(n_pages) ⇒ Integer
The number of pages in the tab view.
-
#n_pinned_pages ⇒ Integer
The number of pinned pages in the tab view.
-
#n_pinned_pages=(n_pinned_pages) ⇒ Integer
The number of pinned pages in the tab view.
-
#pages ⇒ Gio::ListModel
Returns a [ifaceGio.ListModel] containing the pages of self.
-
#prepend(child) ⇒ Handy::TabPage
Inserts child as the first non-pinned page.
-
#prepend_pinned(child) ⇒ Handy::TabPage
Inserts child as the first pinned page.
-
#reorder_backward(page) ⇒ Boolean
Reorders page to before its previous page if possible.
-
#reorder_first(page) ⇒ Boolean
Reorders page to the first possible position.
-
#reorder_forward(page) ⇒ Boolean
Reorders page to after its next page if possible.
-
#reorder_last(page) ⇒ Boolean
Reorders page to the last possible position.
-
#reorder_page(page, position) ⇒ Boolean
Reorders page to position.
-
#select_next_page ⇒ Boolean
Selects the page after the currently selected page.
-
#select_previous_page ⇒ Boolean
Selects the page before the currently selected page.
-
#selected_page ⇒ Handy::TabPage
The currently selected page.
-
#selected_page=(selected_page) ⇒ Handy::TabPage
The currently selected page.
-
#set_page_pinned(page, pinned) ⇒ nil
Pins or unpins page.
-
#shortcut_widget ⇒ Gtk::Widget
Tab shortcut widget.
-
#shortcut_widget=(shortcut_widget) ⇒ Gtk::Widget
Tab shortcut widget.
-
#transfer_page(page, other_view, position) ⇒ nil
Transfers page from self to other_view.
Constructor Details
#initialize ⇒ Handy::TabView
Creates a new HdyTabView.
Instance Method Details
#add_page(child, parent) ⇒ Handy::TabPage
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].
#append(child) ⇒ Handy::TabPage
Inserts child as the last non-pinned page.
#append_pinned(child) ⇒ Handy::TabPage
Inserts child as the last pinned page.
#close_other_pages(page) ⇒ nil
Requests to close all pages other than page.
#close_page(page) ⇒ nil
Requests to close page.
Calling this function will result in [signalTabView::close-page] 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::close-page] 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.
#close_page_finish(page, confirm) ⇒ nil
Completes a [methodTabView.close_page] call for page.
If confirm is TRUE, page will be closed. If it's FALSE, ite 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::close-page] is used.
#close_pages_after(page) ⇒ nil
Requests to close all pages after page.
#close_pages_before(page) ⇒ nil
Requests to close all pages before page.
#default_icon ⇒ Gio::Icon
Default page icon.
If a page doesn't provide its own icon via [propertyTabPage:icon], default icon may be used instead for contexts where having an icon is necessary.
[classTabBar] 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.
#default_icon=(default_icon) ⇒ Gio::Icon
Default page icon.
If a page doesn't provide its own icon via [propertyTabPage:icon], default icon may be used instead for contexts where having an icon is necessary.
[classTabBar] 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.
#get_nth_page(position) ⇒ Handy::TabPage
Gets the [classTabPage] representing the child at position.
#get_page(child) ⇒ Handy::TabPage
Gets the [classTabPage] object representing child.
#get_page_position(page) ⇒ Integer
Finds the position of page in self, starting from 0.
#insert(child, position) ⇒ Handy::TabPage
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.
#insert_pinned(child, position) ⇒ Handy::TabPage
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.
#is_transferring_page ⇒ Boolean
Whether a page is being transferred.
Gets the value of [propertyTabView:is-transferring-page] property.
#is_transferring_page=(is_transferring_page) ⇒ Boolean
Whether a page is being transferred.
This property will be set to TRUE when a drag-n-drop tab transfer starts
on any [classTabView], 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.
#is_transferring_page? ⇒ Boolean
Whether a page is being transferred.
This property will be set to TRUE when a drag-n-drop tab transfer starts
on any [classTabView], 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.
#menu_model ⇒ Gio::MenuModel
Tab context menu model.
When a context menu is shown for a tab, it will be constructed from the provided menu model. Use [signalTabView::setup-menu] signal to set up the menu actions for the particular tab.
#menu_model=(menu_model) ⇒ Gio::MenuModel
Tab context menu model.
When a context menu is shown for a tab, it will be constructed from the provided menu model. Use [signalTabView::setup-menu] signal to set up the menu actions for the particular tab.
#n_pages ⇒ Integer
The number of pages in the tab view.
#n_pages=(n_pages) ⇒ Integer
The number of pages in the tab view.
#n_pinned_pages ⇒ Integer
The number of pinned pages in the tab view.
See [methodTabView.set_page_pinned].
#n_pinned_pages=(n_pinned_pages) ⇒ Integer
The number of pinned pages in the tab view.
See [methodTabView.set_page_pinned].
#pages ⇒ Gio::ListModel
Returns a [ifaceGio.ListModel] containing the pages of self.
This model can be used to keep an up to date view of the pages.
#prepend(child) ⇒ Handy::TabPage
Inserts child as the first non-pinned page.
#prepend_pinned(child) ⇒ Handy::TabPage
Inserts child as the first pinned page.
#reorder_backward(page) ⇒ Boolean
Reorders page to before its previous page if possible.
#reorder_first(page) ⇒ Boolean
Reorders page to the first possible position.
#reorder_forward(page) ⇒ Boolean
Reorders page to after its next page if possible.
#reorder_last(page) ⇒ Boolean
Reorders page to the last possible position.
#reorder_page(page, position) ⇒ Boolean
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.
#select_next_page ⇒ Boolean
Selects the page after the currently selected page.
If the last page was already selected, this function does nothing.
#select_previous_page ⇒ Boolean
Selects the page before the currently selected page.
If the first page was already selected, this function does nothing.
#selected_page ⇒ Handy::TabPage
The currently selected page.
#selected_page=(selected_page) ⇒ Handy::TabPage
The currently selected page.
#set_page_pinned(page, pinned) ⇒ nil
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.
[classTabBar] 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:
- [propertyTabPage:indicator-icon]
- A spinner if [propertyTabPage:loading] is
TRUE - [propertyTabPage:icon]
- [propertyTabView:default-icon]
Pinned pages cannot be closed by default, see [signalTabView::close-page] for how to override that behavior.
#shortcut_widget ⇒ Gtk::Widget
Tab shortcut widget.
Has the following shortcuts:
- Ctrl+Page Up - switch to the previous page
- Ctrl+Page Down - switch to the next page
- Ctrl+Home - switch to the first page
- Ctrl+End - switch to the last page
- Ctrl+Shift+Page Up - move the current page backward
- Ctrl+Shift+Page Down - move the current page forward
- Ctrl+Shift+Home - move the current page at the start
- Ctrl+Shift+End - move the current page at the end
- Ctrl+Tab - switch to the next page, with looping
- Ctrl+Shift+Tab - switch to the previous page, with looping
- Alt+1⋯9 - switch to pages 1-9
- Alt+0 - switch to page 10
These shortcuts are always available on self, this property is useful if they should be available globally.
#shortcut_widget=(shortcut_widget) ⇒ Gtk::Widget
Tab shortcut widget.
Has the following shortcuts:
- Ctrl+Page Up - switch to the previous page
- Ctrl+Page Down - switch to the next page
- Ctrl+Home - switch to the first page
- Ctrl+End - switch to the last page
- Ctrl+Shift+Page Up - move the current page backward
- Ctrl+Shift+Page Down - move the current page forward
- Ctrl+Shift+Home - move the current page at the start
- Ctrl+Shift+End - move the current page at the end
- Ctrl+Tab - switch to the next page, with looping
- Ctrl+Shift+Tab - switch to the previous page, with looping
- Alt+1⋯9 - switch to pages 1-9
- Alt+0 - switch to page 10
These shortcuts are always available on self, this property is useful if they should be available globally.
#transfer_page(page, other_view, position) ⇒ nil
Transfers page from self to other_view.
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.