diff options
author | Severin <eiseljulian@gmail.com> | 2019-01-04 23:40:16 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-01-05 00:18:23 +0300 |
commit | a77b63c56943ebd0046f738e6abbea4c85dc65b6 (patch) | |
tree | 173dddb28838298d2319f4f062586ba8985728c1 /release/scripts/modules | |
parent | 4b486eaec9763108fd471b7705133c45116df966 (diff) |
UI: Preferences Redesign Part 2
(Part 1 was 00963afc14978b)
Does the following changes visible to users:
* Use panels and sub-panels for more structured & logical grouping
* Re-organized options more logically than before (see images in D4148)
* Use flow layout (single column by default).
* New layout uses horizontal margin if there's enough space.
* Change size of Preferences window to suit new layout.
* Move keymap related options from "Input" into own section.
* Own, left-bottom aligned region for Save Preferences button.
* Adjustments of names, tooltips & icons.
* Move buttons from header into the main region (except editor switch).
* Hide Preferences header when opened in temporary window.
* Use full area width for header.
* Don't use slider but regular number widget for UI scale.
* Gray out animation player path option if player isn't "Custom"
Internal changes:
* Rearrange RNA properties to match changed UI structure.
* Introduces new "EXECUTE" region type, see reasoning in D3982.
* Changes to panel layout and AZone code for dynamic panel region.
* Bumps subversion and does versioning for new regions.
RNA changes are documented in the release notes:
https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Preferences_API
Design & implementation mostly done by @billreynish and myself.
I recommend checking out the screenshots posted by William:
https://developer.blender.org/D4148#93787
Reviewed By: brecht
Maniphest Tasks: T54115
Differential Revision: https://developer.blender.org/D4148
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy/utils/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rna_keymap_ui.py | 27 |
2 files changed, 19 insertions, 10 deletions
diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index 5fbff2eb51b..b4c8c0899ac 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -572,7 +572,7 @@ def preset_find(name, preset_path, display_name=False, ext=".py"): def keyconfig_init(): # Key configuration initialization and refresh, called from the Blender # window manager on startup and refresh. - active_config = _preferences.inputs.active_keyconfig + active_config = _preferences.keymap.active_keyconfig # Load the default key configuration. default_filepath = preset_find("blender", "keyconfig") diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py index 3a44745e01b..268bcb6a7be 100644 --- a/release/scripts/modules/rna_keymap_ui.py +++ b/release/scripts/modules/rna_keymap_ui.py @@ -372,15 +372,24 @@ def draw_keymaps(context, layout): subcol = subsplit.column() col = subcol.column() - row = col.row(align=True) # row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config") text = bpy.path.display_name(kc_active.name) if not text: text = "Blender (default)" - row.menu("USERPREF_MT_keyconfigs", text=text) - row.operator("wm.keyconfig_preset_add", text="", icon='ADD') - row.operator("wm.keyconfig_preset_add", text="", icon='REMOVE').remove_active = True + + row = col.row() + + row.operator("wm.keyconfig_import", text="Import...", icon='IMPORT') + row.operator("wm.keyconfig_export", text="Export...", icon='EXPORT') + + row.separator() + + rowsub = row.row(align=True) + + rowsub.menu("USERPREF_MT_keyconfigs", text=text) + rowsub.operator("wm.keyconfig_preset_add", text="", icon='ADD') + rowsub.operator("wm.keyconfig_preset_add", text="", icon='REMOVE').remove_active = True # layout.context_pointer_set("keyconfig", wm.keyconfigs.active) # row.operator("wm.keyconfig_remove", text="", icon='X') @@ -413,14 +422,14 @@ def draw_keymaps(context, layout): box = col.box() row = box.row(align=True) - prefs = context.preferences - inputs = prefs.inputs - show_ui_keyconfig = inputs.show_ui_keyconfig + pref = context.preferences + keymappref = pref.keymap + show_ui_keyconfig = keymappref.show_ui_keyconfig row.prop( - inputs, + keymappref, "show_ui_keyconfig", text="", - icon='TRIA_DOWN' if show_ui_keyconfig else 'TRIA_RIGHT', + icon='DISCLOSURE_TRI_DOWN' if show_ui_keyconfig else 'DISCLOSURE_TRI_RIGHT', emboss=False, ) row.label(text="Preferences") |