diff options
author | Stefano Karapetsas <[email protected]> | 2012-11-16 05:08:48 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-11-16 05:08:48 -0800 |
commit | dc66bc40724191f0068869773576dc4edf042c6f (patch) | |
tree | 74b9684feea188736b21f2c829f29befaaf2e9da /src/caja-information-panel.c | |
parent | 935e1fed604f48e68d125d205c890a59f46f8f21 (diff) | |
parent | 1466df20591105550738a1d0784a623af9909abf (diff) | |
download | caja-dc66bc40724191f0068869773576dc4edf042c6f.tar.bz2 caja-dc66bc40724191f0068869773576dc4edf042c6f.tar.xz |
Merge pull request #42 from jasmineaura/develop
Bring Caja up to speed, stage1
Diffstat (limited to 'src/caja-information-panel.c')
-rw-r--r-- | src/caja-information-panel.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c index 35df28ca..7aa17908 100644 --- a/src/caja-information-panel.c +++ b/src/caja-information-panel.c @@ -31,7 +31,6 @@ #include <eel/eel-background.h> #include <eel/eel-glib-extensions.h> #include <eel/eel-gtk-extensions.h> -#include <eel/eel-gtk-macros.h> #include <eel/eel-stock-dialogs.h> #include <eel/eel-string.h> #include <eel/eel-vfs-extensions.h> @@ -146,8 +145,6 @@ typedef struct G_DEFINE_TYPE_WITH_CODE (CajaInformationPanel, caja_information_panel, EEL_TYPE_BACKGROUND_BOX, G_IMPLEMENT_INTERFACE (CAJA_TYPE_SIDEBAR, caja_information_panel_iface_init)); -/* for EEL_CALL_PARENT */ -#define parent_class caja_information_panel_parent_class G_DEFINE_TYPE_WITH_CODE (CajaInformationPanelProvider, caja_information_panel_provider, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (CAJA_TYPE_SIDEBAR_PROVIDER, @@ -221,6 +218,8 @@ caja_information_panel_class_init (CajaInformationPanelClass *klass) NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); + + g_type_class_add_private (klass, sizeof (CajaInformationPanelDetails)); } /* utility routine to allocate the box the holds the command buttons */ @@ -245,11 +244,9 @@ make_button_box (CajaInformationPanel *information_panel) static void caja_information_panel_init (CajaInformationPanel *information_panel) { - GtkWidget *widget; - - widget = GTK_WIDGET (information_panel); - - information_panel->details = g_new0 (CajaInformationPanelDetails, 1); + information_panel->details = G_TYPE_INSTANCE_GET_PRIVATE (information_panel, + CAJA_TYPE_INFORMATION_PANEL, + CajaInformationPanelDetails); /* load the default background */ caja_information_panel_read_defaults (information_panel); @@ -312,13 +309,12 @@ caja_information_panel_finalize (GObject *object) g_free (information_panel->details->default_background_image); g_free (information_panel->details->current_background_color); g_free (information_panel->details->current_background_image); - g_free (information_panel->details); g_signal_handlers_disconnect_by_func (caja_preferences, caja_information_panel_theme_changed, information_panel); - EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); + G_OBJECT_CLASS (caja_information_panel_parent_class)->finalize (object); } /* callback to handle resetting the background */ @@ -432,12 +428,24 @@ static InformationPanelPart hit_test (CajaInformationPanel *information_panel, int x, int y) { + GtkAllocation *allocation; + gboolean bg_hit; + if (caja_sidebar_title_hit_test_icon (information_panel->details->title, x, y)) { return ICON_PART; } - if (eel_point_in_widget (GTK_WIDGET (information_panel), x, y)) + allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation (GTK_WIDGET (information_panel), allocation); + + bg_hit = allocation != NULL + && x >= allocation->x && y >= allocation->y + && x < allocation->x + allocation->width + && y < allocation->y + allocation->height; + g_free (allocation); + + if (bg_hit) { return BACKGROUND_PART; } @@ -1072,9 +1080,7 @@ caja_information_panel_update_appearance (CajaInformationPanel *information_pane eel_background_set_image_uri (background, background_image); eel_background_set_color (background, background_color); - caja_sidebar_title_select_text_color - (information_panel->details->title, background, - !information_panel_has_background (information_panel)); + caja_sidebar_title_select_text_color (information_panel->details->title, background); } g_free (background_color); @@ -1222,7 +1228,8 @@ selection_changed_callback (CajaWindowInfo *window, caja_information_panel_set_uri (panel, uri, name); - eel_g_object_list_unref (selection); + g_list_foreach (selection, (GFunc) g_object_unref, NULL); + g_list_free (selection); g_free (uri); g_free (name); } |