Details

Original kimpanel is a very long widget with 3~6 icons. It takes a lot of space of panel. And the width changes when changing input focus and make the whole panel content bouncing. This change make it more like IME on other platforms: only show one icon, other content can be accessed with context menu or expended panel.

Still working in progress. Now shows icons in system tray.

TODO:

Context menu on system tray icon.

Nicer panel content layout.

System tray icon changes as input method changes.

Settings with QML, merge the work of @gpark will be included in next patch

+1 conceptually. However if you're going to make this a part of the System Tray, then it automatically becomes high profile and the bar for UI design increases a lot. :) As such, I'd want the following changes before we present it so prominently to users:

Hide when no input methods are configured

When pop-up is opened but no input methods are configured, show a button that says Configure... or Add input methods... or something that will open the settings window

The settings window needs to actually offer a way to add and configure input methods. When I look at this very barebones settings window, I have no idea what to do:

(Minor) the vertical/horizontal chooser in the settings window should be expressed with two radio buttons rather than one checkbox

I have no idea what it is or where it comes from. ...Which is kind of my point: if you're going to put this in the System Tray, it needs to have a UI suitable for novice users and people who know nothing about input methods. :)

The configuration should be in System Settings, not in this applet, as they're system-global and override keyboard layout settings.

The 2018 GSoC work started to implement this and got far, and also made kimpanel replace the existing tray keyboard layout indicator in the process and update the OSD and all the other system parts to understand input methods and switch between then. We should look into leveraging at least the applet changes right now and merging them with this patch.

As for the conceptual change: It's a change I also suggested once, but was veto'd by the kimpanel maintainer at the time who was strongly of the opinion that every icon needs to be visible at all times. The discussion between him, me and @mart at the time was to spawn multiple SNIs and teach the tray to sort them together. I think this is workable but still advocate a single icon by default unless others are explicitly enabled.

There were nice videos showing the improved kimpanel and the switching w/ OSD and KCM open and everything being in sync somewhere, too, but I can't find them off-hand.

To be clear: I'm not saying this patch is bad, but rather that we're in the fortunate position that it doesn't need to be pushed into slaying the configuration beast all alone as the above response did. It's not correct, and also not necessary because there's an existing body of work to leverage!

Between @gpark, @guoyunhe, me and others, the right thing to do is form a team to advance this together, and make this patch part of it. A good place to organize this effort can be around T11054. Please add yourself there @guoyunhe :)

I tried to merge @gpark 's branch. It is compiled but I cannot reproduce the UI as shown in demo video. I am not sure how it is connected. So I leave that part untouched for now. I hope I can get in touch with @gpark to understand how the code works. Then we can make another patch for KCM and OSD modules.

In this patch, I will only implement the system tray icon, context menu, and expanded widget. Keep it small. So I can make it with my very limited C++/Qt5/KF5 knowledge.

This change doesn't serve any real functionality of kimpanel. It doesn't show the current input method in tray, doesn't hide or show up. And kimpanel usually consist multiple icons. While it's doubt whether we need that much for certain input method (currently user can blacklist some by hand), but being able to show some important ones should not be removed. (on windows, there're two icon for chinese case).

Also, simply move the existing implementation into expanded tray is not acceptable, the layout is not designed for the expanded tray. There is much more space in the tray so even if we want to keep the similar ui large icon IMHO is prefered.

As for configure, there's already a dbus call in kimpanel for launch the configuration, not sure if want to use that to launch kcm.