[devhelp] Preferences: better bind the custom_fonts_grid "sensitive" property
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] Preferences: better bind the custom_fonts_grid "sensitive" property
- Date: Thu, 5 Apr 2018 18:31:41 +0000 (UTC)
commit 7a3e4b3392e893a8eb17c5eb4085ea313a6d2d0d
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Apr 5 20:06:35 2018 +0200
Preferences: better bind the custom_fonts_grid "sensitive" property
g_settings_bind() binds also the writability of the gsetting key to the
"sensitive" property. It could have been avoided with
G_SETTINGS_BIND_NO_SENSITIVITY, but g_object_bind_property() works too.
src/dh-preferences.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/dh-preferences.c b/src/dh-preferences.c
index cd8911e..cde2589 100644
--- a/src/dh-preferences.c
+++ b/src/dh-preferences.c
@@ -621,9 +621,11 @@ dh_preferences_init (DhPreferences *prefs)
priv->use_system_fonts_checkbutton, "active",
G_SETTINGS_BIND_DEFAULT);
- g_settings_bind (fonts_settings, "use-system-fonts",
- priv->custom_fonts_grid, "sensitive",
- G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_INVERT_BOOLEAN);
+ g_object_bind_property (priv->use_system_fonts_checkbutton, "active",
+ priv->custom_fonts_grid, "sensitive",
+ G_BINDING_DEFAULT |
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_INVERT_BOOLEAN);
g_settings_bind (fonts_settings, "variable-font",
priv->variable_font_button, "font",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]