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 tooltips for truncated long labels in config dialog #893

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

Conversation

kaorahi
Copy link
Contributor

@kaorahi kaorahi commented Aug 26, 2021

workaround for unreadable labels, e.g. #892

kaorahi pushed a commit to kaorahi/lizzie that referenced this pull request Aug 26, 2021
@hope366
Copy link

hope366 commented Aug 26, 2021

I wasn't sure exactly what kind of change was caused by this PR.
I'm sorry, can you tell me?

@kaorahi
Copy link
Contributor Author

kaorahi commented Aug 26, 2021

In my Linux environment, Settings > View > Hold Best Moves To Sgf is shown as "Hold Best Moves To ..." actually. This patch shows tooltips by mouse hover on such truncated labels. (maybe needless for Windows)

@kaorahi kaorahi mentioned this pull request Aug 26, 2021
@hope366
Copy link

hope366 commented Aug 26, 2021

Thank you for letting me know.
In the Windows environment, "Settings"-> "View"-> "Color by Winrate Instead of Visits" is interrupted, which is convenient for displaying here.
The same part is cut off in the Japanese version, but in my "lizzie improved version", the description was changed a long time ago so that all of them are displayed.
This PR made it possible to revert to the previous description 😄

@hope366
Copy link

hope366 commented Aug 27, 2021

It's nice to see the popup display forever while you hover your mouse over it, but is it possible to change that?
If possible, I would be grateful if you could change the engine pull-down menu on the top toolbar as well.

@kaorahi
Copy link
Contributor Author

kaorahi commented Aug 27, 2021

See kaorahi/lizzie@6b9e5a44.

@hope366
Copy link

hope366 commented Aug 27, 2021

thank you very much.
Work is very fast as usual 😄

@kaorahi
Copy link
Contributor Author

kaorahi commented Aug 29, 2021

Additional feature: You can specify different tooltips as the texts after \n.

(example 1)

in src/main/resources/l10n/DisplayStrings.properties

LizzieConfig.title.showLcbWinrate=Display Winrate As\nNever use LCB!!

(example 2: decoration)

LizzieConfig.title.showLcbWinrate=Display Winrate As\n<html><span style="font-size: 500%; color: red;">Never use LCB!!</span><br><span>It is completely useless for normal users.</span></html>

@hope366
Copy link

hope366 commented Aug 29, 2021

Is there a way to display multiple lines if the description is quite long?
Also, is it possible to adjust the time from when the mouse cursor is placed until the popup is displayed?

@kaorahi
Copy link
Contributor Author

kaorahi commented Aug 29, 2021

See the above example 2 for multi-line tooltips. Add the following line into kaorahi/lizzie@6b9e5a44 to show the tooltips immediately.

    ToolTipManager.sharedInstance().setInitialDelay(0);

@hope366
Copy link

hope366 commented Aug 29, 2021

I was able to confirm that the popup was displayed quickly.

Just adding 6e4eeaf doesn't make the long description multiple lines, is there anything else I need to do?

@hope366
Copy link

hope366 commented Aug 29, 2021

6e4eeaf is a code to display the sentence after "\ n" as a tooltip, isn't it?
Apart from that, is it possible to have a very long description displayed on multiple lines?

It seems that it is possible to make multiple lines by writing as in Example 2 above, but with this method, it seems that it is necessary to specify for each description.
If this is the case, the amount of work will increase because all items need to be corrected.
If the text is long to some extent, is there a way to automatically fold it and display it in multiple lines?

@kaorahi
Copy link
Contributor Author

kaorahi commented Aug 29, 2021

Hmm, I don't like to pay too much efforts for it...

(example 3: word wrap)

LizzieConfig.title.showLcbWinrate=Display Winrate As\n<html><p style="width: 100px;">foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo</p></html>

@hope366
Copy link

hope366 commented Aug 29, 2021

I'm sorry to have requested many things.
You taught me more than enough.
I will try to make full use of the information given.

@kaorahi
Copy link
Contributor Author

kaorahi commented Aug 30, 2021

Have you tried the above example 3? It is an example of automatic line breaks in the given width. Or, you can simply insert <br> as follows if you don't need decorations.

(example 4: manual line breaks without decoration)

LizzieConfig.title.showLcbWinrate=Display Winrate As\n<html>abcdefg<br>hijklmn<br>opqrstu<br>vwxyz</html>

@hope366
Copy link

hope366 commented Aug 30, 2021

Thank you for the additional information.
I didn't know anything about html, but looking at Example 2, I guessed that inserting </ span>
would break the line, and I did this and it worked.
It was good to just

I also tried Example 3, but I thought it would be easier to read a line break at a well-separated part, so I adopted the method of manually breaking a line.

kaorahi pushed a commit to kaorahi/lizzie that referenced this pull request Aug 31, 2021
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.

2 participants