diff --git a/src/bin/edit/draw_menubar.rs b/src/bin/edit/draw_menubar.rs index 560a76651e2..d253e16213e 100644 --- a/src/bin/edit/draw_menubar.rs +++ b/src/bin/edit/draw_menubar.rs @@ -109,8 +109,8 @@ fn draw_menu_view(ctx: &mut Context, state: &mut State) { if ctx.menubar_menu_button(loc(LocId::ViewFocusStatusbar), 'S', vk::NULL) { state.wants_statusbar_focus = true; } - if ctx.menubar_menu_button(loc(LocId::ViewDocumentPicker), 'P', kbmod::CTRL | vk::P) { - state.wants_document_picker = true; + if ctx.menubar_menu_button(loc(LocId::ViewGoToFile), 'F', kbmod::CTRL | vk::P) { + state.wants_go_to_file = true; } if ctx.menubar_menu_button(loc(LocId::FileGoto), 'G', kbmod::CTRL | vk::G) { state.wants_goto = true; diff --git a/src/bin/edit/draw_statusbar.rs b/src/bin/edit/draw_statusbar.rs index f180a28f446..f7a631ace12 100644 --- a/src/bin/edit/draw_statusbar.rs +++ b/src/bin/edit/draw_statusbar.rs @@ -184,7 +184,7 @@ pub fn draw_statusbar(ctx: &mut Context, state: &mut State) { filename = &filename_buf; } - state.wants_document_picker |= ctx.button("filename", filename, ButtonStyle::default()); + state.wants_go_to_file |= ctx.button("filename", filename, ButtonStyle::default()); ctx.inherit_focus(); ctx.attr_overflow(Overflow::TruncateMiddle); ctx.attr_position(Position::Right); @@ -305,8 +305,8 @@ fn encoding_picker_update_list(state: &mut State) { state.encoding_picker_results = Some(Vec::from_iter(matches.iter().map(|(_, enc)| *enc))); } -pub fn draw_document_picker(ctx: &mut Context, state: &mut State) { - ctx.modal_begin("document-picker", ""); +pub fn draw_go_to_file(ctx: &mut Context, state: &mut State) { + ctx.modal_begin("go-to-file", loc(LocId::ViewGoToFile)); { let width = (ctx.size().width - 20).max(10); let height = (ctx.size().height - 10).max(10); @@ -334,7 +334,7 @@ pub fn draw_document_picker(ctx: &mut Context, state: &mut State) { ctx.styled_list_item_end(false) == ListSelection::Activated }) { - state.wants_document_picker = false; + state.wants_go_to_file = false; ctx.needs_rerender(); } @@ -343,6 +343,6 @@ pub fn draw_document_picker(ctx: &mut Context, state: &mut State) { ctx.scrollarea_end(); } if ctx.modal_end() { - state.wants_document_picker = false; + state.wants_go_to_file = false; } } diff --git a/src/bin/edit/localization.rs b/src/bin/edit/localization.rs index 0443781363b..f42838625b6 100644 --- a/src/bin/edit/localization.rs +++ b/src/bin/edit/localization.rs @@ -42,7 +42,7 @@ pub enum LocId { View, ViewFocusStatusbar, ViewWordWrap, - ViewDocumentPicker, + ViewGoToFile, // Help menu Help, @@ -303,17 +303,17 @@ const S_LANG_LUT: [[&str; LangId::Count as usize]; LocId::Count as usize] = [ ], // FileClose [ - /* en */ "Close Editor", - /* de */ "Editor schließen", - /* es */ "Cerrar editor", - /* fr */ "Fermer l’éditeur", - /* it */ "Chiudi editor", - /* ja */ "エディターを閉じる", - /* ko */ "편집기 닫기", - /* pt_br */ "Fechar editor", - /* ru */ "Закрыть редактор", - /* zh_hans */ "关闭编辑器", - /* zh_hant */ "關閉編輯器", + /* en */ "Close File", + /* de */ "Datei schließen", + /* es */ "Cerrar archivo", + /* fr */ "Fermer le fichier", + /* it */ "Chiudi file", + /* ja */ "ファイルを閉じる", + /* ko */ "파일 닫기", + /* pt_br */ "Fechar arquivo", + /* ru */ "Закрыть файл", + /* zh_hans */ "关闭文件", + /* zh_hant */ "關閉檔案", ], // FileExit [ @@ -513,19 +513,19 @@ const S_LANG_LUT: [[&str; LangId::Count as usize]; LocId::Count as usize] = [ /* zh_hans */ "自动换行", /* zh_hant */ "自動換行", ], - // ViewDocumentPicker - [ - /* en */ "Document Picker…", - /* de */ "Dokumentauswahl…", - /* es */ "Selector de documentos…", - /* fr */ "Sélecteur de documents…", - /* it */ "Selettore di documenti…", - /* ja */ "ドキュメントピッカー…", - /* ko */ "문서 선택기…", - /* pt_br */ "Seletor de documentos…", - /* ru */ "Выбор документа…", - /* zh_hans */ "文档选择器…", - /* zh_hant */ "文件選擇器…", + // ViewGoToFile + [ + /* en */ "Go to File…", + /* de */ "Gehe zu Datei…", + /* es */ "Ir a archivo…", + /* fr */ "Aller au fichier…", + /* it */ "Vai al file…", + /* ja */ "ファイルへ移動…", + /* ko */ "파일로 이동…", + /* pt_br */ "Ir para arquivo…", + /* ru */ "Перейти к файлу…", + /* zh_hans */ "转到文件…", + /* zh_hant */ "跳至檔案…", ], // Help (a menu bar item) diff --git a/src/bin/edit/main.rs b/src/bin/edit/main.rs index 84a537950b8..16a35a15d66 100644 --- a/src/bin/edit/main.rs +++ b/src/bin/edit/main.rs @@ -311,8 +311,8 @@ fn draw(ctx: &mut Context, state: &mut State) { if state.wants_encoding_change != StateEncodingChange::None { draw_dialog_encoding_change(ctx, state); } - if state.wants_document_picker { - draw_document_picker(ctx, state); + if state.wants_go_to_file { + draw_go_to_file(ctx, state); } if state.wants_about { draw_dialog_about(ctx, state); @@ -338,7 +338,7 @@ fn draw(ctx: &mut Context, state: &mut State) { } else if key == kbmod::CTRL | vk::W { state.wants_close = true; } else if key == kbmod::CTRL | vk::P { - state.wants_document_picker = true; + state.wants_go_to_file = true; } else if key == kbmod::CTRL | vk::Q { state.wants_exit = true; } else if key == kbmod::CTRL | vk::G { diff --git a/src/bin/edit/state.rs b/src/bin/edit/state.rs index 774f22a2e65..67f613735f9 100644 --- a/src/bin/edit/state.rs +++ b/src/bin/edit/state.rs @@ -153,7 +153,7 @@ pub struct State { pub wants_save: bool, pub wants_statusbar_focus: bool, pub wants_indentation_picker: bool, - pub wants_document_picker: bool, + pub wants_go_to_file: bool, pub wants_about: bool, pub wants_close: bool, pub wants_exit: bool, @@ -202,7 +202,7 @@ impl State { wants_statusbar_focus: false, wants_encoding_change: StateEncodingChange::None, wants_indentation_picker: false, - wants_document_picker: false, + wants_go_to_file: false, wants_about: false, wants_close: false, wants_exit: false,