Age | Commit message (Collapse) | Author |
|
Some code delt with panel merging in earlier versions of Blender,
which is no longer needed. Other code delt with controls that aren't
used anymore, and in some cases have region-level equivalents.
There's a surprising amount of this unused code in this file, so removing it
will be helpful for the future.
Differential Revision: https://developer.blender.org/D7938
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/interface` module.
No functional changes.
|
|
|
|
The shortcuts act on the modifier with its panel under the mouse.
The following shortcuts are enabled by default:
- Remove modifier: X, Delete
- Apply modifier: Ctrl A
- Duplicate modifier: Shift D
More shortcuts can be added in the keymap.
Each panel can now store a custom data RNA pointer, and a new
function is added to get the custom data for the panel under the
cursor. This custom data could be used to refactor the "List Panel
System" to generalize it and integrate it further with RNA.
The same functionality will be added in further commits where it
applies to constraints, grease pencil modifiers, and effects.
Differential Revision: https://developer.blender.org/D8031
|
|
A small cleanup to use fewer if statements.
|
|
|
|
The view should only reset for the ctrl-click mode that collapses
all other panels.
|
|
This patch implements the list panel system D7490 for constraints.
In this case the panels are still defined in Python.
The layouts are also updated to use subpanels and the a more organized
single column layout. There may be more tweaks necessary for the
layouts.
Reviewed By: Severin, billreynish, Mets
Differential Revision: https://developer.blender.org/D7499
|
|
|
|
If the panel is already open and you ctrl click on its header, its
sub-panels are now expanded / collapsed instead of toggling the
expansion for all other panels. If you're toggling a panel's expansion
it's already in view anyway, so there is no need to collapse the
other panels.
Differential Revision: https://developer.blender.org/D8042
|
|
|
|
This is a pretty quick fix; the solution is just removing all the
instanced panels whena panel is unregistered. This also necessitates
adding the option to call UI_panels_free_instanced with NULL context.
Differential Revision: https://developer.blender.org/D7977
|
|
This solves a crash when switching from the modifiers tab to an armature
object and expanding a panel. Thanks to Alexander Gavrilov for mentioning
the problem.
|
|
During normal drawing there is a rather complicated method to check
whether the panels should be animating. It's not set up to deal with
the panel expansion changing from outside the UI, which is now possible
with the panel expansion connected to the modifier's show_expanded
property.
The solution is to activate panel animation if setting the expansion
property has changed.
|
|
This adds a modal operator called Edge Pan, which is meant to run invisibly
while something inside a region is being dragged. This patch applies this
to dragging panels, but it can be used elsewhere too.
The speed (which is defined relative to how far the mouse is beyond the
boundary) and delay are easily adjustible. and the speed also increases
smoothly from a start value to a max to make it feel more interactive
and less robotic.
Differential Revision: https://developer.blender.org/D7465
|
|
|
|
This implements a general system to implement drag and drop, subpanels,
and UI animation for the stack UIs in Blender. There are NO functional
changes in this patch, but it makes it relatively trivial to implement
these features for stacks.
The biggest complication to using panels to implement the UI for lists
is that there can be multiple modifiers of the same type. Currently there
is an assumed 1 to 1 relationship between every panel and its type, but
there can be multiple list items of the same type, so we have to break
this relationship. The mapping between panels and their data is stored
with an index in the panel's runtime struct.
To make use the system for a list like modifiers, four components
must be added:
1. A panel type defined and registered for each list data type, with a
known mapping between list data types and panel idnames.
1. A function called by interface code to build the add the panel
layouts with the provided helper functions.
- UI_panel_list_matches_data will check if the panel list needs to
be rebuilt.
- UI_panels_free_instanced will remove the existing list panels
- UI_panel_add_instanced adds a list panel of a given type.
3. An expand flag for the list data and implementations of
get_list_data_expand_flag and set_list_data_expand_flag.
4. For reordering, the panel type's reorder callback. This is called
when the instanced panels are drag-dropped. This requires
implementing a "move to index" operator for the list data.
Reviewed By: Severin, brecht
Differential Revision: https://developer.blender.org/D7490
|
|
The reason to have this isn't quite clear, but it looks like a vestige
of the 2.5 transition. Removing this makes dragging panels feel
much more responsive.
Thanks to Julian Eisel @Severin for the original change.
Differential Revision: https://developer.blender.org/D7803
|
|
The previous commit for this issue, 8e08d80e52d6, missed the case
where the panel animates to its aligned position when the mouse is
released.
|
|
While dragging panels, the region size would change which would feel glitchy.
See D7462 for a demo of the issue.
|
|
Was incorrectly triggering animation for panels which would be free'd
before the animation ended.
|
|
Currently the background of a panel is drawn on top of its subpanels
when it is dragged. The solution is to also "select" the subpanels so they
are drawn on top in UI_panels_draw.
Differential Revision: https://developer.blender.org/D7440
|
|
The behavior for subpanels was incorrect, and the ideal behavior isn't even clear.
This disables the "collapse all" ctrl click feature for panels that have parents.
Differential Revision: https://developer.blender.org/D7355
|
|
The 10g Intel/Win driver doesn't work well with our emulated
intermediate mode. This patch alters the drawing of the drag widget of
the panels to reduce unneeded drawing.
The previous method would draw 16 boxes per widget. This new way would
cache this drawing in a GPU batch and just move the matrix around.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7345
|
|
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432.
Now the area and region naming conventions should be less confusing.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|
|
|
|
Both the MS headers and blender headers define the HKEY
which gives all kind of inclusion order issues.
This diff renames all *KEY constants to EVT_*KEY to resolve
this conflict.
Reviewed By: brecht , dfelinto
Differential Revision: http://developer.blender.org/D7164
|
|
|
|
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
|
|
Under the special circumstance of double clicking and then opening a
panel with sub-panels again, the parent panel's offset in y-direction
was added twice to the child panels: once inside "get_panel_real_ofsy"
and once within "align_sub_panels".
This introduced a visible glitch.
Reviewed by: Julian Eisel
Differential Revision: https://developer.blender.org/D6942
|
|
Panel alignment was only updated when panel size changed. Now we can
also recognize changes in the category tabs offset and tag panels
for alignment updates.
|
|
`ARegion.alignment` unfortunately is a mixture of value and bitflag
enumerations. When checking for left/right/top/bottom region alignment,
the flags have to be masked out usually.
Most of the fixed cases here probably didn't cause issues in practice,
but could in fact break at any point when surrounding logic changes.
In fact the assert in #region_visible_rect_calc() failed in an older
file from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949035. This
fixes it.
|
|
Nearly all byte-color functions use 'uchar'
causing casts when then colors were passed in.
Declare as uchar to remove the need for casts.
|
|
The offset for check-boxes in sub-panels wasn't being scaled correctly.
|
|
|
|
Currently if a panel becomes empty (draw simply returns), it stays
at the last non-empty height. This seems to be caused by some legacy
checks that may be completely obsolete, but the safest fix is to at
least allow resetting height when the panel is open.
|
|
These were drawing without a backdrop.
|
|
This makes the code confusing since we now have two other kinds of tabs
(navigation bar and panel categories).
|
|
|
|
Internally tool settings have been moved to the 3D view.
Added the ability for to draw panels from another space/region
so they can be mirrored in the properties editor.
|
|
|
|
This makes the properties editor navigation bar less saturated. Internally
the icon theme coloring was refactored a bit to move more towards the button
drawing code.
|
|
|
|
Prepare for enabling ReflowComments.
|
|
Take the entire gutter used for panel tabs into account.
Introduced in recent fix for T61554
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|