[gtk+/native-layout] Added test to demonstrate height-for-width tradeoffs in expander labels.



commit bba9e3e070d1831436731e205d7ca183b9c20d51
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sat Jun 26 13:22:58 2010 -0400

    Added test to demonstrate height-for-width tradeoffs in expander
    labels.

 tests/testheightforwidth.c |   70 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)
---
diff --git a/tests/testheightforwidth.c b/tests/testheightforwidth.c
index 8529f01..47038ca 100644
--- a/tests/testheightforwidth.c
+++ b/tests/testheightforwidth.c
@@ -547,6 +547,76 @@ TestInterface interfaces[] = {
   },
 
   {
+    "Wrapping Expander",
+    "This test demonstrates how the expander label can fill to its natural width "
+    "and also trade height for width.",
+    "<?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>"
+    "        <child>"
+    "          <object class=\"GtkExpander\" id=\"expander1\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"can_focus\">True</property>"
+    "            <child>"
+    "              <object class=\"GtkLabel\" id=\"label2\">"
+    "                <property name=\"visible\">True</property>"
+    "                <property name=\"label\" translatable=\"yes\">More wrapping text to fill the largish content area in the expander </property>"
+    "                <property name=\"wrap\">True</property>"
+    "                <property name=\"width_chars\">10</property>"
+    "                <attributes>"
+    "                  <attribute name=\"weight\" value=\"bold\"/>"
+    "                  <attribute name=\"foreground\" value=\"#0000D0F00000\"/>"
+    "                </attributes>"
+    "              </object>"
+    "            </child>"
+    "            <child type=\"label\">"
+    "              <object class=\"GtkLabel\" id=\"label1\">"
+    "                <property name=\"visible\">True</property>"
+    "                <property name=\"label\" translatable=\"yes\">Here is some expander text that wraps</property>"
+    "                <property name=\"wrap\">True</property>"
+    "                <property name=\"width_chars\">10</property>"
+    "                <attributes>"
+    "                  <attribute name=\"weight\" value=\"bold\"/>"
+    "                  <attribute name=\"foreground\" value=\"blue\"/>"
+    "                </attributes>"
+    "              </object>"
+    "            </child>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">False</property>"
+    "            <property name=\"shrink\">False</property>"
+    "          </packing>"
+    "        </child>"
+    "        <child>"
+    "          <object class=\"GtkLabel\" id=\"label3\">"
+    "            <property name=\"visible\">True</property>"
+    "            <property name=\"label\" translatable=\"yes\">static\n"
+    "text\n"
+    "here</property>"
+    "            <attributes>"
+    "              <attribute name=\"foreground\" value=\"red\"/>"
+    "            </attributes>"
+    "          </object>"
+    "          <packing>"
+    "            <property name=\"resize\">True</property>"
+    "            <property name=\"shrink\">True</property>"
+    "          </packing>"
+    "        </child>"
+    "      </object>"
+    "    </child>"
+    "  </object>"
+    "</interface>",
+    NULL
+  },
+
+  {
     "Ellipsizing Treeview",
     "Demonstrates how natural size can be shared across treeview columns and renderers.",
     "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"



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