Skip to content

Commit c742c36

Browse files
Added full screen mode (ability to hide the top bar)
1 parent a57b40a commit c742c36

File tree

7 files changed

+27
-9
lines changed

7 files changed

+27
-9
lines changed

include/variables.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extern bool var_high_resolution_mode;
1212
extern bool var_use_experimental_sslc;
1313
extern bool var_use_experimental_sslc_changed;
1414
extern bool var_show_fps;
15+
extern bool var_full_screen_mode;
1516
extern u8 var_wifi_state;
1617
extern u8 var_wifi_signal;
1718
extern u8 var_battery_charge;

romfs/gfx/msg/string_resources_en.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<TIME_TO_TURN_OFF_LCD>Time to turn off the LCD</TIME_TO_TURN_OFF_LCD>
5858
<NEVER_TURN_OFF>Never turn off</NEVER_TURN_OFF>
5959
<ECO_MODE>Eco mode</ECO_MODE>
60+
<FULL_SCREEN_MODE>Full screen mode</FULL_SCREEN_MODE>
6061
<DARK_THEME>Dark theme</DARK_THEME>
6162
<FLASH>Flash</FLASH>
6263
<USE_EXPERIMENTAL_SSLC>Use experimental sslc</USE_EXPERIMENTAL_SSLC>

romfs/gfx/msg/string_resources_ja.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<TIME_TO_TURN_OFF_LCD>画面自動オフまでの時間</TIME_TO_TURN_OFF_LCD>
5858
<NEVER_TURN_OFF>自動オフしない</NEVER_TURN_OFF>
5959
<ECO_MODE>エコモード</ECO_MODE>
60+
<FULL_SCREEN_MODE>フルスクリーンモード</FULL_SCREEN_MODE>
6061
<DARK_THEME>ダークモード</DARK_THEME>
6162
<FLASH>点滅</FLASH>
6263
<USE_EXPERIMENTAL_SSLC>試験的なsslcを使用</USE_EXPERIMENTAL_SSLC>

source/scenes/setting_menu.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ void Sem_init(void)
144144
save_settings_request = true;
145145
}
146146
}),
147+
// Eco mode
148+
(new SelectorView(0, 0, 320, 35))
149+
->set_texts({
150+
(std::function<std::string ()>) []() { return LOCALIZED(OFF); },
151+
(std::function<std::string ()>) []() { return LOCALIZED(ON); }
152+
}, var_full_screen_mode)
153+
->set_title([](const SelectorView &) { return LOCALIZED(FULL_SCREEN_MODE); })
154+
->set_on_change([](const SelectorView &view) {
155+
if (var_full_screen_mode != view.selected_button) {
156+
var_full_screen_mode = view.selected_button;
157+
save_settings_request = true;
158+
}
159+
}),
147160
// Dark theme (plus flash)
148161
(new SelectorView(0, 0, 320, 35))
149162
->set_texts({

source/scenes/video_player.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -853,14 +853,6 @@ static void decode_thread(void* arg)
853853
vid_width += 16 - vid_width % 16;
854854
if(vid_height % 16 != 0)
855855
vid_height += 16 - vid_height % 16;
856-
857-
//fit to screen size
858-
while(((vid_width * vid_zoom) > 400 || (vid_height * vid_zoom) > 225) && vid_zoom > 0.05)
859-
vid_zoom -= 0.001;
860-
861-
vid_x = (400 - (vid_width * vid_zoom)) / 2;
862-
vid_y = (225 - (vid_height * vid_zoom)) / 2;
863-
vid_y += 15;
864856
}
865857
}
866858

@@ -1562,6 +1554,13 @@ Intent VideoPlayer_draw(void)
15621554

15631555
thumbnail_set_active_scene(SceneType::VIDEO_PLAYER);
15641556

1557+
//fit to screen size
1558+
vid_zoom = std::min(400.0 / vid_width, (var_full_screen_mode ? 240.0 : 225.0) / vid_height);
1559+
vid_zoom = std::min(10.0, std::max(0.05, vid_zoom));
1560+
vid_x = (400 - (vid_width * vid_zoom)) / 2;
1561+
vid_y = ((var_full_screen_mode ? 240 : 225) - (vid_height * vid_zoom)) / 2;
1562+
if (!var_full_screen_mode) vid_y += 15;
1563+
15651564
bool video_playing_bar_show = video_is_playing();
15661565

15671566
if(var_need_reflesh || !var_eco_mode)
@@ -1587,7 +1586,7 @@ Intent VideoPlayer_draw(void)
15871586
if(Util_log_query_log_show_flag())
15881587
Util_log_draw();
15891588

1590-
Draw_top_ui();
1589+
if (!var_full_screen_mode || !network_decoder.ready) Draw_top_ui();
15911590
caption_overlay_view->cur_timestamp = vid_current_pos;
15921591
caption_overlay_view->draw();
15931592

source/system/util/settings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void load_settings() {
3131
var_time_to_turn_off_lcd = load_int("time_to_turn_off_lcd", 150);
3232
if (var_time_to_turn_off_lcd < 10) var_time_to_turn_off_lcd = 150;
3333
var_eco_mode = load_int("eco_mode", 1);
34+
var_full_screen_mode = load_int("full_screen_mode", 0);
3435
var_night_mode = load_int("dark_theme", 0);
3536
var_flash_mode = load_int("dark_theme_flash", 0);
3637
var_use_experimental_sslc = var_use_experimental_sslc_changed = load_int("use_experimental_sslc", 0);
@@ -46,6 +47,7 @@ void save_settings() {
4647
"<lcd_brightness>" + std::to_string(var_lcd_brightness) + "</lcd_brightness>\n" +
4748
"<time_to_turn_off_lcd>" + std::to_string(var_time_to_turn_off_lcd) + "</time_to_turn_off_lcd>\n" +
4849
"<eco_mode>" + std::to_string(var_eco_mode) + "</eco_mode>\n" +
50+
"<full_screen_mode>" + std::to_string(var_full_screen_mode) + "</full_screen_mode>\n" +
4951
"<dark_theme>" + std::to_string(var_night_mode) + "</dark_theme>\n" +
5052
"<dark_theme_flash>" + std::to_string(var_flash_mode) + "</dark_theme_flash>\n" +
5153
"<use_experimental_sslc>" + std::to_string(var_use_experimental_sslc_changed) + "</use_experimental_sslc>\n";

source/variables.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ bool var_high_resolution_mode = true;
1212
bool var_use_experimental_sslc = true;
1313
bool var_use_experimental_sslc_changed = true;
1414
bool var_show_fps = false;
15+
bool var_full_screen_mode = false;
1516
u8 var_wifi_state = 0;
1617
u8 var_wifi_signal = 0;
1718
u8 var_battery_charge = 0;

0 commit comments

Comments
 (0)