v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-15 23:30:27 -07:00

35 Commits

Author SHA1 Message Date
eeeXun
e2cb8cfaf0 style(format): run gofmt 2024-08-10 06:12:27 +00:00
Yin-Hsun Hong
f87b7b43ec
feat: support OSC 52 (#32)
* feat: support OSC 52

* docs: note for OSC 52
2024-08-10 14:12:15 +08:00
eeeXun
024aa568a3 fix: newLine in GetText of TextView
After
7344139b55,
the newLine problem has been fixed.
2024-04-09 01:29:57 +08:00
eeeXun
42bed00166 refactor: clear text with Replace
Replace would preserve undo functionality
2024-04-03 10:11:13 +08:00
eeeXun
09207e7e3d refactor(ui): KeyEsc trigger showLangPopout 2023-07-01 13:01:46 +08:00
eeeXun
04efa4e649 refactor: move AddPage to uiInit 2023-06-30 20:59:03 +08:00
Xun
d01ef4e768
feat: support custom key mapping (#22)
* feat: support custom key mapping

* remove testing code

* feat: support function key

* style: add comment

* feat: support read config

* docs: add keymap.yaml example

* docs: add function key in README

* refactor: rename config key name

* feat: support Alt prefix

* docs: fix syntax

* feat: let exit be configurable

* refactor: remove KeyEsc in keyNames

* refactor: space to Space

* refactor: style code
2023-06-30 19:55:41 +08:00
eeeXun
993a8286a3 fix(ui): wrong button color
After update tview (49200f8), the background color of button get wrong.
The SetBackgroundColor doesn't work. Use SetStyle and SetActivatedStyle
instead.
2023-06-18 23:43:31 +08:00
eeeXun
f47c8fdd1f refactor(ui): remove unneeded keyMapMenu SetText 2023-06-11 17:34:18 +08:00
eeeXun
18d8f948b4 refactor(ui): remove duplicated function call 2023-06-07 13:32:46 +08:00
eeeXun
1b185e88b9 refactor(ui): RemoveItem instead of Clear all 2023-06-07 13:31:56 +08:00
eeeXun
2fdbe8daee docs: play sound -> playing text to speech 2023-05-19 19:32:38 +08:00
eeeXun
8dcf8c449d docs: fix grammar error & change sound to text to speech 2023-05-12 14:58:58 +08:00
eeeXun
2d2834c6da fix(ui): app should redraw in Goroutine
If error occurs when playing TTS, SetText would be called. But it's in
Goroutine, so we need to call app.Draw to redraw the screen.
2023-05-12 09:27:52 +08:00
eeeXun
7883e0026e refactor: write show Popout into function 2023-04-30 13:14:54 +08:00
eeeXun
aaa06560a5 refactor(ui): change translatorDropDown proportion to 1 2023-04-29 01:38:13 +08:00
eeeXun
96e7b6c3ac refactor: return translation in struct 2023-04-22 21:02:38 +08:00
eeeXun
cbd985b599 refactor: make Language, TTSLock and EngineName to struct in Translator
GetSrcLang, GetDstLang, SetSrcLang, SetDstLang, SwapLang are reusable
functions from translator to translator. So make Language struct.

GetEngineName is also a reusable function. So make EngineName struct.

Finally, let Translator to inherit those functions in these three
(Language, TTSLock, EngineName) structs. No need to write the duplicated
functions for each Translator.
2023-03-10 23:37:08 +08:00
Xun
ea1e23172c
feat(translator): add ReversoTranslate (#14) 2023-03-10 20:51:38 +08:00
eeeXun
edcfe4dde3 feat: show translator name in terminal title 2023-02-21 01:13:35 +08:00
eeeXun
303441125b refacotr: move hide_below to style struct 2023-02-14 15:45:51 +08:00
eeeXun
c5cdbcb99a refactor: move module color to style
- rename control.go to style.go
- remove windowStyle struct, don't need it
- rename global variable style to uiStyle
2023-02-14 15:25:40 +08:00
eeeXun
34805264b3 refactor: rename go module 2023-02-11 14:23:07 +08:00
eeeXun
06fa80ef1b style(ui): language dropdown should focus prior to translator dropdown 2023-02-08 18:02:42 +08:00
eeeXun
f9775ba89e refactor: replace AddItem with attachItems
attachItems implements adding multi items & centering items
2023-01-29 11:45:01 +08:00
eeeXun
a44d329cc7 style: rename {lang,style,keyMap}Window to {lang,style,keyMap}PopOut 2023-01-29 11:28:53 +08:00
eeeXun
1115d19b7a feat: add translatorDropDown 2023-01-27 12:24:42 +08:00
eeeXun
ed2bd312a3 refactor: make translator to an interface 2023-01-26 01:15:53 +08:00
Xun
d99585b386
feat: add definition & part of speech (#5) 2023-01-18 14:30:44 +08:00
eeeXun
e49639fcbe style: replace duplicated code with for-loop 2023-01-11 22:09:43 +08:00
eeeXun
10c6877230 style: rename function & reorder function call
- rename function `translatePageHandler` to `translateWindow`
- reorder function call in `ui.go`, let function call jointed
- change the position of comment
2023-01-11 10:49:12 +08:00
eeeXun
94ec8498ac style(format): run goimports 2023-01-09 19:17:01 +00:00
eeeXun
ddce44395d fix: change keyMapMenu text HighLightColor
Should change HighLightColor when switching colorscheme.
2022-11-04 23:34:22 +08:00
Xun
7523cec0ce
feat: copy text (#1)
* copy key with `<C-y>` `<C-g>` `<C-r>`
2022-10-26 08:18:23 +08:00
eeeXun
98d1cb3392 Initial commit 2022-10-24 23:43:20 +08:00