From 59046e96cc8c773018ec0b789f2bae1ba7da7bfd Mon Sep 17 00:00:00 2001 From: Shin-Ra <29264822+shin-ra@users.noreply.github.com> Date: Thu, 18 Apr 2024 00:27:38 -0300 Subject: [PATCH] Added a hidden state to the menu (#122) --- subs2srs.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/subs2srs.lua b/subs2srs.lua index 7eff85c..2f10e4b 100644 --- a/subs2srs.lua +++ b/subs2srs.lua @@ -436,7 +436,7 @@ end -- main menu menu = Menu:new { - hints_state = switch.new { 'hidden', 'menu', 'global', }, + hints_state = switch.new { 'basic', 'menu', 'global', 'hidden', }, } menu.keybindings = { @@ -459,6 +459,9 @@ menu.keybindings = { } function menu:print_header(osd) + if self.hints_state.get() == 'hidden' then + return + end osd:submenu('mpvacious options'):newline() osd:item('Timings: '):text(h.human_readable_time(subs_observer.get_timing('start'))) osd:item(' to '):text(h.human_readable_time(subs_observer.get_timing('end'))):newline() @@ -476,7 +479,7 @@ function menu:print_bindings(osd) osd:tab():item('ctrl+shift+h: '):text('Replay current subtitle'):newline() osd:tab():item('shift+h/l: '):text('Seek to the previous/next subtitle'):newline() osd:tab():item('alt+h/l: '):text('Seek to the previous/next subtitle and pause'):newline() - osd:italics("Press "):item('i'):italics(" to hide bindings."):newline() + osd:italics("Press "):item('i'):italics(" to hide mpvacious options."):newline() elseif self.hints_state.get() == 'menu' then osd:submenu('Menu bindings'):newline() osd:tab():item('c: '):text('Set timings to the current sub'):newline() @@ -493,6 +496,8 @@ function menu:print_bindings(osd) osd:tab():item('p: '):text('Switch to next profile'):newline() osd:tab():item('ESC: '):text('Close'):newline() osd:italics("Press "):item('i'):italics(" to show global bindings."):newline() + elseif self.hints_state.get() == 'hidden' then + -- Menu bindings are active but hidden else osd:italics("Press "):item('i'):italics(" to show menu bindings."):newline() end