Implemented GtkSizeRequest on GtkExpander and added test
Now the expander requests and distributes space naturally, the expander widget prioritizes the child widget vertically and only allocates the minimum height for width to the label widget.
This commit is contained in:
		| @ -546,6 +546,75 @@ TestInterface interfaces[] = { | ||||
|     NULL | ||||
|   }, | ||||
|  | ||||
|   { | ||||
|     "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 | ||||
|   }, | ||||
| }; | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Tristan Van Berkom
					Tristan Van Berkom