Our IME input system relied on passing around pointers to global variables.
However this will not work as the Wayland input handling is multithreaded so the content of the global variable would change while the event loop were reading the data.
Pull Request: https://projects.blender.org/blender/blender/pulls/138871
The conversion from int to float is not supported natively
so it ends up happening beforehand on the CPU or as a
step before the vertex buffer can be used. It's better to just
upload floats in the first place.
Related to:
- 1e1ac2bb9b
- 617858e453
Pull Request: https://projects.blender.org/blender/blender/pulls/138855
Several small improvements to the layout of the search menu:
* Avoid the separator arrow on highlighted items being cutoff
* Properly center and prevent overlap of the scroll indicator
arrows at the top and bottom
* Improve robustness with different zoom levels
* Overall more unified spacing and margins
This patch was originally authored by Yevgeny Makarov (@jenkm).
Pull Request: https://projects.blender.org/blender/blender/pulls/112422
Part of #134755 / #134766
Makes asset and file browser use up to two lines to display the name of the asset or file under
preview images. Lines are wrapped using our existing wrapping algorithm at characters like spaces,
hyphens, under-scores, etc.
This leads to much less information loss because of clipped labels in common cases. When displaying
assets or files as previews the labels would become rather useless in many cases. Especially with
smaller preview sizes.
When there's still not enough space to display the full asset or file name, the second line is
truncated in the middle, leaving the beginning, and some of the end of the label visible. This
produced best results in testing.
Pull Request: https://projects.blender.org/blender/blender/pulls/136907
Since 115d809358 the scroll bars are darker on light theme. But this
makes the circular "handles", in Timeline for example, to not be
visible. This is because we start with the item color and then make
it darker when over a threshold. But we never make them lighter when
they are dark. This PR makes these darker or lighter depending on the
base color.
Pull Request: https://projects.blender.org/blender/blender/pulls/137618
Part of incoming refactors in interface layout c++ code, this enables
forward declaring this enum type. Enum is renamed as `EmbossType` and
moved to `blender::ui` namespace. No user visible changes expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/136725
If you scale down the color pickers to very small sizes the calculation
of the handle size of the value slider will cause it to proportionally
increase as it all approaches zero. This PR just calculates the size in
a better way and clamps it as well. For both the round and square
versions.
Pull Request: https://projects.blender.org/blender/blender/pulls/136566
Part of #134755 / #134766.
The asset browser currently lacks a compact view that leaves names
readable. Especially when managing asset libraries (e.g. to prepare it
for sharing or set up a production library), this is quite a usability
issue. A column view like the file browser has can solve this, allowing
a quick overview and fast browsing of libraries, while keeping names
readable.
Adds a new "Horizontal List" display mode to the asset browser that
distributes assets over multiple columns, with horizontal scrolling.
Asset previews are shown in this mode, plus an asset type icon if
there's enough space. The size of previews and the columns can be
configured next to the display mode, for optimizing the display.
Pull Request: https://projects.blender.org/blender/blender/pulls/135306
Rather than continuing to use ICON_TEMP, meant to represent temporary
locations, this PR adds a specific one - ICON_PREVIEW_LOADING - for
this purpose. Just a copy of ICON_TEMP for now, but with all parts at
40% opacity, matching how we use it now. Not only gives us an icon we
can later change, but also removes our special handling of reducing
opacity for one icon id.
Pull Request: https://projects.blender.org/blender/blender/pulls/135463
Noticed while working on #134814 that `BLF_width_to_rstrlen()` would
give one character too much to put into the available space, resulting
in a visual overflow or clipped text when BLF clipping is enabled.
I think the issue was hidden by the code from 9c09998530, which would
remove further characters until the string actually fits. I'm proposing
to disable that code for now, hoping that this properly fixes the issue.
`BLF_width_to_rstrlen()`/`blf_font_width_to_rstrlen()` are supposed to
find the largest part from the end of a string that fits into a given
width. It would iterate the string from the back until a character
doesn't fit into the width anymore. However, it would return the
index of that character, the one that doesn't fit anymore, instead of
the last character known to fit.
Pull Request: https://projects.blender.org/blender/blender/pulls/135239
Move the code dealing with converting float3 to GPU normals
out of the vertex format header into a separate header. Use a
proper C++ namespace and remove duplication by only using
the more recently added C++ templated conversions.
Most of the diff comes from the removal of the indirect includes
from GPU_vertex_format.hh. A lot of files ended up mistakenly
depending on that.
Pull Request: https://projects.blender.org/blender/blender/pulls/134873
When using the Error theme color for widget text color, this has to be
altered to provide sufficient contrast with other content. This was
done with label text color, before recent changes to make these colors
themeable, by blending with text color. This PR makes similar changes
and gives similar results.
Pull Request: https://projects.blender.org/blender/blender/pulls/134807
This changes the ui-blocks buttons storage from Listbase to Vector.
Major changes that might cause a performance considerations are
in `ui_but_update_from_old_block` that requires to track buttons when restoring
button state between block redraws or in `uiItemFullR` that may needs to insert
uiButs in the middle of the vector to add decorators. This might not be as fast as
removing or inserting elements in the middle of a listbase container. Also buttons currently
don't know its position in the container, so to get the previous and next
button its required to make a lookup of the button in the container.
`UI_block_update_from_old> ui_but_update_from_old_block` restores the state
of buttons between frames, this is done by sequentially testing if a button is the
same as an old button, however since UI can be created procedurally some old buttons
may not be drawn while editing other button data, this requires an extra track of what
buttons may not match to a new button while comparing for restoring state, but still
this buttons may be candidates to match to an new button.
Not functional changes expected.
Ref: #117604
Co-authored-by: Julian Eisel <julian@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/127128
The "Red Alert" color is currently hard-coded, which causes problems in
themes. It also has an Enum value of 0, which precludes using this
value as "unset". We also use Error, Warning, and Info colors that are
part of the Info Editor. This PR moves these out of the Info Editor
and into the "State" part of the theme. And then makes TH_REDALERT use
the TH_ERROR color.
Pull Request: https://projects.blender.org/blender/blender/pulls/131127
Draw a subtle background to make individual parts of each item feel more
connected. E.g. showing loading icons or labels might make it feel like
a bunch of floating icons/labels.
Suggested in #133880.
Pull Request: https://projects.blender.org/blender/blender/pulls/133980
Show a dimmed loading icon while previews are being loaded in a
background thread. The asset shelf and asset/file browsers do this
similarly already.
This is implemented in drawing code, so the loading icon will always
appear when an in-progress preview is being drawn. I experimented with
doing this in `ui_def_but_icon()`, but this won't update correctly with
popups that don't support full refreshing.
This also makes any normal icon that is drawn as preview use the normal
icon size. These icons are usually made for smaller sizes and look very
outblown when displayed at the size of a preview. Yet it's useful to
sometimes pass a normal icon. E.g. for the asset shelf we would already
draw the data-block type icon in place of the preview if there was no
preview to display, and we'd use the normal, smaller size already.
Larger can still be drawn differently.
I don't know of any current cases this would affect though.
Pull Request: https://projects.blender.org/blender/blender/pulls/133880
In the theme settings for the user interface, there was a option to
change the outline color of pulldown menus (E.g. the buttons at the top
of the 3D viewport) when the button was selected.
However this color wasn't used. This commit aims to fix that
by using the selected outline color for the outline of selected
pulldown buttons.
Pull Request: https://projects.blender.org/blender/blender/pulls/133470
The complaint shows the background of the box widget drawn over top of
its contents, the color picker. This is resolved by flushing the widget
cache so that other content draws after.
Pull Request: https://projects.blender.org/blender/blender/pulls/131525
The preview template (`UILayout.template_preview()`) to display previews
for materials, textures or similar would only work correctly in the
Properties editor. This had explicit logic to trigger rerendering on
changes. When displaying such previews elsewhere (e.g. in the 3D View
sidebar), the only way to have changes reflected would be by resizing
the preview.
This fix makes sure such previews are tagged as dirty and refreshed on
changes to the underlying ID. We do this the same way as tagging the ID
previews as dirty, through a function called by the dependency graph for
such updates.
Pull Request: https://projects.blender.org/blender/blender/pulls/129641
Generally increases padding of preview widgets a bit (while keeping the
preview size the same), and increases the size of the highlight surface
a bit. The default grease pencil brushes from the essentials asset
library use an opaque background, so the highlight was barely visible
before. It was difficult to identify the active brush from that. Now
it's a lot easier to identify visually.
See PR for comparison screenshots.
Pull Request: https://projects.blender.org/blender/blender/pulls/128432
The version text shown over the splash screen image needs to always be
white regardless of the theme. With "Blender Light" this text is black
and almost impossible to read. This PR adds the ability to set a
specific color for labels without icons and does so for the splash
screen.
Pull Request: https://projects.blender.org/blender/blender/pulls/126340
This PR removes the "Widget Label" text style, found in Preferences /
Themes / Text Style. This results in both labels and the text found in
input boxes sharing settings. This results in a slight loss of
customization but it isn't that useful to have these things separate
and results in code complication and errors.
Pull Request: https://projects.blender.org/blender/blender/pulls/122898
Properties category icons with new SVG icons are slightly brighter than
before, and therefore do not seem to brighten on hover. This PR makes
them match exactly. Was assigning an alpha instead of multiplying. And
an earlier refactor for outlines made these icons not show initially
dimmer unless there is also an outline.
Pull Request: https://projects.blender.org/blender/blender/pulls/125029
Icons can have contrasting outlines, but currently this can only happen
for some icons and when the theme setting "Icon Border" is greater than
zero. This change shows them in the same situations but also allows
them to be shown when needed. For special situations like having an
icon overlay on an icon, or for the icons in the corners of File
Browser preview items, etc. In a nutshell this allows UI_icon_draw_ex
to honor its outline argument, rather than ignoring it unless the theme
setting was also set.
Pull Request: https://projects.blender.org/blender/blender/pulls/123863
Code was often referring to pie menus using the term "radial" which just
obfuscates that it relates to pie menus. Just call it what it is
directly.
Doesn't replace usages of the term for names that are not strictly tied
to pie menus. Also doesn't change instances of the term in the Python
API to keep compatibility, noted in #110461.
Pull Request: https://projects.blender.org/blender/blender/pulls/122825
This adds support for renaming some sockets in the node UI directly by Ctrl+Clicking
on them. This is sometimes more convenient than going to the sidebar. It affects the
Menu Switch and Bake node as well as the Simulation and Repeat zone.
Some related notes:
* The Group Input and Group Output node are not yet supported, because it currently
breaks the right-alignment on the Group Input node. I couldn't find a workaround for
this yet.
* Double-clicking on the socket name does not trigger renaming yet. This seems to
be a deeper issue in the interface code.
* The highlighting when hovering over sockets that can be renamed is very dim
making it hard to see. Alternatives like drawing a box around the label when hovering
it (like in list views) have been discussed but seem to be much more difficult to get to work.
Despite these limitations, it seems reasonable to add this already, as it shouldn't affect
anyone negatively. The nodes still look like before.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121945
Correct calculation of start of visual string and position of the
selection start when the text is scrolled (showing a subset of the
text) within an input box.
Pull Request: https://projects.blender.org/blender/blender/pulls/122110
Add a separate function that calculates text selection box positioning
given a string's selection start and end offsets. Moves this to a
better place and allows to have more complex boxes in future when we
might have multi-line and/or multi-directional text input.
Pull Request: https://projects.blender.org/blender/blender/pulls/121448
Move into own BLF function, code that returns a text cursor (caret)
position given a string offset. This code is currently just in
interface_widgets.cc but should be a separate BLF function.
Pull Request: https://projects.blender.org/blender/blender/pulls/120622