diff options
author | Victor Kareh <[email protected]> | 2018-04-02 22:02:39 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-04-04 21:53:21 -0400 |
commit | 554a036710b18d2573810265c69be6e83033af63 (patch) | |
tree | 8e0b03a463952ad43f356301e91d0c1ced4fabad /src/caja-pathbar.c | |
parent | 280ef8294b0e50394b5118cb298b0f9e5920f795 (diff) | |
download | caja-554a036710b18d2573810265c69be6e83033af63.tar.bz2 caja-554a036710b18d2573810265c69be6e83033af63.tar.xz |
HiDPI: Convert Pixbufs to Cairo Surfaces
This allows icons in most places to scale up properly for HiDPI
displays.
Diffstat (limited to 'src/caja-pathbar.c')
-rw-r--r-- | src/caja-pathbar.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index 533f2f7f..fe0a0590 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -75,7 +75,7 @@ struct _ButtonData unsigned int file_changed_signal_id; /* custom icon */ - GdkPixbuf *custom_icon; + cairo_surface_t *custom_icon; /* flag to indicate its the base folder in the URI */ gboolean is_base_dir; @@ -218,12 +218,12 @@ trash_state_changed_cb (CajaTrashMonitor *monitor, { GIcon *icon; CajaIconInfo *icon_info; - GdkPixbuf *pixbuf; + cairo_surface_t *surface; icon = caja_trash_monitor_get_icon (); icon_info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale); - pixbuf = caja_icon_info_get_pixbuf_at_size (icon_info, CAJA_PATH_BAR_ICON_SIZE); - gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), pixbuf); + surface = caja_icon_info_get_surface_at_size (icon_info, CAJA_PATH_BAR_ICON_SIZE); + gtk_image_set_from_surface (GTK_IMAGE (button_data->image), surface); } } g_object_unref (file); @@ -1382,7 +1382,7 @@ button_data_free (ButtonData *button_data) g_free (button_data->dir_name); if (button_data->custom_icon) { - g_object_unref (button_data->custom_icon); + cairo_surface_destroy (button_data->custom_icon); } if (button_data->file != NULL) { @@ -1447,7 +1447,7 @@ static void caja_path_bar_update_button_appearance (ButtonData *button_data) { CajaIconInfo *icon_info; - GdkPixbuf *pixbuf; + cairo_surface_t *surface; const gchar *dir_name = get_dir_name (button_data); if (button_data->label != NULL) @@ -1474,27 +1474,27 @@ caja_path_bar_update_button_appearance (ButtonData *button_data) { if (button_data->custom_icon) { - gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), button_data->custom_icon); + gtk_image_set_from_surface (GTK_IMAGE (button_data->image), button_data->custom_icon); gtk_widget_show (GTK_WIDGET (button_data->image)); } else { icon_info = get_type_icon_info (button_data); - pixbuf = NULL; + surface = NULL; if (icon_info != NULL) { - pixbuf = caja_icon_info_get_pixbuf_at_size (icon_info, CAJA_PATH_BAR_ICON_SIZE); + surface = caja_icon_info_get_surface_at_size (icon_info, CAJA_PATH_BAR_ICON_SIZE); g_object_unref (icon_info); } - if (pixbuf != NULL) + if (surface != NULL) { - gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), pixbuf); + gtk_image_set_from_surface (GTK_IMAGE (button_data->image), surface); gtk_style_context_add_class (gtk_widget_get_style_context (button_data->button), "image-button"); gtk_widget_show (GTK_WIDGET (button_data->image)); - g_object_unref (pixbuf); + cairo_surface_destroy (surface); } else { @@ -1567,7 +1567,7 @@ setup_file_path_mounted_mount (GFile *location, ButtonData *button_data) } info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale); g_object_unref (icon); - button_data->custom_icon = caja_icon_info_get_pixbuf_at_size (info, CAJA_PATH_BAR_ICON_SIZE); + button_data->custom_icon = caja_icon_info_get_surface_at_size (info, CAJA_PATH_BAR_ICON_SIZE); g_object_unref (info); button_data->dir_name = g_mount_get_name (mount); button_data->type = MOUNT_BUTTON; @@ -1591,7 +1591,7 @@ setup_file_path_mounted_mount (GFile *location, ButtonData *button_data) } info = caja_icon_info_lookup (icon, CAJA_PATH_BAR_ICON_SIZE, scale); g_object_unref (icon); - button_data->custom_icon = caja_icon_info_get_pixbuf_at_size (info, CAJA_PATH_BAR_ICON_SIZE); + button_data->custom_icon = caja_icon_info_get_surface_at_size (info, CAJA_PATH_BAR_ICON_SIZE); g_object_unref (info); button_data->type = DEFAULT_LOCATION_BUTTON; button_data->fake_root = TRUE; |