int *minimum_baseline,
int *natural_baseline)
{
+ int minimum_default, natural_default;
PangoLayout *layout;
- layout = gtk_label_get_measuring_layout (self, NULL, -1);
+ get_default_widths (self, &minimum_default, &natural_default);
+
+ layout = gtk_label_get_measuring_layout (self, NULL, natural_default);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- int minimum_default, natural_default;
-
pango_layout_get_size (layout, natural, NULL);
if (self->ellipsize)
{
else
*minimum = *natural;
- get_default_widths (self, &minimum_default, &natural_default);
if (minimum_default > *minimum)
*minimum = minimum_default;
- if (natural_default > -1)
- *natural = natural_default;
*natural = MAX (*minimum, *natural);
}
else
/* Natural width is natural width - or as wide as possible */
layout = gtk_label_get_measuring_layout (self, layout, natural_default);
pango_layout_get_size (layout, natural_width, NULL);
- *natural_width = MAX (*natural_width, natural_default);
*natural_width = MAX (*natural_width, *minimum_width);
}
else
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window1">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="label">Hello World</property>
+ </object>
+ </child>
+ </object>
+</interface>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window1">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="label">Hello World</property>
+ <property name="max-width-chars">1000</property>
+ </object>
+ </child>
+ </object>
+</interface>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window1">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="label">Hello World</property>
+ <property name="wrap">1</property>
+ </object>
+ </child>
+ </object>
+</interface>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window1">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="label">Hello World</property>
+ <property name="max-width-chars">1000</property>
+ <property name="wrap">1</property>
+ </object>
+ </child>
+ </object>
+</interface>
'label-fonts.css',
'label-fonts.ref.ui',
'label-fonts.ui',
+ 'label-huge-max-width-chars.ref.ui',
+ 'label-huge-max-width-chars.ui',
'label-max-width-chars-and-halign-and-infinite-width.ui',
'label-max-width-chars-and-halign-and-infinite-width.ref.ui',
'label-shadows.css',
'label-text-shadow-changes-modify-clip.ui',
'label-width-chars-dont-shrink.ref.ui',
'label-width-chars-dont-shrink.ui',
+ 'label-wrapped-huge-max-width-chars.ref.ui',
+ 'label-wrapped-huge-max-width-chars.ui',
# this seems to make assumptions on text positioning
# that are not valid with subpixel positioning
#'label-wrap-justify.ref.ui',