ripose-jp / Memento

An mpv-based video player for studying Japanese
https://ripose-jp.github.io/Memento/
GNU General Public License v2.0
484 stars 22 forks source link

Compact Glossaries #117

Closed Juiin closed 2 years ago

Juiin commented 2 years ago

In Yomichan you have the Option to display term glossaries in a more compact layout with multiple terms and the dictionary name in the same line, with terms being seperated by a | Also i think it would be more compact if the [P] [Ichi] [News] Info would be on the same line as the Searched Word, like in Yomichan. And as a small improvement it would also be nice if the furigana was closer to the Word, also see yomichan.

This is especially useful if you are using more than one dictionary, because then you can see more different dictionary entries without needing to scroll.

Screenshots for comparision: Screenshot 2022-09-21 011259

Screenshot 2022-09-21 011337

I apologize if this is already possible using the Custom Style Sheets, but i'm not experienced enough to figure that out.

ripose-jp commented 2 years ago

In Yomichan you have the Option to display term glossaries in a more compact layout with multiple terms and the dictionary name in the same line, with terms being seperated by a |

This is doable and I don't mind implementing it.

Also i think it would be more compact if the [P] [Ichi] [News] Info would be on the same line as the Searched Word

This is possible, but the reason I don't do this is because the top is already crowded and running out of space. Anything much longer than this 4 letter word and there will be graphical jank that's difficulty to fix. image In contrast to that, the current way is fairly resilient since it is programmed to just spill onto the next line as you can see in your frequency dictionaries. Graphical jank with 10 letter words may be unavoidable, but those are so rare that they aren't really important.

And as a small improvement it would also be nice if the furigana was closer to the Word

They're as close together as I can get them without resorting to hacks that may not work so well across operating systems. Sure I can get it to look good on my machines, but the possibility that someone somewhere has a strange operating system, with some strange DPI, with some strange resolution that breaks the UI just isn't worth moving those things a few pixels closer together.

Rather than manhandling UI elements, I think an easier solution is just to allow the search window size to be changed. What are your thoughts?

Juiin commented 2 years ago

I think the Compact Glossaries are by far the biggest change, which would help with quicker readability. The [P] [Ichi] Stuff looks pretty good on the Screenshot you postet imo. I think the icons on the top right could be made smaller or farther up/right(maybe an extra line) to make space, and if it's possible you could put in an exception for long words where it would drop to the next line, like it is currently, to avoid graphical jank. I think that would make it more compact for the vast majority of words.

With the furigana, i just noticed from your screenshot, that the thing that was bugging me was not necessarily the closeness to the Kanji but rather that the furigana does not match perfectly with which Kanji gets what Reading. If you understand what i mean. As a comparison here a screenshot from how yomichan handles this word.

Screenshot 2022-09-21 150348

ripose-jp commented 2 years ago

Positioning elements isn't particularly easy, so I probably won't be moving term tags around. Here's the patch I used for the screenshot if you want to use it yourself.

The reason Yomichan can place furigana just over the kanji they represent is because web browsers have access to <ruby> elements. Qt does not have access to <ruby> elements, so I can't do that.

ripose-jp commented 2 years ago

Due to limitations with Qt, I can't put text and tags on the same line. I have implemented vertical bars in glossaries, so hopefully that's enough to close this issue. Let me know.

image

Juiin commented 2 years ago

That is definitely way better than before! As a small improvement, if possible, i think it would be nice, if entries for the same dictionary get collapsed into one. For example, in your Screenshot points 1-4 have the same Dictionary and Tags it would be enough to display the tags once and collapse them into one point. Since you cannot put the tags and text on the same line, this would help make it more compact. But since that would be a different issue, i'll close this. Thanks for implementing!