Merge branch 'wip/otte/for-master' into 'master'

Fixes

Closes #4469

See merge request GNOME/gtk!4182
This commit is contained in:
Benjamin Otte 2021-11-21 03:55:28 +00:00
commit 344fac5aa7
16 changed files with 279 additions and 111 deletions

View File

@ -1160,7 +1160,7 @@ gtk_paned_get_preferred_size_for_opposite_orientation (GtkWidget *widget,
int *natural)
{
GtkPaned *paned = GTK_PANED (widget);
int for_start_child, for_end_child;
int for_start_child, for_end_child, for_handle;
int child_min, child_nat;
if (size > -1 &&
@ -1168,22 +1168,21 @@ gtk_paned_get_preferred_size_for_opposite_orientation (GtkWidget *widget,
paned->end_child && gtk_widget_get_visible (paned->end_child))
{
int start_child_req, end_child_req;
int handle_size;
gtk_widget_measure (paned->handle_widget,
OPPOSITE_ORIENTATION (paned->orientation),
paned->orientation,
-1,
NULL, &handle_size,
NULL, &for_handle,
NULL, NULL);
gtk_widget_measure (paned->start_child, paned->orientation, -1, &start_child_req, NULL, NULL, NULL);
gtk_widget_measure (paned->end_child, paned->orientation, -1, &end_child_req, NULL, NULL, NULL);
gtk_paned_compute_position (paned,
size - handle_size, start_child_req, end_child_req,
size - for_handle, start_child_req, end_child_req,
NULL, NULL, &for_start_child);
for_end_child = size - for_start_child - handle_size;
for_end_child = size - for_start_child - for_handle;
if (paned->shrink_start_child)
for_start_child = MAX (start_child_req, for_start_child);
@ -1194,6 +1193,7 @@ gtk_paned_get_preferred_size_for_opposite_orientation (GtkWidget *widget,
{
for_start_child = size;
for_end_child = size;
for_handle = -1;
}
*minimum = *natural = 0;
@ -1202,7 +1202,7 @@ gtk_paned_get_preferred_size_for_opposite_orientation (GtkWidget *widget,
{
gtk_widget_measure (paned->start_child,
OPPOSITE_ORIENTATION (paned->orientation),
MAX (for_start_child, -1),
for_start_child,
&child_min, &child_nat,
NULL, NULL);
@ -1214,7 +1214,20 @@ gtk_paned_get_preferred_size_for_opposite_orientation (GtkWidget *widget,
{
gtk_widget_measure (paned->end_child,
OPPOSITE_ORIENTATION (paned->orientation),
MAX (for_end_child, -1),
for_end_child,
&child_min, &child_nat,
NULL, NULL);
*minimum = MAX (*minimum, child_min);
*natural = MAX (*natural, child_nat);
}
if (paned->start_child && gtk_widget_get_visible (paned->start_child) &&
paned->end_child && gtk_widget_get_visible (paned->end_child))
{
gtk_widget_measure (paned->handle_widget,
OPPOSITE_ORIENTATION (paned->orientation),
for_handle,
&child_min, &child_nat,
NULL, NULL);

View File

@ -494,8 +494,8 @@ gtk_widget_measure (GtkWidget *widget,
gtk_widget_measure (widget, OPPOSITE_ORIENTATION (orientation), -1, &min_opposite_size, NULL, NULL, NULL);
if (for_size < min_opposite_size)
{
g_critical ("gtk_widget_measure: assertion 'for_size >= minimum opposite size' failed for %s %p: %u >= %u",
G_OBJECT_TYPE_NAME (widget), widget, for_size, min_opposite_size);
g_critical ("gtk_widget_measure: assertion 'for_size >= minimum opposite size' failed: %u >= %u",
for_size, min_opposite_size);
for_size = min_opposite_size;
}
}

View File

@ -4165,12 +4165,14 @@ update_realized_window_properties (GtkWindow *window)
static void
gtk_window_compute_default_size (GtkWindow *window,
int cur_width,
int cur_height,
int max_width,
int max_height,
int *min_width,
int *min_height,
int *nat_width,
int *nat_height)
int *width,
int *height)
{
GtkWidget *widget = GTK_WIDGET (window);
@ -4182,14 +4184,20 @@ gtk_window_compute_default_size (GtkWindow *window,
&minimum, &natural,
NULL, NULL);
*min_height = minimum;
*nat_height = MAX (minimum, MIN (max_height, natural));
if (cur_height > 0)
*height = MAX (cur_height, minimum);
else
*height = MAX (minimum, MIN (max_height, natural));
gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL,
*nat_height,
*height,
&minimum, &natural,
NULL, NULL);
*min_width = minimum;
*nat_width = MAX (minimum, MIN (max_width, natural));
if (cur_width > 0)
*width = MAX (cur_width, minimum);
else
*width = MAX (minimum, MIN (max_width, natural));
}
else /* GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or CONSTANT_SIZE */
{
@ -4199,14 +4207,20 @@ gtk_window_compute_default_size (GtkWindow *window,
&minimum, &natural,
NULL, NULL);
*min_width = minimum;
*nat_width = MAX (minimum, MIN (max_width, natural));
if (cur_width > 0)
*width = MAX (cur_width, minimum);
else
*width = MAX (minimum, MIN (max_width, natural));
gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL,
*nat_width,
*width,
&minimum, &natural,
NULL, NULL);
*min_height = minimum;
*nat_height = MAX (minimum, MIN (max_height, natural));
if (cur_height > 0)
*height = MAX (cur_height, minimum);
else
*height = MAX (minimum, MIN (max_height, natural));
}
}
@ -4239,22 +4253,15 @@ toplevel_compute_size (GdkToplevel *toplevel,
GtkBorder shadow;
int bounds_width, bounds_height;
int min_width, min_height;
int nat_width, nat_height;
gdk_toplevel_size_get_bounds (size, &bounds_width, &bounds_height);
gtk_window_compute_default_size (window,
priv->default_width, priv->default_height,
bounds_width, bounds_height,
&min_width, &min_height,
&nat_width, &nat_height);
&width, &height);
width = priv->default_width;
height = priv->default_height;
if (width <= 0)
width = nat_width;
if (height <= 0)
height = nat_height;
if (width < min_width)
width = min_width;

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<object class="GtkWindow">
<property name="decorated">0</property>
<child>
<object class="GtkLabel">
<property name="label">Hello
World</property>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<object class="GtkWindow">
<property name="default-width">4</property>
<property name="decorated">0</property>
<child>
<object class="GtkLabel">
<property name="label">Hello World</property>
<property name="wrap">True</property>
</object>
</child>
</object>
</interface>

View File

@ -266,6 +266,8 @@ testdata = [
'data-url.css',
'data-url.ref.ui',
'data-url.ui',
'default-size-too-small.ref.ui',
'default-size-too-small.ui',
'default-size-undecorated.ui',
'default-size-undecorated.ref.ui',
'default-size-with-titlebar.ui',
@ -425,6 +427,9 @@ testdata = [
'opacity-initial.ui',
'overlay-no-main-widget.ref.ui',
'overlay-no-main-widget.ui',
'paned-handle-size.css',
'paned-handle-size.ref.ui',
'paned-handle-size.ui',
'paned-undersized.css',
'paned-undersized.ref.ui',
'paned-undersized.ui',

View File

@ -0,0 +1,15 @@
paned separator,
picture {
all: unset;
background: firebrick;
}
paned.vertical > separator {
min-width: 10px;
min-height: 20px;
}
paned.horizontal > separator {
min-width: 20px;
min-height: 10px;
}

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<object class="GtkWindow">
<property name="decorated">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="label">top left</property>
</object>
</child>
<child>
<object class="GtkPicture">
<property name="height-request">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">bottom left</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkPicture">
<property name="width-request">20</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="label">top right</property>
</object>
</child>
<child>
<object class="GtkPicture">
<property name="height-request">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">bottom right</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk40">
<object class="GtkWindow">
<property name="decorated">0</property>
<child>
<object class="GtkPaned">
<child>
<object class="GtkPaned">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="label">top left</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">bottom left</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkPaned">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="label">top right</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">bottom right</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -7,15 +7,15 @@
<child>
<object class="GtkBox">
<property name="hexpand">1</property>
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
<property name="vexpand">0</property>
<child>
<object class="GtkButton">
<property name="halign">3</property>
<property name="halign">center</property>
<property name="label" translatable="1">_</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -30,7 +30,7 @@
</child>
<child>
<object class="GtkButton">
<property name="halign">3</property>
<property name="halign">center</property>
<property name="hexpand">1</property>
<property name="label" translatable="1">E</property>
<property name="focusable">1</property>
@ -50,12 +50,12 @@
<child>
<object class="GtkBox">
<property name="can_focus">0</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
<property name="vexpand">0</property>
<child>
<object class="GtkButton">
<property name="halign">3</property>
<property name="halign">center</property>
<property name="label" translatable="1">_</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -70,7 +70,7 @@
</child>
<child>
<object class="GtkButton">
<property name="halign">3</property>
<property name="halign">center</property>
<property name="hexpand">1</property>
<property name="label" translatable="1">E</property>
<property name="focusable">1</property>
@ -91,13 +91,13 @@
</child>
<child>
<object class="GtkBox">
<property name="halign">3</property>
<property name="orientation">1</property>
<property name="halign">center</property>
<property name="orientation">vertical</property>
<property name="can_focus">0</property>
<property name="vexpand">1</property>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="label" translatable="1">_</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -112,7 +112,7 @@
</child>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
<property name="label" translatable="1">E</property>
<property name="focusable">1</property>
@ -133,10 +133,10 @@
<object class="GtkBox">
<property name="hexpand">0</property>
<property name="vexpand">1</property>
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="label" translatable="1">_I</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -151,7 +151,7 @@
</child>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
<property name="label" translatable="1">EI</property>
<property name="focusable">1</property>
@ -171,7 +171,7 @@
<property name="label" translatable="1">_S</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -179,7 +179,7 @@
<property name="label" translatable="1">FS</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">1</property>
<property name="valign">start</property>
</object>
</child>
<child>
@ -188,7 +188,7 @@
<property name="label" translatable="1">ES</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -197,7 +197,7 @@
<property name="label" translatable="1">FES</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">1</property>
<property name="valign">start</property>
</object>
</child>
<child>
@ -205,7 +205,7 @@
<property name="label" translatable="1">_N</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -213,7 +213,7 @@
<property name="label" translatable="1">FN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">2</property>
<property name="valign">end</property>
</object>
</child>
<child>
@ -222,7 +222,7 @@
<property name="label" translatable="1">EN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -231,7 +231,7 @@
<property name="label" translatable="1">FEN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">2</property>
<property name="valign">end</property>
</object>
</child>
<child>
@ -239,7 +239,7 @@
<property name="label" translatable="1">_C</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -247,7 +247,7 @@
<property name="label" translatable="1">FC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -256,7 +256,7 @@
<property name="label" translatable="1">EC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -265,7 +265,7 @@
<property name="label" translatable="1">FEC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -273,7 +273,7 @@
<property name="label" translatable="1">_B</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -281,7 +281,7 @@
<property name="label" translatable="1">FB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">4</property>
<property name="valign">baseline</property>
</object>
</child>
<child>
@ -290,7 +290,7 @@
<property name="label" translatable="1">EB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
</object>
</child>
<child>
@ -299,7 +299,7 @@
<property name="label" translatable="1">FEB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">4</property>
<property name="valign">baseline</property>
</object>
</child>
</object>
@ -308,10 +308,10 @@
<object class="GtkBox">
<property name="hexpand">0</property>
<property name="vexpand">1</property>
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="label" translatable="1">_I</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -328,7 +328,7 @@
</child>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="label" translatable="1">EI</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -348,7 +348,7 @@
<property name="label" translatable="1">_S</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">0</property>
</object>
</child>
@ -357,7 +357,7 @@
<property name="label" translatable="1">FS</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">1</property>
<property name="valign">start</property>
<property name="vexpand">0</property>
</object>
</child>
@ -366,7 +366,7 @@
<property name="label" translatable="1">ES</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -375,7 +375,7 @@
<property name="label" translatable="1">FES</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">1</property>
<property name="valign">start</property>
<property name="vexpand">1</property>
</object>
</child>
@ -384,7 +384,7 @@
<property name="label" translatable="1">_N</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">0</property>
</object>
</child>
@ -393,7 +393,7 @@
<property name="label" translatable="1">FN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">2</property>
<property name="valign">end</property>
<property name="vexpand">0</property>
</object>
</child>
@ -402,7 +402,7 @@
<property name="label" translatable="1">EN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -411,7 +411,7 @@
<property name="label" translatable="1">FEN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">2</property>
<property name="valign">end</property>
<property name="vexpand">1</property>
</object>
</child>
@ -420,7 +420,7 @@
<property name="label" translatable="1">_C</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">0</property>
</object>
</child>
@ -429,7 +429,7 @@
<property name="label" translatable="1">FC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">0</property>
</object>
</child>
@ -438,7 +438,7 @@
<property name="label" translatable="1">EC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -447,7 +447,7 @@
<property name="label" translatable="1">FEC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -456,7 +456,7 @@
<property name="label" translatable="1">_B</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">0</property>
</object>
</child>
@ -465,7 +465,7 @@
<property name="label" translatable="1">FB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">4</property>
<property name="valign">baseline</property>
<property name="vexpand">0</property>
</object>
</child>
@ -474,7 +474,7 @@
<property name="label" translatable="1">EB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -483,7 +483,7 @@
<property name="label" translatable="1">FEB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">4</property>
<property name="valign">baseline</property>
<property name="vexpand">1</property>
</object>
</child>
@ -493,10 +493,10 @@
<object class="GtkBox">
<property name="hexpand">0</property>
<property name="vexpand">1</property>
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="label" translatable="1">_I</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -513,7 +513,7 @@
</child>
<child>
<object class="GtkButton">
<property name="valign">3</property>
<property name="valign">center</property>
<property name="label" translatable="1">EI</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
@ -533,7 +533,7 @@
<property name="label" translatable="1">_S</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -542,7 +542,7 @@
<property name="label" translatable="1">FS</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">1</property>
<property name="valign">start</property>
<property name="vexpand">1</property>
</object>
</child>
@ -551,7 +551,7 @@
<property name="label" translatable="1">ES</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -560,7 +560,7 @@
<property name="label" translatable="1">FES</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">1</property>
<property name="valign">start</property>
<property name="vexpand">1</property>
</object>
</child>
@ -569,7 +569,7 @@
<property name="label" translatable="1">_N</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -578,7 +578,7 @@
<property name="label" translatable="1">FN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">2</property>
<property name="valign">end</property>
<property name="vexpand">1</property>
</object>
</child>
@ -587,7 +587,7 @@
<property name="label" translatable="1">EN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -596,7 +596,7 @@
<property name="label" translatable="1">FEN</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">2</property>
<property name="valign">end</property>
<property name="vexpand">1</property>
</object>
</child>
@ -605,7 +605,7 @@
<property name="label" translatable="1">_C</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -614,7 +614,7 @@
<property name="label" translatable="1">FC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -623,7 +623,7 @@
<property name="label" translatable="1">EC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -632,7 +632,7 @@
<property name="label" translatable="1">FEC</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -641,7 +641,7 @@
<property name="label" translatable="1">_B</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -650,7 +650,7 @@
<property name="label" translatable="1">FB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">4</property>
<property name="valign">baseline</property>
<property name="vexpand">1</property>
</object>
</child>
@ -659,7 +659,7 @@
<property name="label" translatable="1">EB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">3</property>
<property name="valign">center</property>
<property name="vexpand">1</property>
</object>
</child>
@ -668,7 +668,7 @@
<property name="label" translatable="1">FEB</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="valign">4</property>
<property name="valign">baseline</property>
<property name="vexpand">1</property>
</object>
</child>

View File

@ -4,7 +4,7 @@
<object class="GtkWindow" id="window1">
<property name="child">
<object class="GtkBox" id="box1">
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="checkbutton1">
<property name="hexpand">1</property>

View File

@ -100,8 +100,8 @@
<object class="GtkButton" id="button8">
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="halign">center</property>
<property name="valign">center</property>
<layout>
<property name="column">1</property>
<property name="row">1</property>
@ -112,8 +112,8 @@
<object class="GtkButton" id="button9">
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="halign">3</property>
<property name="valign">3</property>
<property name="halign">center</property>
<property name="valign">center</property>
<layout>
<property name="column">2</property>
<property name="row">1</property>

View File

@ -9,7 +9,7 @@
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">0</property>
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<property name="border-width">0</property>
<child>
<object class="GtkFileChooserWidget" id="widget">
@ -31,6 +31,6 @@
</child>
</template>
<object class="GtkSizeGroup" id="buttons">
<property name="mode">2</property>
<property name="mode">vertical</property>
</object>
</interface>

View File

@ -11,7 +11,7 @@
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin_bottom">12</property>
<property name="orientation">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkNotebook" id="notebook1">
@ -34,7 +34,7 @@
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="valign">1</property>
<property name="valign">start</property>
<property name="hexpand">1</property>
<property name="xalign">0</property>
<property name="label" translatable="1"> • Click the &quot;Run!&quot; button, and then dash to your desk or meeting.
@ -129,11 +129,11 @@
</child>
<child>
<object class="GtkBox" id="box2">
<property name="valign">3</property>
<property name="orientation">1</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="result_label">
<property name="valign">1</property>
<property name="valign">start</property>
<property name="xalign">0</property>
<property name="label" translatable="0">Silver Trophy!</property>
<property name="use_markup">1</property>
@ -148,7 +148,7 @@
</child>
<child>
<object class="GtkLabel" id="current_time_label">
<property name="valign">1</property>
<property name="valign">start</property>
<property name="xalign">0</property>
<property name="label" translatable="0">You managed to finish the route with the 2nd best time ever, &lt;b&gt;48.15 seconds!&lt;/b&gt; </property>
<property name="use_markup">1</property>
@ -157,7 +157,7 @@
</child>
<child>
<object class="GtkLabel" id="better_time_label">
<property name="valign">1</property>
<property name="valign">start</property>
<property name="xalign">0</property>
<property name="label" translatable="0">Only &lt;b&gt;3.75 seconds&lt;/b&gt; separate you from the gold trophy!</property>
<property name="use_markup">1</property>

View File

@ -12,7 +12,7 @@
</child>
<child>
<object class="GtkSeparator">
<property name="orientation">1</property>
<property name="orientation">vertical</property>
</object>
</child>
<child>

View File

@ -621,7 +621,15 @@ canonical_enum_value (MyParserData *data,
GValue value = G_VALUE_INIT;
if (gtk_builder_value_from_string_type (data->builder, type, string, &value, NULL))
return g_strdup_printf ("%d", g_value_get_enum (&value));
{
GEnumClass *eclass = g_type_class_ref (type);
GEnumValue *evalue = g_enum_get_value (eclass, g_value_get_enum (&value));
if (evalue)
return g_strdup (evalue->value_nick);
else
return g_strdup_printf ("%d", g_value_get_enum (&value));
}
return NULL;
}