Age | Commit message (Collapse) | Author |
|
Widget drawing code already supported drawing right-aligned, grayed out
shortcut strings. This patch generalizes things a bit so this can also
be used to draw other hints in the same way. There have been a few
instances in the past where this would've been useful, D11046 being the
latest one.
Note that besides some manual regression testing, I didn't check if this
works yet, as there is no code actually using it (other than the
shortcuts). Can be checked as part of further development for D11046.
A possible further improvement would be providing a way to define how
clipping should be done. E.g. sometimes the right-aligned text should be
clipped first (because it's just a hint), in other cases it should be
left untouched (like current code explicitly does it for shortcuts).
Removes the `UI_BUT_HAS_SHORTCUT` flag, which isn't needed anymore.
|
|
Differential Revision: https://developer.blender.org/D11106
|
|
I landed D10527 in rB1a8aee0a7cec accidentally, and the version there was
missing a name change discussed in review. This commit just renames the
boolean variable controlling the special behavior for attribute search.
Original message meant for this change:
For geometry nodes we will use search buttons to display a list of
attributes available the last time the node tree was executed (D10519).
Because this list is just a hint, we need to be able to enter any string,
not just strings from the search items.
This patch adds a boolean option to string buttons to enable this.
The change is quite simple, changes to behavior are only required in
two places. The type-specific button struct changes help a lot here.
Differential Revision: https://developer.blender.org/D10527
|
|
Currently when you open an RNA collection search button, like a
vertex group selector, the search filter isn't applied until you
start typing, in order to display every option at the start.
Otherwise they wouldn't be visible, since the search filter would
run for the current text.
Currently this check happens in one place, but it relies on the
`changed` value of `uiBut`. This is fine in the interface directory,
but anywhere else it would require exposing `uiBut.changed`, which
is probably too low-level to expose.
The solution is adding an `is_first` argument to the search callbacks,
which is nice for a few reasons:
- They work at a higher level of abstraction, meaning they don't
have to worry about how exactly to tell if this is the first
search.
- It makes it easier to do special behavior when the search menu
is first opened.
- Then, obviously, it makes that state accessible without including
`interface_intern.h`.
Needed for attribute search: T85658
Differential Revision: https://developer.blender.org/D10528
|
|
|
|
|
|
When a searchbox-button for string properties (e.g. to reference a vertex
group) was created, and a value was set, the tooltip timer would constantly get
cancelled.
That was because the code to validate the current value
(`ui_but_search_refresh()` - early exists for non-string properties) would call
a helper function to update the search results (`ui_searchbox_update_fn()`),
which always reset tooltips. Resetting them in the helper makes sense, for as
long as the searchbox is open. But while it's not, and we just validate the
current value, it shouldn't do this.
This was also noticable in the output settings of dynamic paint, and probably a
number of other cases (especially with script UIs which tend to use string
properties more often).
Likely caused by de53c039adb4.
|
|
Long data-block names are clipped to fit into data-block selector menus. For
linked data-blocks, there's also a hint indicating the source library, which
takes further space and may get clipped too.
So this commit adds a tooltip to the menu items, which displays the full,
unclipped data-block name and the unclipped library name. Plus, the library
path is shown too, which is also useful info.
Adds helper functions for search menu item tooltips, so these are easier to add
to other search menus in future.
Part of T84188.
|
|
Issue is visible here https://developer.blender.org/F8626313.
If there is enough space for both the item name and the library hint, display
both. Otherwise, clip either the item name, the library hint, or both so that
not more than 60% and 40% of the available width are used repectively.
There are further improvements we could do, as noted in T84188, this just fixes
the regression for the release.
Part of T84188. There were multiple reports about this, see merged in and
mentioned reports in T84188 and T78012.
|
|
We have our own assert implementation, `BLI_assert()` that is prefered over the
C standard library one. Its output is more consistent across compilers and
makes termination on assert failure optional (through `WITH_ASSERT_ABORT`).
In many places we'd include the C library header without ever accessing it.
|
|
|
|
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
|
|
The current on-size-fits-all `uiBut` creates quite a mess, where it's
hard to reason about which members are free for use, under which
conditions they are used and how.
`uiBut` also has members that aren't used at times, violating the "don't
pay for what you don't use" principle.
To address this, we want to move to typed buttons, where `uiBut` is just
a base struct and each type extends it as needed. That structures data
better and type specific data is only available if it's actually used by
a button type.
Two trade-offs:
* Many casts to the derived type have to be done.
* Sometimes we change the button type after it's created. So I had to
add logic to reallocate the button for use with the new, possibly
derived struct. Ideally that wouldn't be needed, but for now that's
what we have.
Part of T74432.
Differential Revision: https://developer.blender.org/D7610
Reviewed by: Brecht Van Lommel, Campbell Barton
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
Regression from d6cefef98f87a
This also fixes an unreported issue where finding an exact match
wasn't being detected for items that contained an ID prefix.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/interface` module.
No functional changes.
|
|
Rather than a `L` (linked), `O` (overridden) or `M` (missing) prefix for the
name, show the existing library status icons. See D7999 for screenshots.
Note that when using preview icons, or if the search menu contains items with
own icons (e.g. brush icons), we still fallback to the prefix solution.
Zero or fake user is still indicated with a prefix.
Differential Revision: https://developer.blender.org/D7999
Reviewed by: Bastien Montagne, William Reynish
|
|
Should separate the data-block name better from the library name and improve
readability.
|
|
Noted in T77504
|
|
|
|
|
|
|
|
- Show dimmed text for the menu entries leading up to the menu item.
- Show icons between the menu text and menu item.
- Use unicode right pointing triangle instead of arrow.
|
|
This has some advantages over operator search:
- Some operators need options set to be usefully accessed.
- Shows key bindings to access menus
(for actions that don't have key bindings themselves).
- Non operator actions such as check-boxes are also shown.
- Menu items can control execution context, using invoke or execute
where appropriate so we can control how the operator runs.
Part of the design task T74157.
This can be tested using the 'Experimental' preferences section
or selected in the key-map editor.
|
|
|
|
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.
|
|
This function is a very special refresh function just for floating
regions. _initialize is more consistent with ED_area_initialize() so use
that too.
Also adds assert.
|
|
Prepare for enabling ReflowComments.
|
|
|
|
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
|
|
|
|
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
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.
|
|
|
|
Prevents clang-format wrapping text before comments.
|
|
Word wrap and alignment layout args only used by UI_fontstyle_draw
were vars in uiFontStyle.
These were written to before drawing, so better pass as an argument.
Pass uiFontStyle & uiWidgetColors as const args.
|
|
From own changes in that area... Now we also enforce handling shortcuts
in case relevant drawflag of searchbutton is set. Should allow to cover
all cases, hopefully.
|
|
This option defines whether or not menu items drawing code must
separate drawstring in two, keeping right part at all cost.
This is used to show shortcuts of operators' enum entries usually.
Previous way to decide that was based on button having an RNA prop
pointer, assuming those without it were not 'data buttons' and hence
needed the shortcut special handling thingy.
That's wrong is many, many cases (especially since search templates
often generate more than one buttons, not all linked to actual RNA
data). So instead now checking whether a button has an optype set or
not, hopefully this will be much more accurate...
Other solution if thsi also fails, is to add new flag to buttons, and
explicitely set it when needed, instead of trying to guesstimate...
|
|
Otherwise these are not visible well with the new dark theme.
|
|
|
|
|
|
This translates the gl calls to the new GPU_ wrappers from D3501.
Given it's tedious and repetitive work, this patch does as much as it can with search + replace, the remainder of the gl calls will need to be manually dealt with on a case by case basis.
This fixes 13 of the 28 failing editors when building without opengl.
For the list of substitutions see D3502
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3502
|
|
Useful for drawing any kind of region-background.
|
|
|
|
|
|
Each region type is quite separate and file was getting too big.
|