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
[GUI] remember last used keyboard layout #11242
Conversation
m_layouts.push_back(keyboardLayout->second); | ||
if (layoutName->asString() == activeLayout) | ||
m_currentLayout = m_layouts.size() - 1; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I think its fine as is. There is no other way to get the index as long as those are vectors and not dictionaries. |
thanks for review. I'll wait until sunday, and will merge then if nobody objects. @MartijnKaijser trivial enough for a backport? |
@Memphiz Wouldn't std::distance() work here ? |
ping @Montellese if he knows another way |
@phil65 size() is already a shortcut to distance() as of the vector.size() docu... |
Also there is nothing wrong with that way - the for loop is already there - size has constant complexity - i find no reason why this should be unclean... |
sure. @Montellese pointed me to std::distance() some weeks ago for very similar use case, that´s why I was askin. |
When having multiple keyboard layouts selected, the OSD keyboard will always show the first layout in the list. With this change, Kodi will remember the last used keyboard layout and will use that instead.
Description
A hidden setting has been added which will be updated each time the layout is being changed.
Motivation and Context
There is currently no way to define a preferred keyboard layout. Even when you select the keyboard layouts in a specific order, they will always be stored in alphabetical order. Remembering the last used layout makes a custom order superflous and is even more flexible.
How Has This Been Tested?
runtime tested
Types of change
added hidden setting to store the last active keyboard layout