summaryrefslogtreecommitdiff
path: root/src/file-manager/fm-list-view.c
diff options
context:
space:
mode:
authorCosimo Cecchi <[email protected]>2013-08-02 14:37:13 +0200
committerlukefromdc <[email protected]>2018-04-04 21:53:21 -0400
commitbc1405c9f54e19e74f973581130229ef1053ff9c (patch)
tree8ae544cad7a3b815ff6c48304ced204f37dd4947 /src/file-manager/fm-list-view.c
parent779e0af4042b6572d729190067cfee6a876d73e5 (diff)
downloadcaja-bc1405c9f54e19e74f973581130229ef1053ff9c.tar.bz2
caja-bc1405c9f54e19e74f973581130229ef1053ff9c.tar.xz
Support HiDpi icons
Port the rendering of icons to cairo surfaces, so that we can apply the GDK scale factor when rendering icons. origin commit: https://gitlab.gnome.org/GNOME/nautilus/commit/0d4555d7
Diffstat (limited to 'src/file-manager/fm-list-view.c')
-rw-r--r--src/file-manager/fm-list-view.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index d2353e7a..b68b6a31 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -1638,6 +1638,13 @@ focus_in_event_callback (GtkWidget *widget, GdkEventFocus *event, gpointer user_
return FALSE;
}
+static gint
+get_icon_scale_callback (FMListModel *model,
+ FMListView *view)
+{
+ return gtk_widget_get_scale_factor (GTK_WIDGET (view->details->tree_view));
+}
+
static void
create_and_set_up_tree_view (FMListView *view)
{
@@ -1727,6 +1734,9 @@ create_and_set_up_tree_view (FMListView *view)
g_signal_connect_object (view->details->model, "subdirectory_unloaded",
G_CALLBACK (subdirectory_unloaded_callback), view, 0);
+ g_signal_connect_object (view->details->model, "get-icon-scale",
+ G_CALLBACK (get_icon_scale_callback), view, 0);
+
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (view->details->tree_view), GTK_SELECTION_MULTIPLE);
caja_columns = caja_get_all_columns ();
@@ -1782,7 +1792,7 @@ create_and_set_up_tree_view (FMListView *view)
gtk_tree_view_column_pack_start (view->details->file_name_column, cell, FALSE);
gtk_tree_view_column_set_attributes (view->details->file_name_column,
cell,
- "pixbuf", FM_LIST_MODEL_SMALLEST_ICON_COLUMN,
+ "surface", FM_LIST_MODEL_SMALLEST_ICON_COLUMN,
NULL);
cell = gtk_cell_renderer_text_new ();
@@ -2779,7 +2789,7 @@ fm_list_view_set_zoom_level (FMListView *view,
column = fm_list_model_get_column_id_from_zoom_level (new_level);
gtk_tree_view_column_set_attributes (view->details->file_name_column,
GTK_CELL_RENDERER (view->details->pixbuf_cell),
- "pixbuf", column,
+ "surface", column,
NULL);
/* Scale text. */