Commit f6a25303 authored by Tristan Van Berkom's avatar Tristan Van Berkom

GladeEditor rework: Make atk.png loaded as a GResource.

parent 282a4944
......@@ -18,7 +18,7 @@ update-icon-cache:
pixmapsdir = $(pkgdatadir)/pixmaps
pixmaps_DATA = devhelp.png \
plus.png atk.png \
plus.png \
fixed-bg.png placeholder.png \
deprecated-16x16.png \
deprecated-22x22.png
......
......@@ -54,12 +54,17 @@ UI_FILES = \
glade-project-properties.ui \
glade-property-label.ui
EXTRA_DIST = \
$(UI_FILES) \
glade-marshallers.list \
gladeui.rc.in \
icon-naming-spec.c \
glade-previewer.rc.in \
GRAPHICS_FILES = \
atk.png
EXTRA_DIST = \
$(UI_FILES) \
$(GRAPHICS_FILES) \
glade-marshallers.list \
gladeui.rc.in \
icon-naming-spec.c \
glade-previewer.rc.in \
gladeui-resources.gresource.xml
# The glade core library
......@@ -236,9 +241,9 @@ CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
# Generate resources
gladeui-resources.h: gladeui-resources.gresource.xml $(UI_FILES)
gladeui-resources.h: gladeui-resources.gresource.xml $(UI_FILES) $(GRAPHICS_FILES)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gladeui-resources.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --c-name _gladeui --generate-header
gladeui-resources.c: gladeui-resources.gresource.xml $(UI_FILES)
gladeui-resources.c: gladeui-resources.gresource.xml $(UI_FILES) $(GRAPHICS_FILES)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/gladeui-resources.gresource.xml \
--target=$@ --sourcedir=$(srcdir) --c-name _gladeui --generate-source
......@@ -138,7 +138,7 @@ struct _GladeEditorPrivate
gboolean show_class_field; /* Whether or not to show the class field at the top */
};
G_DEFINE_TYPE (GladeEditor, glade_editor, GTK_TYPE_VBOX);
G_DEFINE_TYPE (GladeEditor, glade_editor, GTK_TYPE_BOX);
static GParamSpec *properties[N_PROPERTIES];
......@@ -273,8 +273,7 @@ glade_editor_notebook_page (GladeEditor *editor,
/* construct tab label widget */
if (type == GLADE_PAGE_ATK)
{
gchar *path = g_build_filename (glade_app_get_pixmaps_dir (), "atk.png", NULL);
GtkWidget *image = gtk_image_new_from_file (path);
GtkWidget *image = gtk_image_new_from_resource ("/org/gnome/gladeui/atk.png");
label_widget = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (label_widget), image);
......@@ -282,7 +281,6 @@ glade_editor_notebook_page (GladeEditor *editor,
gtk_widget_show (image);
gtk_widget_set_tooltip_text (label_widget, name);
g_free (path);
}
else
{
......@@ -451,6 +449,8 @@ glade_editor_init (GladeEditor *editor)
GladeEditorPrivate *priv;
GtkWidget *hbox;
gtk_orientable_set_orientation (GTK_ORIENTABLE (editor), GTK_ORIENTATION_VERTICAL);
editor->priv = priv = GLADE_EDITOR_GET_PRIVATE (editor);
priv->notebook = gtk_notebook_new ();
......
......@@ -24,14 +24,14 @@ typedef struct _GladeEditorPrivate GladeEditorPrivate;
*/
struct _GladeEditor
{
GtkVBox vbox; /* The editor is a vbox */
GtkBox vbox; /* The editor is a vbox */
GladeEditorPrivate *priv;
};
struct _GladeEditorClass
{
GtkVBoxClass parent_class;
GtkBoxClass parent_class;
void (* glade_reserved1) (void);
void (* glade_reserved2) (void);
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/gladeui">
<file>atk.png</file>
<file compressed="true" preprocess="xml-stripblanks">glade-project-properties.ui</file>
<file compressed="true" preprocess="xml-stripblanks">glade-property-label.ui</file>
</gresource>
......
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