From f43f589ed24e1049a3f48e3be2090f967b315f83 Mon Sep 17 00:00:00 2001 From: eeeXun Date: Sat, 10 Aug 2024 14:11:13 +0800 Subject: [PATCH] docs: note for OSC 52 --- README.md | 6 ++++-- ui.go | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7ff6013..ee68993 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ For RedHat-based Linux, you need `alsa-lib-devel`. [`wl-clipboard`](https://github.com/bugaevc/wl-clipboard) (optional) - for Linux/Wayland to copy text. +Or, if your terminal supports OSC 52, you can enable OSC 52 in page 2 of the pop out menu to copy text. + ### Arch Linux ([AUR](https://aur.archlinux.org/packages/gtt-bin)) ```sh @@ -120,7 +122,7 @@ docker run -it eeexun/gtt:latest Exit program. `` -Toggle pop out window. +Toggle pop out menu. `` Translate from source to destination window. @@ -159,7 +161,7 @@ Toggle Definition/Example & Part of speech. Cycle through the pop out widget. `<1>`, `<2>`, `<3>` -Switch pop out window. +Switch pop out menu. ### Customize key map diff --git a/ui.go b/ui.go index 8e00d09..db2d09f 100644 --- a/ui.go +++ b/ui.go @@ -18,12 +18,12 @@ type Item struct { } const ( - popOutWindowHeight int = 20 + popOutMenuHeight int = 20 langStrMaxLength int = 32 keyMapText string = `[#%[1]s][-] Exit program. [#%[1]s][-] - Toggle pop out window. + Toggle pop out menu. [#%[1]s]<%[2]s>[-] Translate from source to destination window. [#%[1]s]<%[3]s>[-] @@ -49,7 +49,7 @@ const ( [#%[1]s], [-] Cycle through the pop out widget. [#%[1]s]<1>, <2>, <3>[-] - Switch pop out window.` + Switch pop out menu.` ) func updateTranslateWindow() { @@ -347,7 +347,7 @@ func uiInit() { Item{item: dstLangDropDown, fixedSize: 0, proportion: 1, focus: false}), fixedSize: 0, proportion: 1, focus: true}), fixedSize: 2 * langStrMaxLength, proportion: 1, focus: true}), - popOutWindowHeight, 1, true). + popOutMenuHeight, 1, true). AddItem(attachButton(), 1, 1, false). AddItem(nil, 0, 1, false) stylePopOut.SetDirection(tview.FlexRow). @@ -367,14 +367,14 @@ func uiInit() { Item{item: dstBorderDropDown, fixedSize: 0, proportion: 1, focus: false}), fixedSize: 0, proportion: 1, focus: false}), fixedSize: 2 * langStrMaxLength, proportion: 1, focus: true}), - popOutWindowHeight, 1, true). + popOutMenuHeight, 1, true). AddItem(attachButton(), 1, 1, false). AddItem(nil, 0, 1, false) keyMapPopOut.SetDirection(tview.FlexRow). AddItem(nil, 0, 1, false). AddItem(attachItems(true, tview.FlexColumn, Item{item: keyMapMenu, fixedSize: 2 * langStrMaxLength, proportion: 1, focus: true}), - popOutWindowHeight, 1, true). + popOutMenuHeight, 1, true). AddItem(attachButton(), 1, 1, false). AddItem(nil, 0, 1, false)