Commit 884166a
Fix min-width and min-height properties
Changed files (2)
Diff
@@ -33,16 +33,15 @@ class BoxLayout : Component { } void set_size_limits (Component component) {- string? min_width = style.get_css_property ("min-width");+ string? min_width = component.style.get_css_property ("min-width"); if (min_width != null) { double w = SvgFile.parse_number (min_width);- if (component.width < w) { component.width = w; } } - string? min_height = style.get_css_property ("min-height");+ string? min_height = component.style.get_css_property ("min-height"); if (min_height != null) { double h = SvgFile.parse_number (min_height); @@ -51,7 +50,7 @@ class BoxLayout : Component { } } - string? max_width = style.get_css_property ("max-width");+ string? max_width = component.style.get_css_property ("max-width"); if (max_width != null) { double w = SvgFile.parse_number (max_width); @@ -60,7 +59,7 @@ class BoxLayout : Component { } } - string? max_height = style.get_css_property ("max-height");+ string? max_height = component.style.get_css_property ("max-height"); if (max_height != null) { double h = SvgFile.parse_number (max_height); @@ -81,7 +80,6 @@ class BoxLayout : Component { component.apply_padding (); set_size_limits (component); - print (@"$(component), $(component.style)\n"); if (orientation == BoxOrientation.HORIZONTAL) { child_x += component.padded_width; @@ -112,8 +112,7 @@ class Component : GLib.Object { protected void add_component (Component component) { components.add (component); component.inherit_styles_sheet (defs);- component.style = SvgStyle.parse (defs, style, component.component_tag);- + component.style = SvgStyle.parse (defs, style, component.component_tag); component.set_overflow_property_from_css (); component.set_identification (); }@@ -162,6 +161,7 @@ class Component : GLib.Object { if (attribute_name == "file") { Component component = new Component (component_tag, defs); add_component (component);+ component.load_layout (attribute.get_content ()); } else { unused_attribute (attribute_name); }@@ -228,6 +228,7 @@ class Component : GLib.Object { XmlTree xml_parser = new XmlTree (xml_data); component_tag = xml_parser.get_root ();+ defs = new Defs (); parse (component_tag); @@ -279,7 +280,7 @@ class Component : GLib.Object { } public virtual string to_string () {- return @"Component $(component_tag.get_name ())";+ return @"$(component_tag.get_name ())"; } public void print_tree () {