fcitx / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
117 stars 11 forks source link

How to keep the comment window open #7

Closed ekaunt closed 3 years ago

ekaunt commented 3 years ago

Is there a way to always keep the comment window open?

Its very cumbersome to press ctrl+alt+h (or whatever shortcut you set it to) every time I want to check the definition/comment…

Here are examples of what I mean (from Microsoft IME, Google IME, and ATOK):

microsoft-ime google-ime atok-ime

Here's an example of how fcitx currently works:

fcitx-ime

As you can see, I can't see the definitions as I scroll by. Instead, I have to press ctrl+alt+h every time I want to check the definition.
I use this feature a lot for my user dictionary entries, so I'd like to be able to have the comments window stay open to the side of the main popup.

Is there any way I can enable the definitions window to stay open on the side?

wengxt commented 3 years ago

Sorry, but to be honest this is not easily possible due to fcitx’s UI limitation. There can’t be a separate window for displaying some complex message.

ekaunt commented 3 years ago

Sorry, but to be honest this is not easily possible due to fcitx’s UI limitation. There can’t be a separate window for displaying some complex message.

Can fcitx5 do it ?

wengxt commented 3 years ago

So here's the thing, currently the UI is kinds of like contains only fixed elements (candidates, preedit)

So highly customized UI from engine is impossible, not to mention that Fcitx's UI has multiple backends, so it need to be adapted in multiple different places. ibus-mozc has a custom gtk renderer, but that won't work for gnome-shell case (gnome-shell wants to implement it's own UI).

So basically there isn't a good easy solution for this.

I wonder if following solution works for you. Instead of displaying the explanation by side, in the same window, what about display the text under the currently focused candidate? Supporting multiline text in candidates is a relatively easy thing to do.

ekaunt commented 3 years ago

Yes please! that would be just as good!

wengxt commented 3 years ago

I know it is not as good as other platform, but hope it helps.

I implement 3 different modes for display the usage: only the focused one, always show, or the old way.

Here's a screenshot for always mode.

图片
ekaunt commented 3 years ago

@wengxt Thank you so much for doing this for me! Is there any way I can pay you?

(also, how do I install the update? I'm on Linux, and the how-to-build guide didn't work for me… Is the update only for fcitx5 or also for regular fcitx?)

wengxt commented 3 years ago

The change is for Fcitx5's mozc, and it's not easy to build the code on your own, especially mozc.

If you could use flatpak, that might be the easiest way to install.

Here's my blog post about how to install latest fcitx5 via flatpak, but in Chinese. I guess you can focus on the command part in it. https://www.csslayer.info/wordpress/fcitx-dev/fcitx5-on-flatpak/

You also need to install mozc

 flatpak install org.fcitx.Fcitx5
 flatpak install org.fcitx.Fcitx5.Addon.Mozc

If you already have fcitx configured (environment variables doesn't need to be changed for fcitx 5) and your fcitx 4 is pretty new (>4.2.9.7), you should be able to use it with fcitx 5.

After the installation, try:

killall fcitx # End fcitx 4
flatpak run org.fcitx.Fcitx5 -rd # Start fcitx5 in flatpak

Then find the tray icon, right click to launch config tool and add mozc then you should be good to go.

The latest change is probably not included yet because this repo is a nightly build. You may want to try this later.

ekaunt commented 3 years ago

I currently have fcitx 4.2.9.8, and mozc 2.26.4206

Is there any way to keep my dictionaries from fcitx in fcitx5? I have neologd and UT and UT2 with all dictionaries enabled (https://aur.archlinux.org/packages/mozc-ut-unified-full/). These aren't user dictionaries so I can't just copy them over…

You didn't respond to my last message, but is there any way I can pay you for your work (like venmo)?

wengxt commented 3 years ago

Ah, you're using arch, then should be much easier.

You probably want to merge part of https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mozc-ut-unified-full into https://aur.archlinux.org/packages/fcitx5-mozc-git so you get the same dict

Your user dict directory should remain same so there's no need to change anything.

Also you'll need fcitx5-git (Check https://wiki.archlinux.org/index.php/Fcitx5 for other packages you might need)

Github sponsors only have monthly option, if you only want one time payment may just subscribe and cancel. https://github.com/sponsors/wengxt/

ekaunt commented 3 years ago

IT WORKS!!!!

image

again, thank you so much for taking the time out of ur day to implement this feature for me!! u should pat urself on the back for ur amazing work!