mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-17 22:49:58 +02:00
Allow multiple custom layouts
This merges the "Layouts" option with the "Custom layout" option. A custom layout becomes an item in the "Layouts" list among the other layouts. It's possible to add several custom layouts. Selecting the "Custom layout" item in the list opens a second dialog for entering the layout description. Layouts are serialized as JSON object and are decoded solely in the LayoutsPreference class.
This commit is contained in:
@@ -54,9 +54,9 @@ def generate_arrays(out, layouts):
|
||||
item.text = s
|
||||
elem.append(item)
|
||||
return elem
|
||||
none_item = [ ("system", "@string/pref_layout_e_system") ]
|
||||
system_item = [ ("system", "@string/pref_layout_e_system") ]
|
||||
custom_item = [ ("custom", "@string/pref_layout_e_custom") ]
|
||||
values_items, entries_items = zip(*(none_item + layouts + custom_item)) # unzip
|
||||
values_items, entries_items = zip(*(system_item + layouts + custom_item)) # unzip
|
||||
ids_items = map(lambda s: "@xml/%s" % s if s not in ["system", "custom"] else "-1", values_items)
|
||||
root = XML.Element("resources")
|
||||
root.append(XML.Comment(text="DO NOT EDIT. This file is generated, see gen_layouts.py."))
|
||||
|
Reference in New Issue
Block a user