Commit b79bb6ff authored by Paolo Bacchilega's avatar Paolo Bacchilega

removed some deprecated functions

parent db830e78
......@@ -126,17 +126,17 @@ update_theme_from_controls (GthContactSheetThemeDialog *self)
/* header */
self->priv->theme->header_font_name = g_strdup (gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("header_fontpicker"))));
self->priv->theme->header_font_name = g_strdup (gtk_font_chooser_get_font (GTK_FONT_CHOOSER (GET_WIDGET ("header_fontpicker"))));
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("header_colorpicker")), &self->priv->theme->header_color);
/* footer */
self->priv->theme->footer_font_name = g_strdup (gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("footer_fontpicker"))));
self->priv->theme->footer_font_name = g_strdup (gtk_font_chooser_get_font (GTK_FONT_CHOOSER (GET_WIDGET ("footer_fontpicker"))));
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("footer_colorpicker")), &self->priv->theme->footer_color);
/* caption */
self->priv->theme->caption_font_name = g_strdup (gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("caption_fontpicker"))));
self->priv->theme->caption_font_name = g_strdup (gtk_font_chooser_get_font (GTK_FONT_CHOOSER (GET_WIDGET ("caption_fontpicker"))));
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("caption_colorpicker")), &self->priv->theme->caption_color);
}
......@@ -376,13 +376,13 @@ update_controls_from_theme (GthContactSheetThemeDialog *self,
gtk_combo_box_set_active (GTK_COMBO_BOX (GET_WIDGET ("frame_style_combobox")), theme->frame_style);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("frame_colorpicker")), &theme->frame_color);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (GET_WIDGET ("header_fontpicker")), theme->header_font_name);
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (GET_WIDGET ("header_fontpicker")), theme->header_font_name);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("header_colorpicker")), &theme->header_color);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (GET_WIDGET ("footer_fontpicker")), theme->footer_font_name);
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (GET_WIDGET ("footer_fontpicker")), theme->footer_font_name);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("footer_colorpicker")), &theme->footer_color);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (GET_WIDGET ("caption_fontpicker")), theme->caption_font_name);
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (GET_WIDGET ("caption_fontpicker")), theme->caption_font_name);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (GET_WIDGET ("caption_colorpicker")), &theme->caption_color);
update_preview (self);
......
......@@ -783,10 +783,10 @@ gth_browser_activate_folder_context_open_in_file_manager (GSimpleAction *action,
return;
uri = g_file_get_uri (file_data->file);
if (! gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (browser)),
uri,
gtk_get_current_event_time (),
&error))
if (! gtk_show_uri_on_window (GTK_WINDOW (browser),
uri,
GDK_CURRENT_TIME,
&error))
{
_gtk_error_dialog_from_gerror_run (GTK_WINDOW (browser), _("Could not open the location"), error);
g_clear_error (&error);
......
......@@ -188,10 +188,7 @@ gth_file_list_drag_data_received (GtkWidget *file_view,
}
if (action == GDK_ACTION_ASK) {
GdkDragAction actions =
_gtk_menu_ask_drag_drop_action (file_view,
gdk_drag_context_get_actions (context),
time);
GdkDragAction actions = _gtk_menu_ask_drag_drop_action (file_view, gdk_drag_context_get_actions (context));
gdk_drag_status (context, actions, time);
success = gdk_drag_context_get_selected_action (context) != 0;
}
......
......@@ -103,12 +103,10 @@ completed_messagedialog_response_cb (GtkDialog *dialog,
case _OPEN_IN_BROWSER_RESPONSE:
{
GdkScreen *screen;
OAuthAccount *account;
char *url = NULL;
GError *error = NULL;
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
account = web_service_get_current_account (WEB_SERVICE (data->service));
......@@ -132,7 +130,7 @@ completed_messagedialog_response_cb (GtkDialog *dialog,
else if (data->photoset->id != NULL)
url = g_strconcat (data->server->url, "/photos/", account->id, "/sets/", data->photoset->id, NULL);
if ((url != NULL) && ! gtk_show_uri (screen, url, 0, &error)) {
if ((url != NULL) && ! gtk_show_uri_on_window (GTK_WINDOW (data->browser), url, GDK_CURRENT_TIME, &error)) {
if (data->service != NULL)
gth_task_dialog (GTH_TASK (data->service), TRUE, NULL);
_gtk_error_dialog_from_gerror_run (GTK_WINDOW (data->browser), _("Could not connect to the server"), error);
......
......@@ -508,13 +508,11 @@ old_authorization_dialog_response_cb (GtkDialog *dialog,
switch (response_id) {
case _RESPONSE_AUTHORIZE:
{
GdkScreen *screen;
char *url;
GError *error = NULL;
char *url;
GError *error = NULL;
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
url = flickr_service_old_auth_get_login_link (self, WEB_AUTHORIZATION_WRITE);
if (gtk_show_uri (screen, url, 0, &error))
if (gtk_show_uri_on_window (GTK_WINDOW (dialog), url, GDK_CURRENT_TIME, &error))
old_authorization_complete (self);
else
gth_task_completed (GTH_TASK (self), error);
......
......@@ -65,15 +65,15 @@ ip__dlg_preferences_construct_cb (GtkWidget *dialog,
gtk_widget_show (page);
font_name = g_settings_get_string (data->settings, PREF_IMAGE_PRINT_FONT_NAME);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (GET_WIDGET ("caption_fontbutton")), font_name);
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (GET_WIDGET ("caption_fontbutton")), font_name);
g_free (font_name);
font_name = g_settings_get_string (data->settings, PREF_IMAGE_PRINT_HEADER_FONT_NAME);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (GET_WIDGET ("header_fontbutton")), font_name);
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (GET_WIDGET ("header_fontbutton")), font_name);
g_free (font_name);
font_name = g_settings_get_string (data->settings, PREF_IMAGE_PRINT_FOOTER_FONT_NAME);
gtk_font_button_set_font_name (GTK_FONT_BUTTON (GET_WIDGET ("footer_fontbutton")), font_name);
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (GET_WIDGET ("footer_fontbutton")), font_name);
g_free (font_name);
label = gtk_label_new (_("Print"));
......@@ -94,7 +94,7 @@ ip__dlg_preferences_apply_cb (GtkWidget *dialog,
data = g_object_get_data (G_OBJECT (dialog), BROWSER_DATA_KEY);
g_return_if_fail (data != NULL);
g_settings_set_string (data->settings, PREF_IMAGE_PRINT_FONT_NAME, gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("caption_fontbutton"))));
g_settings_set_string (data->settings, PREF_IMAGE_PRINT_HEADER_FONT_NAME, gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("header_fontbutton"))));
g_settings_set_string (data->settings, PREF_IMAGE_PRINT_FOOTER_FONT_NAME, gtk_font_button_get_font_name (GTK_FONT_BUTTON (GET_WIDGET ("footer_fontbutton"))));
g_settings_set_string (data->settings, PREF_IMAGE_PRINT_FONT_NAME, gtk_font_chooser_get_font (GTK_FONT_CHOOSER (GET_WIDGET ("caption_fontbutton"))));
g_settings_set_string (data->settings, PREF_IMAGE_PRINT_HEADER_FONT_NAME, gtk_font_chooser_get_font (GTK_FONT_CHOOSER (GET_WIDGET ("header_fontbutton"))));
g_settings_set_string (data->settings, PREF_IMAGE_PRINT_FOOTER_FONT_NAME, gtk_font_chooser_get_font (GTK_FONT_CHOOSER (GET_WIDGET ("footer_fontbutton"))));
}
......@@ -195,7 +195,6 @@ _gth_slideshow_load_current_image (GthSlideshow *self)
GthFileData *prev_file;
int screen_width;
int screen_height;
GdkScreen *screen;
if (self->priv->next_event != 0) {
g_source_remove (self->priv->next_event);
......@@ -220,14 +219,7 @@ _gth_slideshow_load_current_image (GthSlideshow *self)
else
prev_file = NULL;
screen_width = -1;
screen_height = -1;
screen = gtk_widget_get_screen (GTK_WIDGET (self));
if (screen != NULL) {
screen_width = gdk_screen_get_width (screen);
screen_height = gdk_screen_get_height (screen);
}
_gtk_widget_get_screen_size (GTK_WIDGET (self), &screen_width, &screen_height);
gth_image_preloader_load (self->priv->preloader,
requested_file,
MAX (screen_width, screen_height),
......@@ -717,19 +709,19 @@ default_projector_pause_painter (GthImageViewer *image_viewer,
gpointer user_data)
{
GthSlideshow *self = user_data;
GdkScreen *screen;
int screen_width;
int screen_height;
double dest_x;
double dest_y;
if (! self->priv->paused || ! self->priv->paint_paused || (self->priv->pause_pixbuf == NULL))
return;
screen = gtk_widget_get_screen (GTK_WIDGET (image_viewer));
if (screen == NULL)
if (! _gtk_widget_get_screen_size (GTK_WIDGET (image_viewer), &screen_width, &screen_height))
return;
dest_x = (gdk_screen_get_width (screen) - gdk_pixbuf_get_width (self->priv->pause_pixbuf)) / 2.0;
dest_y = (gdk_screen_get_height (screen) - gdk_pixbuf_get_height (self->priv->pause_pixbuf)) / 2.0;
dest_x = (screen_width - gdk_pixbuf_get_width (self->priv->pause_pixbuf)) / 2.0;
dest_y = (screen_height - gdk_pixbuf_get_height (self->priv->pause_pixbuf)) / 2.0;
gdk_cairo_set_source_pixbuf (cr, self->priv->pause_pixbuf, dest_x, dest_y);
cairo_rectangle (cr, dest_x, dest_y, gdk_pixbuf_get_width (self->priv->pause_pixbuf), gdk_pixbuf_get_height (self->priv->pause_pixbuf));
cairo_fill (cr);
......
......@@ -1779,9 +1779,7 @@ success_dialog_response_cb (GtkDialog *dialog,
gpointer user_data)
{
GthWebExporter *self = user_data;
GdkScreen *screen;
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
switch (response_id) {
......@@ -1800,7 +1798,7 @@ success_dialog_response_cb (GtkDialog *dialog,
break;
url = g_file_get_uri (file);
if ((url != NULL) && ! gtk_show_uri (screen, url, 0, &error)) {
if ((url != NULL) && ! gtk_show_uri_on_window (GTK_WINDOW (self->priv->browser), url, GDK_CURRENT_TIME, &error)) {
gth_task_dialog (GTH_TASK (self), TRUE, NULL);
_gtk_error_dialog_from_gerror_run (GTK_WINDOW (self->priv->browser), _("Could not show the destination"), error);
g_clear_error (&error);
......
......@@ -2483,7 +2483,7 @@ _gth_browser_real_set_current_page (GthWindow *window,
GtkWidget *file_properties_parent;
file_properties_parent = _gth_browser_get_browser_file_properties_container (browser);
gtk_widget_reparent (browser->priv->file_properties, file_properties_parent);
_gtk_widget_reparent (browser->priv->file_properties, file_properties_parent);
/* restore the child properties that gtk_widget_reparent doesn't preserve. */
gtk_container_child_set (GTK_CONTAINER (file_properties_parent),
browser->priv->file_properties,
......@@ -2492,7 +2492,7 @@ _gth_browser_real_set_current_page (GthWindow *window,
NULL);
}
else
gtk_widget_reparent (browser->priv->file_properties, browser->priv->viewer_sidebar_container);
_gtk_widget_reparent (browser->priv->file_properties, browser->priv->viewer_sidebar_container);
/* update the sidebar state depending on the current visible page */
......@@ -2838,10 +2838,7 @@ folder_tree_drag_data_received (GtkWidget *tree_view,
}
if (success && (suggested_action == GDK_ACTION_ASK)) {
GdkDragAction action =
_gtk_menu_ask_drag_drop_action (tree_view,
gdk_drag_context_get_actions (context),
time);
GdkDragAction action = _gtk_menu_ask_drag_drop_action (tree_view, gdk_drag_context_get_actions (context));
gdk_drag_status (context, action, time);
success = gdk_drag_context_get_selected_action (context) != 0;
}
......@@ -2960,13 +2957,7 @@ folder_tree_folder_popup_cb (GthFolderTree *folder_tree,
file_source = NULL;
gth_hook_invoke ("gth-browser-folder-tree-popup-before", browser, file_source, file_data);
gtk_menu_popup (GTK_MENU (browser->priv->folder_popup),
NULL,
NULL,
NULL,
NULL,
3,
(guint32) time);
gtk_menu_popup_at_pointer (GTK_MENU (browser->priv->folder_popup), NULL);
if (file_data != NULL) {
GtkTreePath *path;
......@@ -3634,26 +3625,8 @@ static void
gth_file_list_popup_menu (GthBrowser *browser,
GdkEventButton *event)
{
int button, event_time;
gth_hook_invoke ("gth-browser-file-list-popup-before", browser);
if (event != NULL) {
button = event->button;
event_time = event->time;
}
else {
button = 0;
event_time = gtk_get_current_event_time ();
}
gtk_menu_popup (GTK_MENU (browser->priv->file_list_popup),
NULL,
NULL,
NULL,
NULL,
button,
event_time);
gtk_menu_popup_at_pointer (GTK_MENU (browser->priv->file_list_popup), (GdkEvent *) event);
}
......@@ -3941,7 +3914,7 @@ pref_browser_properties_on_the_right_changed (GSettings *settings,
return;
gtk_widget_unrealize (browser->priv->file_properties);
gtk_widget_reparent (browser->priv->file_properties, new_parent);
_gtk_widget_reparent (browser->priv->file_properties, new_parent);
/* restore the child properties that gtk_widget_reparent doesn't preserve. */
gtk_container_child_set (GTK_CONTAINER (new_parent),
browser->priv->file_properties,
......@@ -4366,18 +4339,17 @@ gth_browser_init (GthBrowser *browser)
window_height = g_settings_get_int (browser->priv->browser_settings, PREF_BROWSER_WINDOW_HEIGHT);
if ((window_width == 0) || (window_height == 0)) {
GdkScreen *screen;
int max_width;
int max_height;
int sidebar_width;
int thumb_size;
int thumb_spacing;
int default_columns_of_thumbnails;
int n_cols;
screen = gtk_widget_get_screen (GTK_WIDGET (browser));
max_width = gdk_screen_get_width (screen) * 5 / 6;
max_height = gdk_screen_get_height (screen) * 3 / 4;
int max_width;
int max_height;
int sidebar_width;
int thumb_size;
int thumb_spacing;
int default_columns_of_thumbnails;
int n_cols;
_gtk_widget_get_screen_size (GTK_WIDGET (browser), &max_width, &max_height);
max_width = max_width * 5 / 6;
max_height = max_height * 3 / 4;
sidebar_width = g_settings_get_int (browser->priv->browser_settings, PREF_BROWSER_BROWSER_SIDEBAR_WIDTH) + 10;
thumb_size = g_settings_get_int (browser->priv->browser_settings, PREF_BROWSER_THUMBNAIL_SIZE);
......@@ -6917,26 +6889,8 @@ void
gth_browser_file_menu_popup (GthBrowser *browser,
GdkEventButton *event)
{
int button;
int event_time;
if (event != NULL) {
button = event->button;
event_time = event->time;
}
else {
button = 0;
event_time = gtk_get_current_event_time ();
}
gth_hook_invoke ("gth-browser-file-popup-before", browser);
gtk_menu_popup (GTK_MENU (browser->priv->file_popup),
NULL,
NULL,
NULL,
NULL,
button,
event_time);
gtk_menu_popup_at_pointer (GTK_MENU (browser->priv->file_popup), (GdkEvent *) event);
}
......
......@@ -384,13 +384,7 @@ tree_view_button_press_event_cb (GtkWidget *widget,
return FALSE;
gtk_tree_selection_select_path (GTK_TREE_SELECTION (gtk_tree_view_get_selection (GTK_TREE_VIEW (self->priv->tree_view))), path);
gtk_menu_popup (GTK_MENU (self->priv->popup_menu),
NULL,
NULL,
NULL,
NULL,
event->button,
event->time);
gtk_menu_popup_at_pointer (GTK_MENU (self->priv->popup_menu), (GdkEvent *) event);
gtk_tree_path_free (path);
......@@ -406,15 +400,7 @@ tree_view_popup_menu_cb (GtkWidget *widget,
gpointer user_data)
{
GthFileProperties *self = user_data;
gtk_menu_popup (GTK_MENU (self->priv->popup_menu),
NULL,
NULL,
NULL,
NULL,
0,
gtk_get_current_event_time ());
gtk_menu_popup_at_pointer (GTK_MENU (self->priv->popup_menu), NULL);
return TRUE;
}
......
......@@ -1421,9 +1421,9 @@ emit_fake_motion_notify_event (GthFolderTree *folder_tree)
if (! gtk_widget_get_realized (widget))
return;
device = gdk_device_manager_get_client_pointer (
gdk_display_get_device_manager (
gtk_widget_get_display (GTK_WIDGET (folder_tree))));
device = _gtk_widget_get_client_pointer (widget);
if (device == NULL)
return;
window = gdk_window_get_device_position (gtk_widget_get_window (widget),
device,
&x,
......
......@@ -1284,7 +1284,6 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
cairo_surface_t *image;
GtkStyleContext *style_context;
cairo_rectangle_int_t frame_rect;
gboolean gtk320 = ((gtk_major_version >= 3) && (gtk_minor_version >= 20));
image = item->thumbnail;
if (image == NULL)
......@@ -1295,47 +1294,46 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
cairo_save (cr);
style_context = gtk_widget_get_style_context (widget);
gtk_style_context_save (style_context);
if (gtk320) {
gtk_style_context_set_state (style_context, item_state);
}
else {
gtk_style_context_remove_class (style_context, GTK_STYLE_CLASS_VIEW);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
}
#if GTK_CHECK_VERSION(3, 20, 0)
gtk_style_context_set_state (style_context, item_state);
#else
gtk_style_context_remove_class (style_context, GTK_STYLE_CLASS_VIEW);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
#endif
frame_rect = item->pixbuf_area;
if ((item->style == ITEM_STYLE_ICON)
|| ! (item->is_image || (item_state & GTK_STATE_FLAG_SELECTED) || (item_state == GTK_STATE_FLAG_NORMAL)))
{
GdkRGBA background_color;
/* use a gray rounded box for icons or when the original size
* is smaller than the thumbnail size... */
if (gtk320) {
gtk_style_context_save (style_context);
gtk_style_context_add_class (style_context, "icon");
gtk_render_background (style_context,
cr,
item->thumbnail_area.x,
item->thumbnail_area.y,
item->thumbnail_area.width,
item->thumbnail_area.height);
gtk_style_context_restore (style_context);
}
else {
gtk_style_context_get_background_color (style_context, item_state, &background_color);
gdk_cairo_set_source_rgba (cr, &background_color);
#if GTK_CHECK_VERSION(3, 20, 0)
gtk_style_context_save (style_context);
gtk_style_context_add_class (style_context, "icon");
gtk_render_background (style_context,
cr,
item->thumbnail_area.x,
item->thumbnail_area.y,
item->thumbnail_area.width,
item->thumbnail_area.height);
gtk_style_context_restore (style_context);
#else
GdkRGBA background_color;
_cairo_draw_rounded_box (cr,
item->thumbnail_area.x,
item->thumbnail_area.y,
item->thumbnail_area.width,
item->thumbnail_area.height,
4);
cairo_fill (cr);
}
gtk_style_context_get_background_color (style_context, item_state, &background_color);
gdk_cairo_set_source_rgba (cr, &background_color);
_cairo_draw_rounded_box (cr,
item->thumbnail_area.x,
item->thumbnail_area.y,
item->thumbnail_area.width,
item->thumbnail_area.height,
4);
cairo_fill (cr);
#endif
}
if (item->style == ITEM_STYLE_IMAGE) {
......@@ -1456,32 +1454,31 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
}
if ((item_state & GTK_STATE_FLAG_SELECTED) || (item_state & GTK_STATE_FLAG_FOCUSED)) {
if (gtk320) {
gtk_style_context_save (style_context);
gtk_style_context_add_class (style_context, "icon-effect");
gtk_render_background (style_context,
cr,
frame_rect.x,
frame_rect.y,
frame_rect.width,
frame_rect.height);
gtk_style_context_restore (style_context);
}
else {
GdkRGBA color;
gtk_style_context_get_background_color (style_context, item_state, &color);
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 0.5);
cairo_rectangle (cr,
frame_rect.x,
frame_rect.y,
frame_rect.width,
frame_rect.height);
cairo_fill_preserve (cr);
#if GTK_CHECK_VERSION(3, 20, 0)
gtk_style_context_save (style_context);
gtk_style_context_add_class (style_context, "icon-effect");
gtk_render_background (style_context,
cr,
frame_rect.x,
frame_rect.y,
frame_rect.width,
frame_rect.height);
gtk_style_context_restore (style_context);
#else
GdkRGBA color;
gtk_style_context_get_background_color (style_context, item_state, &color);
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 0.5);
cairo_rectangle (cr,
frame_rect.x,
frame_rect.y,
frame_rect.width,
frame_rect.height);
cairo_fill_preserve (cr);
cairo_set_line_width (cr, 2);
cairo_set_source_rgb (cr, color.red, color.green, color.blue);
cairo_stroke (cr);
}
cairo_set_line_width (cr, 2);
cairo_set_source_rgb (cr, color.red, color.green, color.blue);
cairo_stroke (cr);
#endif
}
gtk_style_context_restore (style_context);
......@@ -1593,77 +1590,76 @@ _gth_grid_view_draw_item (GthGridView *self,
item_state ^= GTK_STATE_FLAG_ACTIVE;
if (item_state ^ GTK_STATE_FLAG_NORMAL) {
gboolean gtk320 = ((gtk_major_version >= 3) && (gtk_minor_version >= 20));
GtkStyleContext *style_context;
GdkRGBA color;
cairo_save (cr);
style_context = gtk_widget_get_style_context (GTK_WIDGET (self));
gtk_style_context_save (style_context);
if (gtk320) {
gtk_style_context_set_state (style_context, item_state);
#if GTK_CHECK_VERSION(3, 20, 0)
gtk_style_context_set_state (style_context, item_state);
if (item->style != ITEM_STYLE_ICON) {
cairo_region_t *area;
cairo_rectangle_int_t extents;
if (item->style != ITEM_STYLE_ICON) {
cairo_region_t *area;
cairo_rectangle_int_t extents;
area = cairo_region_create_rectangle (&item->thumbnail_area);
cairo_region_union_rectangle (area, &item->caption_area);
cairo_region_get_extents (area, &extents);
area = cairo_region_create_rectangle (&item->thumbnail_area);
cairo_region_union_rectangle (area, &item->caption_area);
cairo_region_get_extents (area, &extents);
gtk_render_background (style_context,
cr,
extents.x - self->priv->cell_padding,
extents.y - self->priv->cell_padding,
extents.width + (self->priv->cell_padding * 2),
extents.height + (self->priv->cell_padding * 2));
gtk_render_background (style_context,
cr,
extents.x - self->priv->cell_padding,
extents.y - self->priv->cell_padding,
extents.width + (self->priv->cell_padding * 2),
extents.height + (self->priv->cell_padding * 2));
cairo_region_destroy (area);
}
else
gtk_render_background (style_context,
cr,
item->area.x,
item->area.y,
item->area.width,
item->area.height);
cairo_region_destroy (area);
}
else {
gtk_style_context_remove_class (style_context, GTK_STYLE_CLASS_VIEW);
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
gtk_style_context_set_state (style_context, item_state);
gtk_style_context_get_background_color (style_context, item_state, &color);
_gdk_rgba_lighter (&color, &color);
cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha);
if (item->style != ITEM_STYLE_ICON) {