diff options
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/preferences.c | 22 | ||||
-rw-r--r-- | src/config/preferences.h | 2 | ||||
-rw-r--r-- | src/config/theme.c | 5 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index 19d54304..30cd34c2 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -750,6 +750,28 @@ prefs_get_occupants_size(void) } } +gint +prefs_get_occupants_indent(void) +{ + if (!g_key_file_has_key(prefs, PREF_GROUP_UI, "occupants.indent", NULL)) { + return 2; + } + + gint result = g_key_file_get_integer(prefs, PREF_GROUP_UI, "occupants.indent", NULL); + if (result < 0) { + result = 0; + } + + return result; +} + +void +prefs_set_occupants_indent(gint value) +{ + g_key_file_set_integer(prefs, PREF_GROUP_UI, "occupants.indent", value); + _save_prefs(); +} + void prefs_set_roster_size(gint value) { diff --git a/src/config/preferences.h b/src/config/preferences.h index 614c3f0f..bfd7b3ec 100644 --- a/src/config/preferences.h +++ b/src/config/preferences.h @@ -246,6 +246,8 @@ gint prefs_get_roster_resource_indent(void); void prefs_set_roster_resource_indent(gint value); gint prefs_get_roster_presence_indent(void); void prefs_set_roster_presence_indent(gint value); +gint prefs_get_occupants_indent(void); +void prefs_set_occupants_indent(gint value); void prefs_add_login(const char *jid); diff --git a/src/config/theme.c b/src/config/theme.c index a94cfb21..4e385ead 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -452,6 +452,11 @@ _load_preferences(void) prefs_set_occupants_size(occupants_size); } + if (g_key_file_has_key(theme, "ui", "occupants.indent", NULL)) { + gint occupants_indent = g_key_file_get_integer(theme, "ui", "occupants.indent", NULL); + prefs_set_occupants_indent(occupants_indent); + } + if (g_key_file_has_key(theme, "ui", "roster.size", NULL)) { gint roster_size = g_key_file_get_integer(theme, "ui", "roster.size", NULL); prefs_set_roster_size(roster_size); |