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

Add an option to avoid auto-scrolling out of top dictionary #1114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vedgy
Copy link
Member

@vedgy vedgy commented Feb 1, 2019

When a user clicks a link in a dictionary or requests translation of
a word by double-clicking or translates selection via the context menu,
the definition in all dictionaries is displayed. Then the article from
the dictionary, out of which the translation was requested, becomes
current and the view scrolls down to this article placing it on top,
hiding translations from dictionaries above it.

This behavior is inconvenient in some workflows and forces the user to
manually navigate to the top dictionary translation each time this
auto-scrolling happens.

For example: a user has English->Russian dictionaries and
English->English dictionaries. The English->Russian dictionaries are
higher up in the dictionary order because they provide easier/faster to
understand translations. Some rare words and phrases are missing from
the English->Russian dictionaries however. So the user has to read the
English explanation of the word/phrase. When the user double-clicks a
word or follows a link in the English->English dictionary article, she
would rather see translations from the preferable English->Russian
dictionaries.

The new option allows to disable auto-scrolling and ensure that articles
from higher-priority dictionaries are visible. The option doesn't affect
backward/forward navigation via arrow buttons or Alt+Arrow shortcuts:
these still scroll to the stored vertical position among articles. This
remaining auto-scrolling is not a problem for the described use case and
hopefully for other potential use cases.

@vedgy
Copy link
Member Author

vedgy commented Jun 22, 2021

After enabling this option, sometimes I do want to auto-scroll to the target dictionary. This could be addressed by adding a shortcut that scrolls to the current "scrollto" target. This way, when this option is on, auto-scrolling won't happen, but the user could trigger the scrolling manually (via the new shortcut) at any time.

@vedgy vedgy force-pushed the add-avoid-auto-scrolling-out-of-top-dictionary-option branch from 1d97f74 to 036df2b Compare July 1, 2021 16:20
@vedgy
Copy link
Member Author

vedgy commented Jul 1, 2021

Added the Alt+T shortcut that scrolls to the current "scrollto" target as described above. Also inverted the option's meaning along with its default value for better clarity (the behavior is still not changed by default, until the user toggles the new option).

@xiaoyifang
Copy link
Contributor

when will this be merged ,I need features like this.

@xiaoyifang
Copy link
Contributor

handled in this xiaoyifang/goldendict-ng#9

@xiaoyifang
Copy link
Contributor

#1392

@vedgy
Copy link
Member Author

vedgy commented Feb 13, 2022

@Abs62, three users expressed interest in this optional feature:

I think it would be useful for many more users who just haven't stumbled upon this pull request. Could you please review it?

@xiaoyifang
Copy link
Contributor

actually.
I support the changes in commit 5f6f3a1

which is good .

but the changes offered by 036df2b introuduced a new Shorcut key ,and the key is hide from common user and have no way to change .
I do not agree with this.

@vedgy
Copy link
Member Author

vedgy commented Feb 16, 2022

  1. The shortcut is not hidden. It is described in the tooltip for the checkbox in Preferences. Furthermore, the Jump to Target Article action appears in the context menu of an article view, and the shortcut is documented in this context menu action too.
  2. Customizable shortcuts is a separate feature that should be implemented for all built-in shortcuts at the same time, not for each new added shortcut separately.

@vedgy vedgy force-pushed the add-avoid-auto-scrolling-out-of-top-dictionary-option branch from f4f0ae8 to 036df2b Compare June 23, 2022 16:56
When a user clicks on a link in a dictionary or requests translation of
a word by double-clicking or translates selection via the context menu,
at first the article from the highest-priority dictionary is at the top.
Then, after approximately one second, the article from the dictionary,
out of which the translation was requested, becomes current and the view
scrolls down to this article placing it on top, hiding articles from the
dictionaries above it.

Such application behavior is inconvenient in some workflows so that the
user manually navigates to the top dictionary translation when this
automatic scrolling happens.

For example: a user has English->Russian dictionaries and
English->English dictionaries. The English->Russian dictionaries are
higher up in the dictionary order because they provide easier/faster to
understand translations. Some rare words and phrases are missing from
the English->Russian dictionaries however. Thus the user occasionally
reads the English explanation of a word/phrase. When the user
double-clicks on a word or follows a link in the English->English
dictionary article, she would rather see translations from the
preferable English->Russian dictionaries.

The new option allows to disable automatic scrolling and ensure that
articles from higher-priority dictionaries are visible. The option
doesn't affect backward/forward navigation via arrow buttons or
Alt+Arrow shortcuts: these still scroll to the stored vertical position
among articles. This remaining automatic scrolling happens much faster,
is not a problem for the described use case and hopefully for other use
cases.
This new action is particularly useful when the "Automatically scroll to
target article" option is disabled. Even if the user prefers
translations from higher-priority dictionaries most of the time,
sometimes she may want to read the target article. This action allows to
quickly scroll to the target article via its Alt+T shortcut.
@vedgy vedgy force-pushed the add-avoid-auto-scrolling-out-of-top-dictionary-option branch from b365bbe to 6d53199 Compare November 30, 2022 18:37
@vedgy
Copy link
Member Author

vedgy commented Nov 30, 2022

Rebased on master and added the jumpToTargetArticleAction( this ), line to the ArticleView constructor in order to make compile with Qt 4.

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

Successfully merging this pull request may close these issues.

None yet

2 participants