41 Commits

Author SHA1 Message Date
Campbell Barton
3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
Campbell Barton
4986f71848 Event System: remove tweak events in favor of click-drag
Supporting two kinds of dragging is redundant, remove tweak events as
they only supported 3 mouse buttons and added complexity from using the
'value' to store directions.

Support only click-drag events (KM_CLICK_DRAG) which can be used with
any keyboard or mouse button.

Details:

- A "direction" member has been added to keymap items and events which
  can be used when the event value is set to KM_CLICK_DRAG.

- Keymap items are version patched.

- Loading older key-maps are also updated.

- Currently the key-maps stored in ./release/scripts/presets/keyconfig/
  still reference tweak events & need updating. For now they are updated
  on load.

Note that in general this wont impact add-ons as modal operators don't
receive tweak events.

Reviewed By: brecht

Ref D14214
2022-03-02 15:31:50 +11:00
Campbell Barton
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Campbell Barton
06ac655b8d WM: expose the "any" state of KeyMapItem modifiers
Change KeyMapItem.alt/ctrl/shift/oskey to integer types,
where -1 is used to ignore the modifier when matching key-map items.

It was only possible to set all modifiers to -1 at once from RNA
using the 'any' property.
Afterwards individual modifiers could be set back to true/false.
Although these key-map items could not be exported/imported.

Exposing the values directly avoids the need for cumbersome workarounds.
2021-09-17 16:52:33 +10:00
Leon Zandman
c317f111c1 Cleanup: Spelling Mistakes
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.

Differential Revision: https://developer.blender.org/D11663

Reviewed by Harley Acheson
2021-06-22 10:54:50 -07:00
Leon Zandman
865d1889da Cleanup: spelling
Includes fixes to misspelled function names.

Ref D11280
2021-05-21 22:23:07 +10:00
Yevgeny Makarov
c24b1c060d Fix T77743: Number pad key-map items missing from search 2020-06-23 17:55:36 +10:00
Julian Eisel
7ff0f896e8 UI: Use different icon to remove user-created shortcuts in Preferences
There was no way for users to visually tell appart shortcut items
they've added themselves and the default ones. Both used the same 'x'
icon to remove the item.
Modified items already showed a back-arrow icon; this commit makes
user-created shortcuts use an icon that has both, a back-arrow and a
'x'.

The icon is in fact from the Movie Clip Editor, but William Reynish and
I concluded that it's not worth creating and adding a new one just to
short-term fix this small annoyance. And the icon actually fits the
purpose surprisingly well :) {F8485176}
2020-04-20 15:56:57 +02:00
Yevgeny Makarov
da101eddef UI: input preferences layout tweaks for keymap search and zoom settings
Differential Revision: https://developer.blender.org/D6979
2020-03-09 17:11:24 +01:00
Campbell Barton
5be0e3430d GHOST/Keymap: support for detecting repeat events
- Keymap items now have 'repeat' boolean which can be set
  to make keymap items respond to key repeat events or not.
- Support for X11 & WIN32 (not macOS currently).

This allows for the possibility to perform actions while a key is held
and finish the action upon release.

Thanks to @Severin for review and WIN32 support.
2020-03-06 17:31:28 +11:00
Brecht Van Lommel
604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
Jacques Lucke
ceded86de3 Fix T61830: Remove option to add new keymap item in search mode
This was not working well, because the search text was removed
after pressing this button. Finding the item that was inserted
was not easy.

Removing the option seems to be the best solution for now.
2019-04-04 17:38:31 +02:00
Campbell Barton
bbe98b18fb Cleanup: use preferences prefix for Python operators 2019-03-02 00:23:42 +11:00
Campbell Barton
6cc5c28d15 Fix UI extension removal
App-templates & keymap names had their extensions removed twice.

Confusing for filenames containing dots.
2019-01-25 13:49:59 +11:00
William Reynish
2b0fb0d7bf Fix keymap preferences UI layout issues for modifier keys. 2019-01-21 17:26:35 +01:00
Brecht Van Lommel
f351c7bf23 Preferences: tweak themes/addons/keyamps buttons at the top.
Make layouts more consistent between them, give more room for search field.
Addon online resources links were removed as the links are dead.
2019-01-17 11:28:56 +01:00
Severin
a77b63c569 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
2019-01-04 22:18:23 +01:00
Campbell Barton
63fcbfc3a7 RNA: naming, user-preferences -> preferences 2018-12-21 12:55:02 +11:00
Campbell Barton
a9bf6a3b3a UI: hide keymap preferences when filter is used 2018-11-22 07:52:34 +11:00
Campbell Barton
916446e83f Cleanup: move keymap hierarchy into own file 2018-11-20 11:38:13 +11:00
Campbell Barton
f8c16b0175 Cleanup: move bpy_extras.keyconfig_utils to own module
bpy_extras were meant to be useful high-level helper functions for
script authors to perform common operations,
to avoid writing to verbose API's.

bpy_extras.keymap_utils contains some specialized API calls
mainly intended for Blender's own internal use.

Move keymap import export to internal API.
2018-11-20 11:06:01 +11:00
Campbell Barton
5f9de429ac UI: show keyconfig prefs directly under preset
The keyconfig preset and it's preferences were too far apart,
show the preferences under the preset in a collapsible box.
2018-11-20 09:15:53 +11:00
Brecht Van Lommel
2ac65f6153 UI: new icon set by Andrzej Ambroz.
This is a monochrome icon set, with a more modern look and icons for
various features that did not have a proper icon before.
2018-10-08 19:46:00 +02:00
Campbell Barton
1c3411ac89 Keymap: expose tool keymaps in the preferences
Currently some modes share tool keymaps, we might want to disable
this since it's confusing editing one thing in multiple places.

However this should be resolved in the tool definitions.
2018-10-03 15:55:57 +10:00
Campbell Barton
d3a72033f6 RNA: UILayout.split(..) 'percentage' to 'factor'
Misleading name since it's between 0..1.

Use as a keyword argument to prepare for keyword only args.

Also document that leaving unset has special behavior.
2018-08-28 12:50:11 +10:00
Campbell Barton
b66aa0b0a6 Cleanup: pep8 2018-07-03 06:48:44 +02:00
Joshua Leung
fde45132de Fix T52861: Keymap editor filter doesn't show shortcuts using "+" 2017-09-21 16:35:47 +12:00
raa
17b3097205 Adjust kmi header 2017-03-10 15:10:40 +03:00
Julian Eisel
a529ad9707 Minor adjustments to keymap editor layouts
* Remove unnecessary big margins after triangle icons (esp. for keymap items they where waaay to big)
* Remove ugly margin after "Foo (Global)" entries
* Add little margin after expanded key maps
2016-02-20 00:46:17 +01:00
Julian Eisel
8d73805df0 Fix wrong indentation of items in keymap editor
Actually, 3 issues here:
* Keymap items of "Foo (Global)" maps weren't indented enough
* Items after a opened "Foo (Global)" map were indented too much (col was overridden then).
2016-02-20 00:28:47 +01:00
Bastien Montagne
8e37a45ac0 Fix (unreported) 'pad9' not shown by UserPrefs' KeyBinding filter.
Minor glicth, but still... Safe for 2.73.
2015-01-02 18:24:25 +01:00
Campbell Barton
a15be34389 Code cleanup: unused python vars & imports
Use frosted rather then pyflakes
2014-04-25 05:36:16 +10:00
Sv. Lockal
7397ef8666 UI: Fix more double ":" in UI labels 2014-03-27 07:15:08 +04:00
Campbell Barton
03018353f6 Fix T38827: Input preferences can not find Left Mouse or Left Arrow 2014-02-26 00:39:20 +11:00
Campbell Barton
92653fe944 Keymap search: check 'key_modifier' as well as 'type' 2014-02-26 00:13:20 +11:00
Brecht Van Lommel
a5cfd3f518 Fix T38635: key configuration search not working well when typing 'slash'. 2014-02-17 15:03:24 +01:00
Brecht Van Lommel
a0e03bb5cf Fix part of T38425: keymap editor search for "1" only showed numpad 1, not 1-key. 2014-02-03 15:48:50 +01:00
Brecht Van Lommel
be849f6f7e Fix T37038: user preferences > input category names unnecessarily cut off. 2014-01-29 16:36:42 +01:00
Campbell Barton
da16b3000b Fix T38044: Filter Key Binding shows Incorrect result 2014-01-07 19:27:44 +11:00
Campbell Barton
67fb71ade5 fix [#37038] User prefs > Input - Category names cut off 2013-10-10 23:36:09 +00:00
Campbell Barton
b2b6d56443 move keymap ui into modules, its not loaded on startup anymore. 2013-07-08 22:57:51 +00:00