diff options
author | Lionel Landwerlin <[email protected]> | 2017-01-06 15:51:08 +0000 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-04-05 09:07:02 +0200 |
commit | 35c4dc6021f36a5fc7df94b0332c7e5d6fa00d0a (patch) | |
tree | aa1499ae26ccb96261ad9cc49db8f10a73f4e25d | |
parent | 52d44dec116c87c7784337d698cf776db45fa392 (diff) | |
download | caja-35c4dc6021f36a5fc7df94b0332c7e5d6fa00d0a.tar.bz2 caja-35c4dc6021f36a5fc7df94b0332c7e5d6fa00d0a.tar.xz |
canvas-container: listen to scale factor to invalidate icons
This is one of the condition that needs to trigger an invalidation to
recompute layout at the correct size.
https://bugzilla.gnome.org/show_bug.cgi?id=776896
origin commit:
https://gitlab.gnome.org/GNOME/nautilus/commit/b257699e
-rw-r--r-- | libcaja-private/caja-icon-container.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 70671afa..eb13b23f 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -6621,6 +6621,15 @@ handle_focus_out_event (GtkWidget *widget, GdkEventFocus *event, gpointer user_d return FALSE; } +static void +handle_scale_factor_changed (GObject *object, + GParamSpec *pspec, + gpointer user_data) +{ + invalidate_labels (CAJA_ICON_CONTAINER (object)); + caja_icon_container_request_update_all (CAJA_ICON_CONTAINER (object)); +} + static int text_ellipsis_limits[CAJA_ZOOM_LEVEL_N_ENTRIES]; static int desktop_text_ellipsis_limit; @@ -6743,6 +6752,9 @@ caja_icon_container_init (CajaIconContainer *container) g_signal_connect (container, "focus-out-event", G_CALLBACK (handle_focus_out_event), NULL); + g_signal_connect (container, "notify::scale-factor", + G_CALLBACK (handle_scale_factor_changed), NULL); + eel_background_set_use_base (background, TRUE); if (!setup_prefs) |