diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-06 10:52:19 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-06 10:52:19 +0000 |
commit | 240b198d657b8f6c78ee5d2ce915005ac79fea75 (patch) | |
tree | 42ed188f165eeb4fd22c6510f2c10229f73d43eb | |
parent | 19ac3453e0ed2b3fe458a0f4aeca4883c53b490e (diff) | |
download | rockbox-240b198d657b8f6c78ee5d2ce915005ac79fea75.tar.gz rockbox-240b198d657b8f6c78ee5d2ce915005ac79fea75.zip |
text viewer: can display the horizontal scroll bar.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26620 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/text_viewer/readme.txt | 2 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_menu.c | 51 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_preferences.c | 22 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_preferences.h | 11 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_settings.c | 26 | ||||
-rw-r--r-- | apps/plugins/text_viewer/tv_window.c | 53 |
6 files changed, 107 insertions, 58 deletions
diff --git a/apps/plugins/text_viewer/readme.txt b/apps/plugins/text_viewer/readme.txt index 37ba354a71..0e9bd7ce49 100644 --- a/apps/plugins/text_viewer/readme.txt +++ b/apps/plugins/text_viewer/readme.txt | |||
@@ -48,8 +48,6 @@ TODO list | |||
48 | 48 | ||
49 | - for the horizontal scroll, allow the select scroll by screen/scroll by column for the settings menu. | 49 | - for the horizontal scroll, allow the select scroll by screen/scroll by column for the settings menu. |
50 | 50 | ||
51 | - can display the horizontal scroll bar. | ||
52 | |||
53 | - draw images that are linked to the text. (<img src="...">) | 51 | - draw images that are linked to the text. (<img src="...">) |
54 | 52 | ||
55 | - play audios that are linked to the text. (<audio src="...">) | 53 | - play audios that are linked to the text. (<audio src="...">) |
diff --git a/apps/plugins/text_viewer/tv_menu.c b/apps/plugins/text_viewer/tv_menu.c index e62b2de4be..ff2d6758a4 100644 --- a/apps/plugins/text_viewer/tv_menu.c +++ b/apps/plugins/text_viewer/tv_menu.c | |||
@@ -30,6 +30,42 @@ | |||
30 | 30 | ||
31 | static struct tv_preferences new_prefs; | 31 | static struct tv_preferences new_prefs; |
32 | 32 | ||
33 | /* scrollbar menu */ | ||
34 | #ifdef HAVE_LCD_BITMAP | ||
35 | static bool tv_horizontal_scrollbar_setting(void) | ||
36 | { | ||
37 | static const struct opt_items names[] = { | ||
38 | {"No", -1}, | ||
39 | {"Yes", -1}, | ||
40 | }; | ||
41 | |||
42 | return rb->set_option("Horizontal Scrollbar", &new_prefs.horizontal_scrollbar, INT, | ||
43 | names, 2, NULL); | ||
44 | } | ||
45 | |||
46 | static bool tv_vertical_scrollbar_setting(void) | ||
47 | { | ||
48 | static const struct opt_items names[] = { | ||
49 | {"No", -1}, | ||
50 | {"Yes", -1}, | ||
51 | }; | ||
52 | |||
53 | return rb->set_option("Vertical Scrollbar", &new_prefs.vertical_scrollbar, INT, | ||
54 | names, 2, NULL); | ||
55 | } | ||
56 | |||
57 | MENUITEM_FUNCTION(horizontal_scrollbar_item, 0, "Horizontal", | ||
58 | tv_horizontal_scrollbar_setting, | ||
59 | NULL, NULL, Icon_NOICON); | ||
60 | MENUITEM_FUNCTION(vertical_scrollbar_item, 0, "Vertical", | ||
61 | tv_vertical_scrollbar_setting, | ||
62 | NULL, NULL, Icon_NOICON); | ||
63 | MAKE_MENU(scrollbar_menu, "Scrollbar", NULL, Icon_NOICON, | ||
64 | &horizontal_scrollbar_item, &vertical_scrollbar_item); | ||
65 | #endif | ||
66 | |||
67 | /* main menu */ | ||
68 | |||
33 | static bool tv_encoding_setting(void) | 69 | static bool tv_encoding_setting(void) |
34 | { | 70 | { |
35 | static struct opt_items names[NUM_CODEPAGES]; | 71 | static struct opt_items names[NUM_CODEPAGES]; |
@@ -109,17 +145,6 @@ static bool tv_page_mode_setting(void) | |||
109 | names, 2, NULL); | 145 | names, 2, NULL); |
110 | } | 146 | } |
111 | 147 | ||
112 | static bool tv_scrollbar_setting(void) | ||
113 | { | ||
114 | static const struct opt_items names[] = { | ||
115 | {"Off", -1}, | ||
116 | {"On", -1} | ||
117 | }; | ||
118 | |||
119 | return rb->set_option("Show Scrollbar", &new_prefs.scrollbar_mode, INT, | ||
120 | names, 2, NULL); | ||
121 | } | ||
122 | |||
123 | static bool tv_header_setting(void) | 148 | static bool tv_header_setting(void) |
124 | { | 149 | { |
125 | int len = (rb->global_settings->statusbar == STATUSBAR_TOP)? 4 : 2; | 150 | int len = (rb->global_settings->statusbar == STATUSBAR_TOP)? 4 : 2; |
@@ -272,8 +297,6 @@ MENUITEM_FUNCTION(windows_item, 0, "Screens Per Page", tv_windows_setting, | |||
272 | MENUITEM_FUNCTION(alignment_item, 0, "Alignment", tv_alignment_setting, | 297 | MENUITEM_FUNCTION(alignment_item, 0, "Alignment", tv_alignment_setting, |
273 | NULL, NULL, Icon_NOICON); | 298 | NULL, NULL, Icon_NOICON); |
274 | #ifdef HAVE_LCD_BITMAP | 299 | #ifdef HAVE_LCD_BITMAP |
275 | MENUITEM_FUNCTION(scrollbar_item, 0, "Show Scrollbar", tv_scrollbar_setting, | ||
276 | NULL, NULL, Icon_NOICON); | ||
277 | MENUITEM_FUNCTION(page_mode_item, 0, "Overlap Pages", tv_page_mode_setting, | 300 | MENUITEM_FUNCTION(page_mode_item, 0, "Overlap Pages", tv_page_mode_setting, |
278 | NULL, NULL, Icon_NOICON); | 301 | NULL, NULL, Icon_NOICON); |
279 | MENUITEM_FUNCTION(header_item, 0, "Show Header", tv_header_setting, | 302 | MENUITEM_FUNCTION(header_item, 0, "Show Header", tv_header_setting, |
@@ -291,7 +314,7 @@ MAKE_MENU(option_menu, "Viewer Options", NULL, Icon_NOICON, | |||
291 | &encoding_item, &word_wrap_item, &line_mode_item, &windows_item, | 314 | &encoding_item, &word_wrap_item, &line_mode_item, &windows_item, |
292 | &alignment_item, | 315 | &alignment_item, |
293 | #ifdef HAVE_LCD_BITMAP | 316 | #ifdef HAVE_LCD_BITMAP |
294 | &scrollbar_item, &page_mode_item, &header_item, &footer_item, &font_item, | 317 | &scrollbar_menu, &page_mode_item, &header_item, &footer_item, &font_item, |
295 | #endif | 318 | #endif |
296 | &scroll_mode_item, &autoscroll_speed_item); | 319 | &scroll_mode_item, &autoscroll_speed_item); |
297 | 320 | ||
diff --git a/apps/plugins/text_viewer/tv_preferences.c b/apps/plugins/text_viewer/tv_preferences.c index 777f6afdb9..ad4b0aa12b 100644 --- a/apps/plugins/text_viewer/tv_preferences.c +++ b/apps/plugins/text_viewer/tv_preferences.c | |||
@@ -43,16 +43,17 @@ static void tv_notify_change_preferences(const struct tv_preferences *oldp, | |||
43 | * - font | 43 | * - font |
44 | * - autoscroll_speed | 44 | * - autoscroll_speed |
45 | */ | 45 | */ |
46 | if ((oldp == NULL) || | 46 | if ((oldp == NULL) || |
47 | (oldp->word_mode != newp->word_mode) || | 47 | (oldp->word_mode != newp->word_mode) || |
48 | (oldp->line_mode != newp->line_mode) || | 48 | (oldp->line_mode != newp->line_mode) || |
49 | (oldp->windows != newp->windows) || | 49 | (oldp->windows != newp->windows) || |
50 | (oldp->scrollbar_mode != newp->scrollbar_mode) || | 50 | (oldp->horizontal_scrollbar != newp->horizontal_scrollbar) || |
51 | (oldp->encoding != newp->encoding) || | 51 | (oldp->vertical_scrollbar != newp->vertical_scrollbar) || |
52 | (oldp->encoding != newp->encoding) || | ||
52 | #ifdef HAVE_LCD_BITMAP | 53 | #ifdef HAVE_LCD_BITMAP |
53 | (oldp->header_mode != newp->header_mode) || | 54 | (oldp->header_mode != newp->header_mode) || |
54 | (oldp->footer_mode != newp->footer_mode) || | 55 | (oldp->footer_mode != newp->footer_mode) || |
55 | (rb->strcmp(oldp->font_name, newp->font_name)) || | 56 | (rb->strcmp(oldp->font_name, newp->font_name)) || |
56 | #endif | 57 | #endif |
57 | (rb->strcmp(oldp->file_name, newp->file_name))) | 58 | (rb->strcmp(oldp->file_name, newp->file_name))) |
58 | { | 59 | { |
@@ -95,7 +96,8 @@ void tv_set_default_preferences(struct tv_preferences *p) | |||
95 | p->alignment = LEFT; | 96 | p->alignment = LEFT; |
96 | p->scroll_mode = PAGE; | 97 | p->scroll_mode = PAGE; |
97 | p->page_mode = NO_OVERLAP; | 98 | p->page_mode = NO_OVERLAP; |
98 | p->scrollbar_mode = SB_OFF; | 99 | p->horizontal_scrollbar = SB_OFF; |
100 | p->vertical_scrollbar = SB_OFF; | ||
99 | rb->memset(p->font_name, 0, MAX_PATH); | 101 | rb->memset(p->font_name, 0, MAX_PATH); |
100 | #ifdef HAVE_LCD_BITMAP | 102 | #ifdef HAVE_LCD_BITMAP |
101 | p->header_mode = HD_BOTH; | 103 | p->header_mode = HD_BOTH; |
diff --git a/apps/plugins/text_viewer/tv_preferences.h b/apps/plugins/text_viewer/tv_preferences.h index f74e3d7407..ca02c2b5c9 100644 --- a/apps/plugins/text_viewer/tv_preferences.h +++ b/apps/plugins/text_viewer/tv_preferences.h | |||
@@ -23,6 +23,11 @@ | |||
23 | #ifndef PLUGIN_TEXT_VIEWER_PREFERENCES_H | 23 | #ifndef PLUGIN_TEXT_VIEWER_PREFERENCES_H |
24 | #define PLUGIN_TEXT_VIEWER_PREFERENCES_H | 24 | #define PLUGIN_TEXT_VIEWER_PREFERENCES_H |
25 | 25 | ||
26 | enum scrollbar_mode { | ||
27 | SB_OFF = 0, | ||
28 | SB_ON, | ||
29 | }; | ||
30 | |||
26 | struct tv_preferences { | 31 | struct tv_preferences { |
27 | enum { | 32 | enum { |
28 | WRAP = 0, | 33 | WRAP = 0, |
@@ -43,10 +48,8 @@ struct tv_preferences { | |||
43 | 48 | ||
44 | enum codepages encoding; | 49 | enum codepages encoding; |
45 | 50 | ||
46 | enum { | 51 | enum scrollbar_mode horizontal_scrollbar; |
47 | SB_OFF = 0, | 52 | enum scrollbar_mode vertical_scrollbar; |
48 | SB_ON, | ||
49 | } scrollbar_mode; | ||
50 | 53 | ||
51 | enum { | 54 | enum { |
52 | NO_OVERLAP = 0, | 55 | NO_OVERLAP = 0, |
diff --git a/apps/plugins/text_viewer/tv_settings.c b/apps/plugins/text_viewer/tv_settings.c index 3b9a684b94..bf6ae1e74a 100644 --- a/apps/plugins/text_viewer/tv_settings.c +++ b/apps/plugins/text_viewer/tv_settings.c | |||
@@ -39,14 +39,15 @@ | |||
39 | * windows 1 (when version <= 0x32, this value is view_mode) | 39 | * windows 1 (when version <= 0x32, this value is view_mode) |
40 | * alignment 1 | 40 | * alignment 1 |
41 | * encoding 1 | 41 | * encoding 1 |
42 | * scrollbar_mode 1 | 42 | * vertical_scrollbar 1 |
43 | * (unused) 1 (for compatibility) | 43 | * (unused) 1 (for compatibility) |
44 | * page_mode 1 | 44 | * page_mode 1 |
45 | * page_number_mode 1 | 45 | * page_number_mode 1 |
46 | * title_mode 1 | 46 | * title_mode 1 |
47 | * scroll_mode 1 | 47 | * scroll_mode 1 |
48 | * autoscroll_speed 1 | 48 | * autoscroll_speed 1 |
49 | * (reserved) 16 | 49 | * horizontal_scrollbar 1 |
50 | * (reserved) 15 | ||
50 | * font name MAX_PATH | 51 | * font name MAX_PATH |
51 | */ | 52 | */ |
52 | 53 | ||
@@ -54,7 +55,7 @@ | |||
54 | #define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat" | 55 | #define TV_GLOBAL_SETTINGS_FILE VIEWERS_DIR "/tv_global.dat" |
55 | 56 | ||
56 | #define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */ | 57 | #define TV_GLOBAL_SETTINGS_HEADER "\x54\x56\x47\x53" /* "TVGS" */ |
57 | #define TV_GLOBAL_SETTINGS_VERSION 0x33 | 58 | #define TV_GLOBAL_SETTINGS_VERSION 0x34 |
58 | #define TV_GLOBAL_SETTINGS_HEADER_SIZE 5 | 59 | #define TV_GLOBAL_SETTINGS_HEADER_SIZE 5 |
59 | #define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31 | 60 | #define TV_GLOBAL_SETTINGS_FIRST_VERSION 0x31 |
60 | 61 | ||
@@ -77,14 +78,15 @@ | |||
77 | * windows 1 (when version <= 0x33, this value is view_mode) | 78 | * windows 1 (when version <= 0x33, this value is view_mode) |
78 | * alignment 1 | 79 | * alignment 1 |
79 | * encoding 1 | 80 | * encoding 1 |
80 | * scrollbar_mode 1 | 81 | * vertical_scrollbar 1 |
81 | * (unused) 1 (for compatibility) | 82 | * (unused) 1 (for compatibility) |
82 | * page_mode 1 | 83 | * page_mode 1 |
83 | * header_mode 1 | 84 | * header_mode 1 |
84 | * footer_mode 1 | 85 | * footer_mode 1 |
85 | * scroll_mode 1 | 86 | * scroll_mode 1 |
86 | * autoscroll_speed 1 | 87 | * autoscroll_speed 1 |
87 | * (reserved) 16 | 88 | * horizontal_scrollbar 1 |
89 | * (reserved) 15 | ||
88 | * font name MAX_PATH | 90 | * font name MAX_PATH |
89 | * bookmark count 1 | 91 | * bookmark count 1 |
90 | * [1st bookmark] | 92 | * [1st bookmark] |
@@ -106,7 +108,7 @@ | |||
106 | #define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp" | 108 | #define TV_SETTINGS_TMP_FILE VIEWERS_DIR "/tv_file.tmp" |
107 | 109 | ||
108 | #define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */ | 110 | #define TV_SETTINGS_HEADER "\x54\x56\x53" /* "TVS" */ |
109 | #define TV_SETTINGS_VERSION 0x34 | 111 | #define TV_SETTINGS_VERSION 0x35 |
110 | #define TV_SETTINGS_HEADER_SIZE 4 | 112 | #define TV_SETTINGS_HEADER_SIZE 4 |
111 | #define TV_SETTINGS_FIRST_VERSION 0x32 | 113 | #define TV_SETTINGS_FIRST_VERSION 0x32 |
112 | 114 | ||
@@ -143,8 +145,8 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre | |||
143 | else | 145 | else |
144 | prefs->alignment = LEFT; | 146 | prefs->alignment = LEFT; |
145 | 147 | ||
146 | prefs->encoding = *p++; | 148 | prefs->encoding = *p++; |
147 | prefs->scrollbar_mode = *p++; | 149 | prefs->vertical_scrollbar = *p++; |
148 | /* skip need_scrollbar */ | 150 | /* skip need_scrollbar */ |
149 | p++; | 151 | p++; |
150 | prefs->page_mode = *p++; | 152 | prefs->page_mode = *p++; |
@@ -153,6 +155,11 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre | |||
153 | prefs->scroll_mode = *p++; | 155 | prefs->scroll_mode = *p++; |
154 | prefs->autoscroll_speed = *p++; | 156 | prefs->autoscroll_speed = *p++; |
155 | 157 | ||
158 | if (version > 2) | ||
159 | prefs->horizontal_scrollbar = *p; | ||
160 | else | ||
161 | prefs->horizontal_scrollbar = SB_OFF; | ||
162 | |||
156 | rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); | 163 | rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); |
157 | 164 | ||
158 | #ifdef HAVE_LCD_BITMAP | 165 | #ifdef HAVE_LCD_BITMAP |
@@ -172,7 +179,7 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs) | |||
172 | *p++ = prefs->windows; | 179 | *p++ = prefs->windows; |
173 | *p++ = prefs->alignment; | 180 | *p++ = prefs->alignment; |
174 | *p++ = prefs->encoding; | 181 | *p++ = prefs->encoding; |
175 | *p++ = prefs->scrollbar_mode; | 182 | *p++ = prefs->vertical_scrollbar; |
176 | /* skip need_scrollbar */ | 183 | /* skip need_scrollbar */ |
177 | p++; | 184 | p++; |
178 | *p++ = prefs->page_mode; | 185 | *p++ = prefs->page_mode; |
@@ -180,6 +187,7 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs) | |||
180 | *p++ = prefs->footer_mode; | 187 | *p++ = prefs->footer_mode; |
181 | *p++ = prefs->scroll_mode; | 188 | *p++ = prefs->scroll_mode; |
182 | *p++ = prefs->autoscroll_speed; | 189 | *p++ = prefs->autoscroll_speed; |
190 | *p++ = prefs->horizontal_scrollbar; | ||
183 | 191 | ||
184 | rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); | 192 | rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); |
185 | 193 | ||
diff --git a/apps/plugins/text_viewer/tv_window.c b/apps/plugins/text_viewer/tv_window.c index bf27e2cfd5..72faf23565 100644 --- a/apps/plugins/text_viewer/tv_window.c +++ b/apps/plugins/text_viewer/tv_window.c | |||
@@ -27,7 +27,8 @@ | |||
27 | #include "tv_text_reader.h" | 27 | #include "tv_text_reader.h" |
28 | #include "tv_window.h" | 28 | #include "tv_window.h" |
29 | 29 | ||
30 | #define TV_SCROLLBAR_WIDTH rb->global_settings->scrollbar_width | 30 | #define TV_SCROLLBAR_WIDTH rb->global_settings->scrollbar_width |
31 | #define TV_SCROLLBAR_HEIGHT 4 | ||
31 | 32 | ||
32 | #ifndef HAVE_LCD_BITMAP | 33 | #ifndef HAVE_LCD_BITMAP |
33 | #define TV_BOOKMARK_ICON 0xe101 | 34 | #define TV_BOOKMARK_ICON 0xe101 |
@@ -36,7 +37,7 @@ | |||
36 | #ifdef HAVE_LCD_BITMAP | 37 | #ifdef HAVE_LCD_BITMAP |
37 | static int header_height; | 38 | static int header_height; |
38 | static int footer_height; | 39 | static int footer_height; |
39 | static bool need_scrollbar = false; | 40 | static bool need_vertical_scrollbar = false; |
40 | #endif | 41 | #endif |
41 | 42 | ||
42 | static int start_width; | 43 | static int start_width; |
@@ -123,27 +124,41 @@ static void tv_show_scrollbar(off_t cur_pos, int size) | |||
123 | int items; | 124 | int items; |
124 | int min_shown; | 125 | int min_shown; |
125 | int max_shown; | 126 | int max_shown; |
126 | int sb_begin_y; | 127 | int sb_width; |
127 | int sb_height; | 128 | int sb_height; |
128 | 129 | ||
129 | if (!need_scrollbar) | 130 | sb_height = LCD_HEIGHT - header_height - footer_height; |
130 | return; | 131 | if (prefs->horizontal_scrollbar) |
131 | 132 | { | |
132 | items = (int) tv_get_total_text_size(); | 133 | items = prefs->windows * window_columns; |
133 | min_shown = (int) cur_pos; | 134 | min_shown = cur_window * window_columns + cur_column; |
134 | 135 | max_shown = min_shown + window_columns; | |
135 | max_shown = min_shown + size; | 136 | sb_width = (need_vertical_scrollbar)? TV_SCROLLBAR_WIDTH : 0; |
137 | sb_height -= TV_SCROLLBAR_HEIGHT; | ||
138 | |||
139 | rb->gui_scrollbar_draw(rb->screens[SCREEN_MAIN], | ||
140 | sb_width, | ||
141 | LCD_HEIGHT - footer_height - TV_SCROLLBAR_HEIGHT, | ||
142 | LCD_WIDTH - sb_width, TV_SCROLLBAR_HEIGHT, | ||
143 | items, min_shown, max_shown, HORIZONTAL); | ||
144 | } | ||
136 | 145 | ||
137 | sb_begin_y = header_height; | 146 | if (need_vertical_scrollbar) |
138 | sb_height = LCD_HEIGHT - header_height - footer_height; | 147 | { |
148 | items = (int) tv_get_total_text_size(); | ||
149 | min_shown = (int) cur_pos; | ||
150 | max_shown = min_shown + size; | ||
139 | 151 | ||
140 | rb->gui_scrollbar_draw(rb->screens[SCREEN_MAIN],0, sb_begin_y, | 152 | rb->gui_scrollbar_draw(rb->screens[SCREEN_MAIN], 0, header_height, |
141 | TV_SCROLLBAR_WIDTH-1, sb_height, | 153 | TV_SCROLLBAR_WIDTH-1, sb_height, |
142 | items, min_shown, max_shown, VERTICAL); | 154 | items, min_shown, max_shown, VERTICAL); |
155 | } | ||
143 | } | 156 | } |
144 | 157 | ||
145 | static int tv_calc_display_lines(void) | 158 | static int tv_calc_display_lines(void) |
146 | { | 159 | { |
160 | int scrollbar_height = (prefs->horizontal_scrollbar)? TV_SCROLLBAR_HEIGHT : 0; | ||
161 | |||
147 | header_height = (prefs->header_mode == HD_SBAR || prefs->header_mode == HD_BOTH)? | 162 | header_height = (prefs->header_mode == HD_SBAR || prefs->header_mode == HD_BOTH)? |
148 | STATUSBAR_HEIGHT : 0; | 163 | STATUSBAR_HEIGHT : 0; |
149 | 164 | ||
@@ -160,7 +175,7 @@ static int tv_calc_display_lines(void) | |||
160 | if (prefs->footer_mode == FT_PAGE || prefs->footer_mode == FT_BOTH) | 175 | if (prefs->footer_mode == FT_PAGE || prefs->footer_mode == FT_BOTH) |
161 | footer_height += prefs->font->height; | 176 | footer_height += prefs->font->height; |
162 | 177 | ||
163 | return (LCD_HEIGHT - header_height - footer_height) / prefs->font->height; | 178 | return (LCD_HEIGHT - header_height - footer_height - scrollbar_height) / prefs->font->height; |
164 | } | 179 | } |
165 | #endif | 180 | #endif |
166 | 181 | ||
@@ -314,13 +329,13 @@ static void tv_change_preferences(const struct tv_preferences *oldp) | |||
314 | 329 | ||
315 | window_width = LCD_WIDTH; | 330 | window_width = LCD_WIDTH; |
316 | #ifdef HAVE_LCD_BITMAP | 331 | #ifdef HAVE_LCD_BITMAP |
317 | need_scrollbar = false; | 332 | need_vertical_scrollbar = false; |
318 | start_width = 0; | 333 | start_width = 0; |
319 | tv_seek_top(); | 334 | tv_seek_top(); |
320 | tv_set_read_conditions(prefs->windows, window_width); | 335 | tv_set_read_conditions(prefs->windows, window_width); |
321 | if (tv_traverse_lines() && prefs->scrollbar_mode) | 336 | if (tv_traverse_lines() && prefs->vertical_scrollbar) |
322 | { | 337 | { |
323 | need_scrollbar = true; | 338 | need_vertical_scrollbar = true; |
324 | start_width = TV_SCROLLBAR_WIDTH; | 339 | start_width = TV_SCROLLBAR_WIDTH; |
325 | } | 340 | } |
326 | tv_seek_top(); | 341 | tv_seek_top(); |