Merge branch 'matthiasc/for-master' into 'master'

css: Give none singletons unique names

See merge request GNOME/gtk!1718
This commit is contained in:
Matthias Clasen 2020-04-18 22:52:15 +00:00
commit 661b8c3d1a
6 changed files with 16 additions and 24 deletions

View File

@ -703,7 +703,7 @@ static const GtkCssValueClass GTK_CSS_VALUE_FILTER = {
gtk_css_value_filter_print
};
static GtkCssValue none_singleton = { &GTK_CSS_VALUE_FILTER, 1, TRUE, 0, { { GTK_CSS_FILTER_NONE } } };
static GtkCssValue filter_none_singleton = { &GTK_CSS_VALUE_FILTER, 1, TRUE, 0, { { GTK_CSS_FILTER_NONE } } };
static GtkCssValue *
gtk_css_filter_value_alloc (guint n_filters)
@ -721,7 +721,7 @@ gtk_css_filter_value_alloc (guint n_filters)
GtkCssValue *
gtk_css_filter_value_new_none (void)
{
return _gtk_css_value_ref (&none_singleton);
return _gtk_css_value_ref (&filter_none_singleton);
}
static gboolean

View File

@ -136,11 +136,11 @@ static const GtkCssValueClass GTK_CSS_VALUE_IMAGE = {
GtkCssValue *
_gtk_css_image_value_new (GtkCssImage *image)
{
static GtkCssValue none_singleton = { &GTK_CSS_VALUE_IMAGE, 1, TRUE, NULL };
static GtkCssValue image_none_singleton = { &GTK_CSS_VALUE_IMAGE, 1, TRUE, NULL };
GtkCssValue *value;
if (image == NULL)
return _gtk_css_value_ref (&none_singleton);
return _gtk_css_value_ref (&image_none_singleton);
value = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_IMAGE);
value->image = image;

View File

@ -288,12 +288,12 @@ static const GtkCssValueClass GTK_CSS_VALUE_SHADOW = {
gtk_css_value_shadow_print
};
static GtkCssValue none_singleton = { &GTK_CSS_VALUE_SHADOW, 1, TRUE, 0 };
static GtkCssValue shadow_none_singleton = { &GTK_CSS_VALUE_SHADOW, 1, TRUE, 0 };
GtkCssValue *
gtk_css_shadow_value_new_none (void)
{
return _gtk_css_value_ref (&none_singleton);
return _gtk_css_value_ref (&shadow_none_singleton);
}
static GtkCssValue *

View File

@ -800,7 +800,7 @@ static const GtkCssValueClass GTK_CSS_VALUE_TRANSFORM = {
gtk_css_value_transform_print
};
static GtkCssValue none_singleton = { &GTK_CSS_VALUE_TRANSFORM, 1, TRUE, 0, { { GTK_CSS_TRANSFORM_NONE } } };
static GtkCssValue transform_none_singleton = { &GTK_CSS_VALUE_TRANSFORM, 1, TRUE, 0, { { GTK_CSS_TRANSFORM_NONE } } };
static GtkCssValue *
gtk_css_transform_value_alloc (guint n_transforms)
@ -818,7 +818,7 @@ gtk_css_transform_value_alloc (guint n_transforms)
GtkCssValue *
_gtk_css_transform_value_new_none (void)
{
return _gtk_css_value_ref (&none_singleton);
return _gtk_css_value_ref (&transform_none_singleton);
}
static gboolean

View File

@ -29,7 +29,6 @@
#include "gtkstatusbarprivate.h"
#include "gtkbinlayout.h"
#include "gtkframe.h"
#include "gtklabel.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
@ -87,7 +86,6 @@ struct _GtkStatusbar
{
GtkWidget parent_instance;
GtkWidget *frame;
GtkWidget *label;
GtkWidget *message_area;
@ -138,7 +136,7 @@ gtk_statusbar_dispose (GObject *object)
{
GtkStatusbar *self = GTK_STATUSBAR (object);
g_clear_pointer (&self->frame, gtk_widget_unparent);
g_clear_pointer (&self->message_area, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_statusbar_parent_class)->dispose (object);
}
@ -200,7 +198,6 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
*/
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkstatusbar.ui");
gtk_widget_class_bind_template_child_internal (widget_class, GtkStatusbar, message_area);
gtk_widget_class_bind_template_child (widget_class, GtkStatusbar, frame);
gtk_widget_class_bind_template_child (widget_class, GtkStatusbar, label);
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_STATUSBAR_ACCESSIBLE);

View File

@ -2,22 +2,17 @@
<interface domain="gtk40">
<template class="GtkStatusbar" parent="GtkWidget">
<child>
<object class="GtkFrame" id="frame">
<object class="GtkBox" id="message_area">
<property name="hexpand">1</property>
<property name="spacing">4</property>
<child>
<object class="GtkBox" id="message_area">
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="label">
<property name="halign">start</property>
<property name="valign">center</property>
<property name="ellipsize">end</property>
<property name="single-line-mode">1</property>
</object>
</child>
<object class="GtkLabel" id="label">
<property name="halign">start</property>
<property name="valign">center</property>
<property name="ellipsize">end</property>
<property name="single-line-mode">1</property>
</object>
</child>
<child type="label_item"/>
</object>
</child>
</template>