Commit 667f255a authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

Revert "GladeWidgetAdaptor: fix glade_widget_adaptor_get_parent_adaptor()"

This reverts commit b9763bfa.

Revert "GtkPopover: rework support code to fix bugs and warnings"

This reverts commit d2bedbab.
parent ebd3634c
......@@ -297,7 +297,7 @@ glade_widget_adaptor_get_parent_adaptor (GladeWidgetAdaptor *adaptor)
{
g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
return glade_widget_adaptor_get_parent_adaptor_by_type (adaptor->priv->real_type);
return glade_widget_adaptor_get_parent_adaptor_by_type (adaptor->priv->type);
}
gboolean
......@@ -2709,21 +2709,7 @@ glade_widget_adaptor_from_catalog (GladeCatalog *catalog,
glade_xml_get_property_string (class_node,
GLADE_TAG_GET_TYPE_FUNCTION)) != NULL)
{
GType real_type;
object_type = glade_util_get_type_from_name (func_name, TRUE);
real_type = g_type_from_name (name);
if (object_type != G_TYPE_INVALID && !g_type_is_a (object_type, real_type))
{
g_warning ("Trying to define class '%s' with %s() function. "
"But it returns a non derived class %s",
name, func_name, g_type_name (object_type));
g_free (name);
g_free (func_name);
return NULL;
}
g_free (func_name);
}
else
......
......@@ -27,68 +27,6 @@
#include "glade-popover-editor.h"
#define GLADE_TYPE_GTK_POPOVER glade_gtk_popover_get_type ()
G_DECLARE_FINAL_TYPE (GladeGtkPopover, glade_gtk_popover, GLADE, GTK_POPOVER, GtkPopover)
struct _GladeGtkPopover
{
GtkPopover parent_instance;
};
G_DEFINE_TYPE (GladeGtkPopover, glade_gtk_popover, GTK_TYPE_POPOVER)
static void
glade_gtk_popover_init (GladeGtkPopover *popover)
{
gtk_popover_set_modal (GTK_POPOVER (popover), FALSE);
gtk_popover_set_relative_to (GTK_POPOVER (popover), NULL);
}
static void
glade_gtk_popover_map (GtkWidget *widget)
{
GtkWidgetClass *klass = g_type_class_peek_parent (glade_gtk_popover_parent_class);
klass->map (widget);
}
static void
glade_gtk_popover_unmap (GtkWidget *widget)
{
GtkWidgetClass *klass = g_type_class_peek_parent (glade_gtk_popover_parent_class);
klass->unmap (widget);
}
static gboolean
glade_gtk_popover_button_event (GtkWidget *widget, GdkEventButton *event)
{
return TRUE;
}
static gint
glade_gtk_popover_key_press_event (GtkWidget *popover, GdkEventKey *event)
{
if (event->keyval == GDK_KEY_Escape)
return TRUE;
return FALSE;
}
static void
glade_gtk_popover_class_init (GladeGtkPopoverClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
/* Ignore some events causing the popover to disappear from the workspace */
widget_class->key_press_event = glade_gtk_popover_key_press_event;
widget_class->button_press_event = glade_gtk_popover_button_event;
widget_class->button_release_event = glade_gtk_popover_button_event;
/* Make some warning go away */
widget_class->map = glade_gtk_popover_map;
widget_class->unmap = glade_gtk_popover_unmap;
}
GObject *
glade_gtk_popover_constructor (GType type,
guint n_construct_properties,
......@@ -118,3 +56,25 @@ glade_gtk_popover_create_editable (GladeWidgetAdaptor * adaptor,
return GWA_GET_CLASS (GTK_TYPE_CONTAINER)->create_editable (adaptor, type);
}
static gint
popover_key_press (GtkWidget *popover,
GdkEventKey *event,
gpointer user_data)
{
if (event->keyval == GDK_KEY_Escape)
return TRUE;
return FALSE;
}
void
glade_gtk_popover_post_create (GladeWidgetAdaptor * adaptor,
GObject *popover, GladeCreateReason reason)
{
/* Ignore some events causing the popover to disappear from the workspace
*/
g_signal_connect (popover, "key-press-event",
G_CALLBACK (popover_key_press), NULL);
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor, popover, reason);
}
......@@ -3042,8 +3042,6 @@
<property id="menu-model" disabled="True"/>
<property id="popup" ignore="True"/>
<property id="align-widget" ignore="True"/>
<property id="popover" ignore="True" since="3.12"/>
<property id="use-popover" ignore="True" since="3.12"/>
</properties>
</glade-widget-class>
......@@ -3509,18 +3507,13 @@
</packing-properties>
</glade-widget-class>
<glade-widget-class name="GtkPopover"
get-type-function="glade_gtk_popover_get_type"
generic-name="popover"
_title="Popover"
toplevel="True"
since="3.12">
<glade-widget-class name="GtkPopover" generic-name="popover" _title="Popover" toplevel="True" since="3.12">
<constructor-function>glade_gtk_popover_constructor</constructor-function>
<create-editable-function>glade_gtk_popover_create_editable</create-editable-function>
<post-create-function>glade_gtk_popover_post_create</post-create-function>
<properties>
<property id="visible" default="False"/>
<property id="relative-to" ignore="True" custom-layout="True"/>
<property id="pointing-to" disabled="True"/>
<property id="constrain-to" ignore="True" custom-layout="True" since="3.20">
<displayable-values>
<!-- GtkPopoverConstraint enumeration value -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment