Skip to content

Commit 0e60e50

Browse files
authored
Rename "Document Picker" to "Go to File" (#456)
Closes #445
1 parent c5d91f3 commit 0e60e50

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

src/bin/edit/draw_menubar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ fn draw_menu_view(ctx: &mut Context, state: &mut State) {
111111
if ctx.menubar_menu_button(loc(LocId::ViewFocusStatusbar), 'S', vk::NULL) {
112112
state.wants_statusbar_focus = true;
113113
}
114-
if ctx.menubar_menu_button(loc(LocId::ViewDocumentPicker), 'P', kbmod::CTRL | vk::P) {
115-
state.wants_document_picker = true;
114+
if ctx.menubar_menu_button(loc(LocId::ViewGoToFile), 'F', kbmod::CTRL | vk::P) {
115+
state.wants_go_to_file = true;
116116
}
117117
if ctx.menubar_menu_button(loc(LocId::FileGoto), 'G', kbmod::CTRL | vk::G) {
118118
state.wants_goto = true;

src/bin/edit/draw_statusbar.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub fn draw_statusbar(ctx: &mut Context, state: &mut State) {
184184
filename = &filename_buf;
185185
}
186186

187-
state.wants_document_picker |= ctx.button("filename", filename, ButtonStyle::default());
187+
state.wants_go_to_file |= ctx.button("filename", filename, ButtonStyle::default());
188188
ctx.inherit_focus();
189189
ctx.attr_overflow(Overflow::TruncateMiddle);
190190
ctx.attr_position(Position::Right);
@@ -305,8 +305,8 @@ fn encoding_picker_update_list(state: &mut State) {
305305
state.encoding_picker_results = Some(Vec::from_iter(matches.iter().map(|(_, enc)| *enc)));
306306
}
307307

308-
pub fn draw_document_picker(ctx: &mut Context, state: &mut State) {
309-
ctx.modal_begin("document-picker", "");
308+
pub fn draw_go_to_file(ctx: &mut Context, state: &mut State) {
309+
ctx.modal_begin("go-to-file", loc(LocId::ViewGoToFile));
310310
{
311311
let width = (ctx.size().width - 20).max(10);
312312
let height = (ctx.size().height - 10).max(10);
@@ -334,7 +334,7 @@ pub fn draw_document_picker(ctx: &mut Context, state: &mut State) {
334334

335335
ctx.styled_list_item_end(false) == ListSelection::Activated
336336
}) {
337-
state.wants_document_picker = false;
337+
state.wants_go_to_file = false;
338338
ctx.needs_rerender();
339339
}
340340

@@ -343,6 +343,6 @@ pub fn draw_document_picker(ctx: &mut Context, state: &mut State) {
343343
ctx.scrollarea_end();
344344
}
345345
if ctx.modal_end() {
346-
state.wants_document_picker = false;
346+
state.wants_go_to_file = false;
347347
}
348348
}

src/bin/edit/localization.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub enum LocId {
4242
View,
4343
ViewFocusStatusbar,
4444
ViewWordWrap,
45-
ViewDocumentPicker,
45+
ViewGoToFile,
4646

4747
// Help menu
4848
Help,
@@ -303,17 +303,17 @@ const S_LANG_LUT: [[&str; LangId::Count as usize]; LocId::Count as usize] = [
303303
],
304304
// FileClose
305305
[
306-
/* en */ "Close Editor",
307-
/* de */ "Editor schließen",
308-
/* es */ "Cerrar editor",
309-
/* fr */ "Fermer l’éditeur",
310-
/* it */ "Chiudi editor",
311-
/* ja */ "エディターを閉じる",
312-
/* ko */ "편집기 닫기",
313-
/* pt_br */ "Fechar editor",
314-
/* ru */ "Закрыть редактор",
315-
/* zh_hans */ "关闭编辑器",
316-
/* zh_hant */ "關閉編輯器",
306+
/* en */ "Close File",
307+
/* de */ "Datei schließen",
308+
/* es */ "Cerrar archivo",
309+
/* fr */ "Fermer le fichier",
310+
/* it */ "Chiudi file",
311+
/* ja */ "ファイルを閉じる",
312+
/* ko */ "파일 닫기",
313+
/* pt_br */ "Fechar arquivo",
314+
/* ru */ "Закрыть файл",
315+
/* zh_hans */ "关闭文件",
316+
/* zh_hant */ "關閉檔案",
317317
],
318318
// FileExit
319319
[
@@ -513,19 +513,19 @@ const S_LANG_LUT: [[&str; LangId::Count as usize]; LocId::Count as usize] = [
513513
/* zh_hans */ "自动换行",
514514
/* zh_hant */ "自動換行",
515515
],
516-
// ViewDocumentPicker
517-
[
518-
/* en */ "Document Picker…",
519-
/* de */ "Dokumentauswahl…",
520-
/* es */ "Selector de documentos…",
521-
/* fr */ "Sélecteur de documents…",
522-
/* it */ "Selettore di documenti…",
523-
/* ja */ "ドキュメントピッカー…",
524-
/* ko */ "문서 선택기…",
525-
/* pt_br */ "Seletor de documentos…",
526-
/* ru */ "Выбор документа…",
527-
/* zh_hans */ "文档选择器…",
528-
/* zh_hant */ "文件選擇器…",
516+
// ViewGoToFile
517+
[
518+
/* en */ "Go to File…",
519+
/* de */ "Gehe zu Datei…",
520+
/* es */ "Ir a archivo…",
521+
/* fr */ "Aller au fichier…",
522+
/* it */ "Vai al file…",
523+
/* ja */ "ファイルへ移動…",
524+
/* ko */ "파일로 이동…",
525+
/* pt_br */ "Ir para arquivo…",
526+
/* ru */ "Перейти к файлу…",
527+
/* zh_hans */ "转到文件…",
528+
/* zh_hant */ "跳至檔案…",
529529
],
530530

531531
// Help (a menu bar item)

src/bin/edit/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ fn draw(ctx: &mut Context, state: &mut State) {
311311
if state.wants_encoding_change != StateEncodingChange::None {
312312
draw_dialog_encoding_change(ctx, state);
313313
}
314-
if state.wants_document_picker {
315-
draw_document_picker(ctx, state);
314+
if state.wants_go_to_file {
315+
draw_go_to_file(ctx, state);
316316
}
317317
if state.wants_about {
318318
draw_dialog_about(ctx, state);
@@ -338,7 +338,7 @@ fn draw(ctx: &mut Context, state: &mut State) {
338338
} else if key == kbmod::CTRL | vk::W {
339339
state.wants_close = true;
340340
} else if key == kbmod::CTRL | vk::P {
341-
state.wants_document_picker = true;
341+
state.wants_go_to_file = true;
342342
} else if key == kbmod::CTRL | vk::Q {
343343
state.wants_exit = true;
344344
} else if key == kbmod::CTRL | vk::G {

src/bin/edit/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub struct State {
153153
pub wants_save: bool,
154154
pub wants_statusbar_focus: bool,
155155
pub wants_indentation_picker: bool,
156-
pub wants_document_picker: bool,
156+
pub wants_go_to_file: bool,
157157
pub wants_about: bool,
158158
pub wants_close: bool,
159159
pub wants_exit: bool,
@@ -201,7 +201,7 @@ impl State {
201201
wants_statusbar_focus: false,
202202
wants_encoding_change: StateEncodingChange::None,
203203
wants_indentation_picker: false,
204-
wants_document_picker: false,
204+
wants_go_to_file: false,
205205
wants_about: false,
206206
wants_close: false,
207207
wants_exit: false,

0 commit comments

Comments
 (0)