about summary refs log tree commit diff stats
path: root/src/config/theme.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/theme.c')
-rw-r--r--src/config/theme.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/config/theme.c b/src/config/theme.c
index 72d5ef0b..6d3c5938 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -130,18 +130,33 @@ static void _load_preferences(void);
 static gchar * _get_themes_dir(void);
 void _theme_list_dir(const gchar * const dir, GSList **result);
 static GString * _theme_find(const char * const theme_name);
+static gboolean _theme_load_file(const char * const theme_name);
 
 void
 theme_init(const char * const theme_name)
 {
-    if (!theme_load(theme_name) && !theme_load("default")) {
+    if (!_theme_load_file(theme_name) && !_theme_load_file("default")) {
         log_error("Theme initialisation failed");
+    } else {
+        _load_colours();
     }
 }
 
 gboolean
 theme_load(const char * const theme_name)
 {
+    if (_theme_load_file(theme_name)) {
+        _load_colours();
+        _load_preferences();
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+static gboolean
+_theme_load_file(const char * const theme_name)
+{
     // use default theme
     if (theme_name == NULL || strcmp(theme_name, "default") == 0) {
         if (theme != NULL) {
@@ -170,8 +185,6 @@ theme_load(const char * const theme_name)
             NULL);
     }
 
-    _load_colours();
-    _load_preferences();
     return TRUE;
 }
 
2 -0800 7311' href='/akkartik/mu/commit/html/407print-int32-decimal-right-justified.mu.html?h=hlt&id=8bb5d26cf13efae2574cd8a2afea1812f4216539'>8bb5d26c ^
3d1c4216 ^
d3a9db3a ^


3d1c4216 ^
d3a9db3a ^


2c56af2d ^
d3a9db3a ^
d3a9db3a ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76