[gtk+/native-layout] Added test case to reflect natural size allocations in GtkTreeView and GtkTreeViewColumn



commit 51dadc0a1a7655fd040a1ad4b989976c2752d83c
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Jun 23 18:02:05 2010 -0400

    Added test case to reflect natural size allocations in GtkTreeView and GtkTreeViewColumn

 tests/testheightforwidth.c |  139 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 139 insertions(+), 0 deletions(-)
---
diff --git a/tests/testheightforwidth.c b/tests/testheightforwidth.c
index 9a54295..a589189 100644
--- a/tests/testheightforwidth.c
+++ b/tests/testheightforwidth.c
@@ -546,6 +546,145 @@ TestInterface interfaces[] = {
     NULL
   },
 
+  {
+    "Ellipsizing Treeview",
+    "Demonstrates how natural size can be shared across treeview columns and renderers.",
+    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+    "<interface>"
+    "  <requires lib=\"gtk+\" version=\"2.20\"/>"
+    "  <!-- interface-naming-policy project-wide -->"
+    "  <object class=\"GtkWindow\" id=\"window\">"
+    "    <property name=\"default_width\">500</property>"
+    "    <child>"
+    "      <object class=\"GtkHPaned\" id=\"hpaned1\">"
+    "        <property name=\"visible\">True</property>"
+    "        <property name=\"can_focus\">True</property>"
+    "        <property name=\"position\">400</property>"
+    "        <child>"
+    "          <object class=\"GtkTreeView\" id=\"treeview1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"can_focus\">True</property>"
+    "            <property name=\"model\">liststore1</property>"
+    "            <property name=\"headers_clickable\">False</property>"
+    "            <property name=\"search_column\">0</property>"
+    "            <child>"
+    "              <object class=\"GtkTreeViewColumn\" id=\"treeviewcolumn1\">"
+    "                <property name=\"sizing\">autosize</property>"
+    "                <property name=\"title\" translatable=\"yes\">#1</property>"
+    "                <property name=\"expand\">True</property>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererText\" id=\"cellrenderertext1\">"
+    "                    <property name=\"ellipsize\">end</property>"
+    "                  </object>"
+    "                  <attributes>"
+    "                    <attribute name=\"text\">0</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererPixbuf\" id=\"cellrendererpixbuf1\"/>"
+    "                  <attributes>"
+    "                    <attribute name=\"icon-name\">1</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "              </object>"
+    "            </child>"
+    "            <child>"
+    "              <object class=\"GtkTreeViewColumn\" id=\"treeviewcolumn2\">"
+    "                <property name=\"sizing\">autosize</property>"
+    "                <property name=\"title\" translatable=\"yes\">#2</property>"
+    "                <property name=\"expand\">True</property>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererPixbuf\" id=\"cellrendererpixbuf2\"/>"
+    "                  <attributes>"
+    "                    <attribute name=\"icon-name\">1</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererText\" id=\"cellrenderertext2\">"
+    "                    <property name=\"ellipsize\">start</property>"
+    "                  </object>"
+    "                  <attributes>"
+    "                    <attribute name=\"text\">2</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "                <child>"
+    "                  <object class=\"GtkCellRendererText\" id=\"cellrenderertext3\">"
+    "                    <property name=\"ellipsize\">end</property>"
+    "                  </object>"
+    "                  <attributes>"
+    "                    <attribute name=\"text\">3</attribute>"
+    "                  </attributes>"
+    "                </child>"
+    "              </object>"
+    "            </child>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">False</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "        <child>"
+    "          <object class=\"GtkLabel\" id=\"label1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"label\" translatable=\"yes\">static\n"
+    "text\n"
+    "here</property>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">True</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "      </object>"
+    "    </child>"
+    "  </object>"
+    "  <object class=\"GtkListStore\" id=\"liststore1\">"
+    "    <columns>"
+    "      <!-- column-name first-text -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name icon-name -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name second-text -->"
+    "      <column type=\"gchararray\"/>"
+    "      <!-- column-name third-text -->"
+    "      <column type=\"gchararray\"/>"
+    "    </columns>"
+    "    <data>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">both columns</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-ok</col>"
+    "        <col id=\"2\" translatable=\"yes\">this</col>"
+    "        <col id=\"3\" translatable=\"yes\">this</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">contain ellipsizing cell renderers</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-cancel</col>"
+    "        <col id=\"2\" translatable=\"yes\">renderer</col>"
+    "        <col id=\"3\" translatable=\"yes\">renderer</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">to demonstrate natural</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-info</col>"
+    "        <col id=\"2\" translatable=\"yes\">is not</col>"
+    "        <col id=\"3\" translatable=\"yes\">can</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">distribution of size</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-apply</col>"
+    "        <col id=\"2\" translatable=\"yes\">wide</col>"
+    "        <col id=\"3\" translatable=\"yes\">be</col>"
+    "      </row>"
+    "      <row>"
+    "        <col id=\"0\" translatable=\"yes\">across columns</col>"
+    "        <col id=\"1\" translatable=\"yes\">gtk-dialog-warning</col>"
+    "        <col id=\"2\" translatable=\"yes\">at all</col>"
+    "        <col id=\"3\" translatable=\"yes\">wide because of this long text.</col>"
+    "      </row>"
+    "    </data>"
+    "  </object>"
+    "</interface>",
+    NULL
+  },
 };
 
 



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