summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/text_viewer/tv_window.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/plugins/text_viewer/tv_window.c b/apps/plugins/text_viewer/tv_window.c
index 36fbb92..1ffc921 100644
--- a/apps/plugins/text_viewer/tv_window.c
+++ b/apps/plugins/text_viewer/tv_window.c
@@ -282,31 +282,25 @@ static void tv_change_preferences(const struct tv_preferences *oldp)
const unsigned char *font_str;
font_str = (oldp && !font_changing)? oldp->font_name : rb->global_settings->font_file;
- font_changing = true;
/* change font */
- if (rb->strcmp(font_str, prefs->font_name))
+ if (font_changing || rb->strcmp(font_str, prefs->font_name))
{
+ font_changing = true;
if (!tv_set_font(prefs->font_name))
{
struct tv_preferences new_prefs = *prefs;
rb->strlcpy(new_prefs.font_name, font_str, MAX_PATH);
tv_set_preferences(&new_prefs);
+ return;
}
}
- else if (!oldp || font_changing)
- tv_set_font(font_str);
+ font_changing = false;
/* calculates display lines */
tv_check_header_and_footer();
display_lines = tv_calc_display_lines();
-
- /* if font_changing == false, the remaining processes need not be executed. */
- if (!font_changing)
- return;
-
- font_changing = false;
#else
(void)oldp;