Age | Commit message (Collapse) | Author |
|
Setting the search match flag every time property search runs can
invalidate the results for panel headers. Instead, clear the flag on
every redraw and or the result of every search in the panel to it.
|
|
"Reported" by Valentin (Poulpator).
|
|
|
|
We don't use the other variables in the sorting struct,
so we might as well use the panels directly.
|
|
The search should check if a panel is active before changing its
expansion, otherwise it sets the expansion for all of the region's
panels, even invisible ones in other tabs.
|
|
This code had grown overly complicated and hard to understand.
The improvements in this commit:
- Avoid allocating a duplicate of every active panel.
- Instead of complicated logic to calculate each panel's offset,
just keep track of the current offset while iterating through.
- More readable code structure, better comments.
Note that calcuting the X offset here is a relic from pre-2.5 when
panels could be aligned horizontally. I kept this in, but it would
be reasonable to remove it in the future.
|
|
This makes these variable names more consistent with current standards,
mostly by not over-abbreviating already short words. The following commit
will refactor this function.
|
|
|
|
Discovered an unused panel runtime flag as well, which this commit
removes.
|
|
Also cleaned up some grammar and wording issues, and switched a case
in an if statement to remove a double negative.
|
|
|
|
Stack panels (for modifiers, etc..) also get their expansion from their
associated list data. This means that property search expansion needs
to properly update the list data, which can be accomplished by calling
`set_panels_list_data_expand_flag`.
This commit also moves this logic to `UI_panels_end`, where it fits
better.
|
|
This commit moves the "get panel expansion from list data" function to
UI_panels_end, which is an improvement because it's more centralized.
|
|
This adds a search bar to the properties editor. The full search for
every tab isn't included in this patch, but the interaction with
panels, searching behavior, UI, region level, and DNA changes are
included here.
The block-level search works by iterating over the block's button
groups and checking whether they match the search. If they do, they
are tagged with a flag, and the block's panel is tagged too. For
every update (text edit), the panel's expansion is set to whether
the panel has a result or not. The search also checks for matching
strings inside enums and in panel labels.
One complication to this that isn't immediately apparent is that
closed panel's subpanels have to be searched too. This adds some
complexity to the area-level panel layout code.
Possible Future Improvements:
- Use the new fuzzy search in BLI
- Reset panels to their expansion before the search started if
the user escape out of the text box.
- Open all child panels of a panel with expansion.
Differential Revision: https://developer.blender.org/D8856
|
|
|
|
Also use back-slash instead of '@'.
|
|
For modifier shortcuts we added a "custom_data" field to panels.
This commit uses the same system for accessing the list data that
corresponds to each panel. This way the context is only used once
and the modifier for each panel can be accessed more easily later.
This ends up being mostly a cleanup commit with a few small changes
in interface_panel.c. The large changes in the UI functions are due
to the fact that the panel custom data is now passed around as a
single pointer instead of being created again for every panel.
The list_index variable in Panel.runtime is removed as it's now
unnecessary.
Differential Revision: https://developer.blender.org/D8559
|
|
This function was called when the modifier list changes and the panel
list has to be rebuilt. Originally I thought it was necessary to to remove
the block immediately when the panel was removed, but we can just
leave it and it will be removed later in the UI drawing process.
Removing this results in fewer string lookups.
|
|
|
|
|
|
Currently the panel handler loops through every block and every button
for every single panel. This commit moves that check to happen a single
time at the beginning.
|
|
We need to only collapse or expand the first panel under the cursor
rather than all of them. Note that whether the parent panel or
the subpanel is first depends on the order of the uiBlocks in the
region's list.
|
|
The code for handling panel events was much more complicated than it
needed to be. This commit removes some unecessary function calls and
variables, reduces indentation levels by returning early, and does
some other general cleanup.
|
|
Somehow the panel category drawing functions ended up in the middle
of the region event handling code. This commit moves them to their
own section next to the rest of the drawing code.
|
|
|
|
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`.
Since we always set the clear value before clearing, it is unecessary
to track the clear color state.
Moreover, it makes it clearer what we clear the framebuffer to.
|
|
|
|
Ctrl click on a panel should collapse all other panels but leave that panel
expanded. In a recent cleanup commit that was mistakenly reversed.
|
|
- Use const in some places where applicable
- Use consistent variable names in some places
- Use "r_" prefix for return arguments
- Declare variables in smaller scope where they are used
|
|
Horizontal panel alignment hasn't been used for years, and we have no
plans to use it in the future. It adds a fair amount of complexity to
the panel code which makes adding features take longer.
This code removes the X closing flag, and all of the logic / variables
unused without it.
This commit includes a file subversion bump.
Differential Revision: https://developer.blender.org/D8601
|
|
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
|
|
|
|
This adds support for panel categories to the instanced panel system
used for modifiers and others. The change is pulled from D7997 where
it is needed for FCurve modifiers, but it is unused now.
The change is simple and basically amounts to checking the panel
category where it was overlooked before.
|
|
The panels are rebuilt when a modifier is removed so the button handlers need
to properly finish. By adding a context argument to the panel_delete function
this will happen properly.
|
|
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
|
|
|