[libhandy/tabs: 48/62] q




commit 3bda6040919e33ab34b860a92bf6c76c253e55df
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Sep 11 01:07:17 2020 +0500

    q

 examples/hdy-tab-view-demo-window.ui | 30 ++++++++++++++++++++++++++++++
 src/hdy-tab-bar.c                    |  7 +++++++
 src/hdy-tab-view.c                   | 31 +++++++++++++++++++++++++++----
 3 files changed, 64 insertions(+), 4 deletions(-)
---
diff --git a/examples/hdy-tab-view-demo-window.ui b/examples/hdy-tab-view-demo-window.ui
index 931518a0..fd9a4b84 100644
--- a/examples/hdy-tab-view-demo-window.ui
+++ b/examples/hdy-tab-view-demo-window.ui
@@ -50,6 +50,36 @@
           <object class="HdyTabBar">
             <property name="visible">True</property>
             <property name="view">view</property>
+            <child type="start">
+              <object class="GtkButton">
+                <property name="visible">True</property>
+                <property name="action-name">win.tab-new</property>
+                <style>
+                  <class name="flat"/>
+                </style>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">True</property>
+                    <property name="icon-name">list-add-symbolic</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="end">
+              <object class="GtkButton">
+                <property name="visible">True</property>
+                <property name="action-name">win.tab-new</property>
+                <style>
+                  <class name="flat"/>
+                </style>
+                <child>
+                  <object class="GtkImage">
+                    <property name="visible">True</property>
+                    <property name="icon-name">list-add-symbolic</property>
+                  </object>
+                </child>
+              </object>
+            </child>
           </object>
         </child>
         <child>
diff --git a/src/hdy-tab-bar.c b/src/hdy-tab-bar.c
index 5fa32624..928433e1 100644
--- a/src/hdy-tab-bar.c
+++ b/src/hdy-tab-bar.c
@@ -19,6 +19,13 @@
  * The #HdyTabBar widget is a tab bar that can be used with conjunction with
  * #HdyTabView.
  *
+ * #HdyTabBar 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, #HdyTabBar will scroll
+ * them. Pinned tabs always stay visible and aren't a part of the scrollable
+ * area.
+ *
  * # CSS nodes
  *
  * #HdyTabBar has a single CSS node with name tabbar.
diff --git a/src/hdy-tab-view.c b/src/hdy-tab-view.c
index 7852a14d..54058f6c 100644
--- a/src/hdy-tab-view.c
+++ b/src/hdy-tab-view.c
@@ -18,11 +18,33 @@ static const GtkTargetEntry dst_targets [] = {
 
 /**
  * SECTION:hdy-tab-view
- * @short_description: TBD
+ * @short_description: A dynamic tabbed container
  * @title: HdyTabView
  * @See_also: #HdyTabBar
  *
- * TBD
+ * #HdyTabView 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 bar and relies on external widgets for that, such as #HdyTabBar.
+ *
+ * #HdyTabView maintains a #HdyTabPage object for each page,which holds
+ * additional per-page properties. You can obtain the #HdyTabPage for a page
+ * with hdy_tab_view_get_page(), and as return value for hdy_tab_view_append()
+ * and other functions for adding children.
+ *
+ * #HdyTabView 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 #GtkNotebook for use cases
+ * such as tabbed dialogs.
+ *
+ * As such, it does not support disabling page reordering or detaching, or
+ * adding children via #GtkBuilder.
+ *
+ * # CSS nodes
+ *
+ * #HdyTabView has a main CSS node with the name tabview.
+ *
+ * It contains the subnode overlay, which contains subnodes stack and widget.
+ * The stack subnode contains the added pages.
  *
  * |[<!-- language="plain" -->
  * tabview
@@ -2697,9 +2719,10 @@ hdy_tab_view_attach_page (HdyTabView *self,
  * @other_view: the tab view to transfer the page to
  * @position: the position to insert the page at, starting at 0
  *
- * Transfers @page from @self to @other_view.
+ * Transfers @page from @self to @other_view. The @page object will be reused.
  *
- * If the page is pinned, the position must be lower
+ * 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.
  *
  * Since: 1.2
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]