about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_funcs.c24
-rw-r--r--src/config/theme.c19
2 files changed, 20 insertions, 23 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 97782e64..c8c79e0c 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -5529,8 +5529,7 @@ cmd_titlebar(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_titlebar_pos_up();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Title bar moved up.");
         } else {
             cons_show("Could not move title bar up.");
         }
@@ -5541,8 +5540,7 @@ cmd_titlebar(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_titlebar_pos_down();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Title bar moved down.");
         } else {
             cons_show("Could not move title bar down.");
         }
@@ -5562,8 +5560,7 @@ cmd_mainwin(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_mainwin_pos_up();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Main window moved up.");
         } else {
             cons_show("Could not move main window up.");
         }
@@ -5574,8 +5571,7 @@ cmd_mainwin(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_mainwin_pos_down();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Main window moved down.");
         } else {
             cons_show("Could not move main window down.");
         }
@@ -5595,8 +5591,7 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_statusbar_pos_up();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Status bar moved up");
         } else {
             cons_show("Could not move status bar up.");
         }
@@ -5607,8 +5602,7 @@ cmd_statusbar(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_statusbar_pos_down();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Status bar moved down.");
         } else {
             cons_show("Could not move status bar down.");
         }
@@ -5628,8 +5622,7 @@ cmd_inputwin(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_inputwin_pos_up();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Input window moved up.");
         } else {
             cons_show("Could not move input window up.");
         }
@@ -5640,8 +5633,7 @@ cmd_inputwin(ProfWin *window, const char *const command, gchar **args)
         gboolean result = prefs_inputwin_pos_down();
         if (result) {
             ui_resize();
-            cons_winpos_setting();
-            cons_show("");
+            cons_show("Input window moved down.");
         } else {
             cons_show("Could not move input window down.");
         }
diff --git a/src/config/theme.c b/src/config/theme.c
index cee95883..44c9c3ff 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -531,13 +531,18 @@ _load_preferences(void)
         }
     }
 
-    int titlebar_pos = g_key_file_get_integer(theme, "ui", "titlebar.position", NULL);
-    int mainwin_pos = g_key_file_get_integer(theme, "ui", "mainwin.position", NULL);
-    int statusbar_pos = g_key_file_get_integer(theme, "ui", "statusbar.position", NULL);
-    int inputwin_pos = g_key_file_get_integer(theme, "ui", "inputwin.position", NULL);
-    ProfWinPlacement *placement = prefs_create_profwin_placement(titlebar_pos, mainwin_pos, statusbar_pos, inputwin_pos);
-    prefs_save_win_placement(placement);
-    prefs_free_win_placement(placement);
+    if (g_key_file_has_key(theme, "ui", "titlebar.position", NULL) &&
+            g_key_file_has_key(theme, "ui", "mainwin.position", NULL) &&
+            g_key_file_has_key(theme, "ui", "statusbar.position", NULL) &&
+            g_key_file_has_key(theme, "ui", "inputwin.position", NULL)) {
+        int titlebar_pos = g_key_file_get_integer(theme, "ui", "titlebar.position", NULL);
+        int mainwin_pos = g_key_file_get_integer(theme, "ui", "mainwin.position", NULL);
+        int statusbar_pos = g_key_file_get_integer(theme, "ui", "statusbar.position", NULL);
+        int inputwin_pos = g_key_file_get_integer(theme, "ui", "inputwin.position", NULL);
+        ProfWinPlacement *placement = prefs_create_profwin_placement(titlebar_pos, mainwin_pos, statusbar_pos, inputwin_pos);
+        prefs_save_win_placement(placement);
+        prefs_free_win_placement(placement);
+    }
 }
 
 void