Commit Graph

1114 Commits

Author SHA1 Message Date
700346d377 Fix T63137: crash pressing enter to confirm menu, after recent changes. 2019-03-30 20:37:45 +01:00
fdf92b923a Fix T63037: Accelerator keys fail when another key is highlighted 2019-03-28 16:44:27 +11:00
5a1a633d04 UI: minor change to active-default logic
Don't attempt to activate default button if it's already active.

Also expand on the flags comment.
2019-03-28 00:59:50 +11:00
2d34420648 UI: support an 'active default' button for pop-ups
Use this for the save confirmation dialog so it has a default action
when pressing enter which draws with a highlight so it's clear what the
default action is (the dialog was just closing before).

Resolves T57686
2019-03-28 00:26:00 +11:00
e26b67fa1e Fix popovers from enums failing on drag-release 2019-03-27 15:35:49 +11:00
1bde690e91 Cleanup: style, use braces for editor/interface 2019-03-26 21:16:13 +11:00
e583642312 UI: add UILayout.prop_popover_enum function
Support for RNA enum buttons that activate popovers when clicked.

This means we get useful tooltips, shortcuts and Ctrl-Wheel cycling
over enum items.

It also avoids inconvenient & slow access of enum values currently done
via RNA type lookups on the type to get the name & icon to use for a
regular popover button.

Resolves T57738
2019-03-25 19:05:13 +11:00
ca0cc0518f Cleanup: simplify toggle button logic 2019-03-25 16:21:13 +11:00
6dbe96757b Cleanup: return argument naming 2019-03-25 12:19:55 +11:00
e86e0aad55 Cleanup: use braces for interface code 2019-03-25 11:16:46 +11:00
809101e69e UI: support Ctrl-C copy for popover buttons
Match menu logic that sets the Python expression to call the popover.
2019-03-24 10:52:23 +11:00
4dc6259cfe Cleanup: doxy sections & function name 2019-03-23 12:10:23 +11:00
Dalai Felinto
820be185bc Silence false positive uninitialized warning
Techically we would never get to the part where we would use the
uninitialized value due to an assert.
2019-03-22 16:31:23 -03:00
be750e2aee Cleanup: minor UI code changes
- Rename ui_but_find_active_in_region -> ui_region_find_active_but
- Remove ui_but_is_active (use ui_region_find_active_but instead)
- Re-order ui_but_* functions take the button as their first arg.
2019-03-23 00:18:16 +11:00
2d60618746 UI: refactor queries into interface_query.c
interface_handlers.c is quite large (over 10k lines),
move general button utility functions into a separate file.
2019-03-22 23:38:24 +11:00
27da43ba86 UI: refactor color picker flags out of buttons
These are specialized color picker options which don't need to be
stored in the button (frees of flags for buttons too).
2019-03-22 15:43:23 +11:00
b98fe9e707 Cleanup: move functions into doxy sections
Also use const args for queries.
2019-03-21 14:19:45 +11:00
9b3818762a Cleanup: use doxy sections for interface_handlers 2019-03-21 13:53:27 +11:00
0bbff8a711 Cleanup: move scroll step into own function 2019-03-21 11:58:03 +11:00
06585e0b13 UI: popovers scroll now changes offset directly
Mouse wheel on menus changes the selected item item which doesn't work
well for popovers since buttons aren't always stacked vertically.

Resolves T62777
2019-03-21 11:37:44 +11:00
83753d1d29 Cleanup: split menu scrolling function
The same function scrolled to a location and button (depending on args).
2019-03-21 11:36:51 +11:00
da1350acdc Fix T60815: drag & drop crash when search menu is opened immediately after.
Patch by matc, some further refactoring by me.

Differential Revision: https://developer.blender.org/D4250
2019-03-20 19:50:21 +01:00
ef09aff61c Preferences: add threshold for cursor motion
A hard coded threshold was used to ignore cursor motion,
make this a preference since tablet users may want to increase it
since a pen hovering isn't as easy to keep still as a mouse.

Resolves T56278
2019-03-20 22:19:16 +11:00
5739506104 UI: scale cursor motion threshold by DPI
This was using hard coded values of 2-3px.

Move both drag and motion thresholds to defines.
2019-03-20 02:52:55 +11:00
81a03e17f7 Merge branch 'blender2.7' 2019-03-14 19:00:10 +01:00
57b5852bc8 Fix T62120: number button editing outside of soft max range jumps. 2019-03-14 18:29:42 +01:00
Dalai Felinto
92182495da Fix T62016: Outliner visibility icons drag behaviour broken
We are mixing bool and fancy 3-in-1 func-set buttons in the outliner.
So they would return different pushed state in
ui_drag_toggle_but_pushed_state().

We now have a callback function that allows the button to set its own
pushed_button_state callback function.

Note: This is a bit of overkill since we are planning to change the
3-in-1 outliner buttons. That said, it may be nice to have, since in the
future we can mix those buttons for other things.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4434
2019-03-01 15:39:04 -03:00
63d77d6d27 Cleanup: rename wmEventHandler_* base -> head
Makes it more clear it's the header/start of the struct.
2019-02-20 09:43:29 +11:00
81aa2a93e9 Fix T61274: duplicate current workspace makes the workspace menu disappear.
Differential Revision: https://developer.blender.org/D4321
2019-02-19 18:43:32 +01:00
eae2942474 WM: move UI handler to it's own type 2019-02-19 16:17:21 +11:00
bf9407fc71 Cleanup: spelling 2019-02-18 12:47:17 +11:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
d132c44652 UI: impossible to activate RMB menu on menu items
Right clicking on a menu item now closes it's sub-menus and opens
the button's context menu.

This is needed for adding them to the quick favourites menu.

Resolves T58729, T61015.
2019-02-15 16:13:28 +11:00
b54b14582b Fix T61505, T61280, bugs in button drag toggle after recent changes. 2019-02-13 19:00:11 +01:00
43156d8304 Preferences: remove tweak/drag threshold distinction
Currently the preferences have both tweak and drag threshold,
this is confusing because most actions users would consider
dragging use the 'tweak' setting.

Now one drag threshold is used for both, with a maximum limit of half
the button unit-size in case of dragging UI elements.
2019-02-11 15:48:46 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
2778ecb58c UI: make drag lock work also when buttons have > 2 states or use callbacks.
This will help with upcoming outliner visibility icons with 3 states.

It is done by using the icon to identify the state. If that is not unique
there is no visible difference to users anyway.
2019-02-05 20:21:03 +01:00
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
8c68ed6df1 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 02:40:00 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
d4c851b976 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-16 00:26:16 +11:00
b8e8c0e325 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
745311ed4c Fix T60506: Menu toggle clicks pass through to area 2019-01-15 11:42:07 +11:00
Justin Jones
db36eff9f7 UI: make pie menus stick only when tapping key.
When holding down the key for a while, the pie menu will disappear when
releasing the key. This is under the assumption that in this case the user
decided to cancel the action.

Differential Revision: https://developer.blender.org/D4180
2019-01-10 15:55:34 +01:00
d5c24f2030 Correct error in recent button type check 2019-01-07 09:15:07 +11:00
95736683a9 UI: length now scales proportionally w/ multi-but
Use for object dimensions.
2019-01-05 20:09:25 +11:00
66c3eb36d2 Cleanup: use typed unsigned ints 2019-01-04 11:09:18 +11:00
53d655a0b3 Cleanup: use typed unsigned ints 2019-01-04 11:06:44 +11:00
853a03c555 Fix T58870: submenus don't open for some specific mouse positions. 2019-01-03 12:15:29 +01:00
a7b3d58066 Fix T58014, T58650: issues with hex color and Filmic view transform.
Hex color values are now always in sRGB space, as would be expected by
most other applications. Previously they were in display space and using
the view transform.
2018-12-13 19:25:47 +01:00