settings: Call gtk_system_setting_changed

Replace calls to gtk_style_context_reset_widgets by
gtk_system_setting_changed, with the appropriate setting,
and add style invalidation where required.
This commit is contained in:
Matthias Clasen 2020-04-21 15:45:21 -04:00
parent 129b8bb7f1
commit 4b13d99cfe

View File

@ -29,7 +29,7 @@
#include "gtkstyleproviderprivate.h"
#include "gtktypebuiltins.h"
#include "gtkversion.h"
#include "gtkwidget.h"
#include "gtkwidgetprivate.h"
#include "gdk/gdk-private.h"
@ -1246,32 +1246,28 @@ gtk_settings_notify (GObject *object,
case PROP_FONT_NAME:
settings_update_font_values (settings);
settings_invalidate_style (settings);
gtk_style_context_reset_widgets (settings->display);
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_FONT_NAME);
break;
case PROP_THEME_NAME:
case PROP_APPLICATION_PREFER_DARK_THEME:
settings_update_theme (settings);
break;
case PROP_XFT_DPI:
/* This is a hack because with gtk_rc_reset_styles() doesn't get
* widgets with gtk_widget_style_set(), and also causes more
* recomputation than necessary.
*/
gtk_style_context_reset_widgets (settings->display);
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_DPI);
break;
case PROP_XFT_ANTIALIAS:
case PROP_XFT_HINTING:
case PROP_XFT_HINTSTYLE:
case PROP_XFT_RGBA:
settings_update_font_options (settings);
gtk_style_context_reset_widgets (settings->display);
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_FONT_CONFIG);
break;
case PROP_FONTCONFIG_TIMESTAMP:
if (settings_update_fontconfig (settings))
gtk_style_context_reset_widgets (settings->display);
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_FONT_CONFIG);
break;
case PROP_ENABLE_ANIMATIONS:
gtk_style_context_reset_widgets (settings->display);
settings_invalidate_style (settings);
break;
case PROP_CURSOR_THEME_NAME:
case PROP_CURSOR_THEME_SIZE: