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
Hovering on inactive menu items combines the colors in a way that does
not work correctly with light themes. This PR changes nothing but how
colors are mixed for hover + inactive, doing so similarly to hovering
active.
Pull Request: https://projects.blender.org/blender/blender/pulls/120262
Now that all relevant code is C++, the indirection from the C struct
`GPUVertBuf` to the C++ `blender::gpu::VertBuf` class just adds
complexity and necessitates a wrapper API, making more cleanups like
use of RAII or other C++ types more difficult.
This commit replaces the C wrapper structs with direct use of the
vertex and index buffer base classes. In C++ we can choose which parts
of a class are private, so we don't risk exposing too many
implementation details here.
Pull Request: https://projects.blender.org/blender/blender/pulls/119825
The function ui_draw_popover_back has a "block" argument, that is
checked for null, but then has an "else" that would require it and
cause a null pointer dereference. This is an internal function that has
one caller, in response to a condition on that same block's flag.
Therefore this PR removes this function's check for null and the else
code as this condition is not possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/119092
The line separator needs to know vertical or horizontal orientation
at draw time, and is independent of button rect. This PR removes the
use of uiBut->a1 for this in favor of a derived struct.
Pull Request: https://projects.blender.org/blender/blender/pulls/118969
When using a square color picker you can drag it very wide in an RGB
node. Once over a threshold the round cursor in the color canvas will
turn into a vertical bar. Caused by (dumb) proportion test. Replaced
with a proper check for gradient type.
Pull Request: https://projects.blender.org/blender/blender/pulls/118542
Although it is nice to skip embossing for middle buttons in aligned
rows, this only applies to vertically-aligned buttons. Horizontal ones
need to keep their embossing, if enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/118304