diff options
Diffstat (limited to 'apps/plugins/text_viewer/tv_window.c')
-rw-r--r-- | apps/plugins/text_viewer/tv_window.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/apps/plugins/text_viewer/tv_window.c b/apps/plugins/text_viewer/tv_window.c index df3951aa28..16be8845ef 100644 --- a/apps/plugins/text_viewer/tv_window.c +++ b/apps/plugins/text_viewer/tv_window.c | |||
@@ -52,40 +52,6 @@ static bool tv_set_font(const unsigned char *font) | |||
52 | } | 52 | } |
53 | return true; | 53 | return true; |
54 | } | 54 | } |
55 | |||
56 | static bool tv_check_header_and_footer(struct tv_preferences *new_prefs) | ||
57 | { | ||
58 | bool change_prefs = false; | ||
59 | |||
60 | if (rb->global_settings->statusbar != STATUSBAR_TOP) | ||
61 | { | ||
62 | if (new_prefs->header_mode == HD_SBAR) | ||
63 | { | ||
64 | new_prefs->header_mode = HD_NONE; | ||
65 | change_prefs = true; | ||
66 | } | ||
67 | else if (new_prefs->header_mode == HD_BOTH) | ||
68 | { | ||
69 | new_prefs->header_mode = HD_PATH; | ||
70 | change_prefs = true; | ||
71 | } | ||
72 | } | ||
73 | if (rb->global_settings->statusbar != STATUSBAR_BOTTOM) | ||
74 | { | ||
75 | if (new_prefs->footer_mode == FT_SBAR) | ||
76 | { | ||
77 | new_prefs->footer_mode = FT_NONE; | ||
78 | change_prefs = true; | ||
79 | } | ||
80 | else if (new_prefs->footer_mode == FT_BOTH) | ||
81 | { | ||
82 | new_prefs->footer_mode = FT_PAGE; | ||
83 | change_prefs = true; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | return change_prefs; | ||
88 | } | ||
89 | #endif | 55 | #endif |
90 | 56 | ||
91 | static void tv_show_bookmarks(const struct tv_screen_pos *top_pos) | 57 | static void tv_show_bookmarks(const struct tv_screen_pos *top_pos) |
@@ -177,7 +143,6 @@ static void tv_change_preferences(const struct tv_preferences *oldp) | |||
177 | #else | 143 | #else |
178 | static bool font_changing = false; | 144 | static bool font_changing = false; |
179 | const unsigned char *font_str; | 145 | const unsigned char *font_str; |
180 | bool change_prefs = false; | ||
181 | bool need_vertical_scrollbar; | 146 | bool need_vertical_scrollbar; |
182 | struct tv_preferences new_prefs; | 147 | struct tv_preferences new_prefs; |
183 | tv_copy_preferences(&new_prefs); | 148 | tv_copy_preferences(&new_prefs); |
@@ -191,16 +156,11 @@ static void tv_change_preferences(const struct tv_preferences *oldp) | |||
191 | if (!tv_set_font(preferences->font_name)) | 156 | if (!tv_set_font(preferences->font_name)) |
192 | { | 157 | { |
193 | rb->strlcpy(new_prefs.font_name, font_str, MAX_PATH); | 158 | rb->strlcpy(new_prefs.font_name, font_str, MAX_PATH); |
194 | change_prefs = true; | 159 | tv_set_preferences(&new_prefs); |
160 | return; | ||
195 | } | 161 | } |
196 | } | 162 | } |
197 | 163 | ||
198 | if (tv_check_header_and_footer(&new_prefs) || change_prefs) | ||
199 | { | ||
200 | tv_set_preferences(&new_prefs); | ||
201 | return; | ||
202 | } | ||
203 | |||
204 | font_changing = false; | 164 | font_changing = false; |
205 | #endif | 165 | #endif |
206 | 166 | ||