Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report]一些显示问题 #47

Closed
h304192 opened this issue Nov 10, 2023 · 2 comments
Closed

[Bug report]一些显示问题 #47

h304192 opened this issue Nov 10, 2023 · 2 comments

Comments

@h304192
Copy link

h304192 commented Nov 10, 2023

1.划词翻译按钮不会跟随页面滚动

2.划词翻译按钮的显示位置似乎是鼠标松开时的位置

3.从选择文本时的起点一直到鼠标松开时的位置,在这个范围内点击任何位置翻译按钮都不会消失,以及输入框中删除选中的文本翻译按钮也不会消失

4.有些地方翻译会跑到最下面,这会导致看起来很乱 有问题的页面
screenshot20231110 (7)

@fishjar
Copy link
Owner

fishjar commented Nov 11, 2023

1.划词翻译按钮不会跟随页面滚动

2.划词翻译按钮的显示位置似乎是鼠标松开时的位置

按钮的位置是鼠标松开的位置,并加上一定偏移量,偏移量可以在设置页面设置。

至于是是否跟随页面滚动,位置基于鼠标还是选中的文字,我觉得每个人习惯不同,且对使用影响不大,就选择了简单的做法。

3.从选择文本时的起点一直到鼠标松开时的位置,在这个范围内点击任何位置翻译按钮都不会消失,以及输入框中删除选中的文本翻译按钮也不会消失

这其实是两个问题:
点击选中的文字,按钮不会消失,因为鼠标松开时,文字仍在选中状态,我将加上一点延迟来修复此问题。
输入框的内容删除后按钮也不消失,是因为仅监听鼠标松开事件,没有监听键盘事件。如果同时监听键盘事件,比如按crl+a,可能出现没法设定钮位置的情况。

4.有些地方翻译会跑到最下面,这会导致看起来很乱 有问题的页面 screenshot20231110 (7)

这个很乱的原因是页面的内容不规范,可通过注入修复补丁来解决,不过目前修复补丁是订阅的方式,不能自定义添加,不是很方便,后面会考虑如何改进一下。

@fishjar
Copy link
Owner

fishjar commented Nov 17, 2023

新版可以自行增加webfix的规则:

Screenshot from 2023-11-17 11-46-52

然后翻译 页面 效果如下:

Screenshot from 2023-11-17 11-45-02

@fishjar fishjar closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants