The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix min-width and min-height properties

These changes was commited to the Birdfont repository Fri, 15 Jan 2016 21:31:20 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 15 Jan 2016 21:31:20 +0000]

Updated Files

birdui/BoxLayout.vala
birdui/Component.vala
--- a/birdui/BoxLayout.vala +++ b/birdui/BoxLayout.vala @@ -33,16 +33,15 @@ } 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 @@ } } - 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 @@ } } - 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 @@ component.apply_padding (); set_size_limits (component); - print (@"$(component), $(component.style)\n"); if (orientation == BoxOrientation.HORIZONTAL) { child_x += component.padded_width;
--- a/birdui/Component.vala +++ b/birdui/Component.vala @@ -112,8 +112,7 @@ 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 @@ 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 @@ XmlTree xml_parser = new XmlTree (xml_data); component_tag = xml_parser.get_root (); + defs = new Defs (); parse (component_tag); @@ -279,7 +280,7 @@ } public virtual string to_string () { - return @"Component $(component_tag.get_name ())"; + return @"$(component_tag.get_name ())"; } public void print_tree () {