mirror of
https://github.com/RustyRaptor/plasma-keyboard.git
synced 2026-12-03 15:55:19 -07:00
Currently layouts are created with the KeyboardLayout component. When we switch to alternate layouts (i.e. numpad, symbols), the Keyboard switches out the KeyboardLayout completely to the alternate layout's KeyboardLayout. We currently don't have a "holding" object for a keyboard layout, preventing us from having a shared TextComposer session between all of the "sublayouts" within a layout (ex. QWERTY <-> symbols <-> numpad) This is problematic for CJK because the TextComposer gets reset when we switch to other pages, like the symbols page. --- This MR introduces a "KeyboardLayoutDefinition" holding component for layouts, so that we can retain state within a keyboard layout. In this case, we keep the TextComposer on the KeyboardLayoutDefinition rather than the KeyboardLayout so it isn't reset when we switch to other keyboard pages. I also replaced the JSON-specified alternate layouts with it now being specified on the KeyboardLayoutDefinition, which makes things a bit more centralized. --- Kind of annoying that I had to do this after porting the layouts, but this was a big oversight I missed that came up during CJK testing :/