Age | Commit message (Collapse) | Author |
|
|
|
Don't use the side padding for menu item contents when displaying
previews or icons in a row or grid layout. This can cause problems for
the preview drawing and doesn't make sense to draw there anyway.
This not only fixes the mentioned issue, but also too small heighlight
for the collection color tag in the Outliner context menu.
Alternative to and similar to D13125.
|
|
|
|
This commit improves the scaling of some ui widgets when
zooming by making the radius of the rounded corners
dependent on the element's zoom level.
Needed to fix T92278 without padding issues, see D13125.
Reviewed By: Hans Goudey, Julian Eisel
Differential Revision: https://developer.blender.org/D12842
|
|
This patch removes a bunch of specific code for drawing the spreadsheet
data set region, which was an overly specific solution for a generic UI.
Nowadays, the UI tree view API used for asset browser catalogs is a much
better way to implement this behavior.
To make this possible, the tree view API is extended in a few ways.
Collapsibility can now be turned off, and whether an item should
be active is moved to a separate virtual function.
The only visual change is that the items are now drawn in a box,
just like the asset catalog.
Differential Revision: https://developer.blender.org/D13198
|
|
In the tools tab, the tool icon would be offset when it intersected
the bottom of the editor. With some screen resolutions, the icons on
the left side of the editor would also move when intersecting the
bottom of the editor. This happened because of the truncation in
the implicit conversion from float to int. Instead, use explicit
conversion functions.
Differential Revision: https://developer.blender.org/D11097
|
|
Simply removing the check for `UI_STATE_TEXT_INPUT` makes it inherit
the "List Item" User Interface theme settings. This patch changes the
default theme to match the colors of text input fields.
#### Master
{F11680556, size=full}
#### This patch
{F11680557, size=full}
All the included commmunity themes seem to work well (only Deep Grey might
need more contrast but that's a different patch).
Related reports: T92720
Reviewed By: #user_interface, Severin
Maniphest Tasks: T92720
Differential Revision: https://developer.blender.org/D13073
|
|
This patch makes `widget_nodesocket` base the size of the drawn
socket icon on the rectangle that’s passed in to allow it to scale
with the rest of the interface.
Differential Revision: https://developer.blender.org/D11734
|
|
|
|
While c7d94a7827a5be9343eea22a9638bb059f185206 exposed this bug,
this was caused by a discrepancy in padding where labels would
have additional padding when drawing without emboss.
The padding made widget drawing behave as if the text took up more
room causing it to be clipped.
Now labels are considered the same width with/without emboss.
|
|
|
|
This commit removes the constant padding around to the left and
right of the curve widget. The padding worked in screen space and
didn't take UI scale/zoom into account. This makes the curve widget
consistent with the more recently added curve profile widget used
for bevel profiles.
Differential Revision: https://developer.blender.org/D12883
|
|
Menu items ignore the roundness setting since they spread left to right.
This patch makes it so menu items use the theme preference instead of
hardcoded square corners. Providing more flexibility to themes.
All built-in and included themes already have this set so no need to update them. For the default themes (Dark/Light) roundness is 0.4.
{F10950727, size=full}
The motivations behind this change are:
* To be more consistent with other widgets.
* Improve themes flexibility.
* Match padding with other elements that have like the Search field:
{F10950746, size=full}
Reviewed By: #user_interface, Severin
Differential Revision: https://developer.blender.org/D12813
|
|
If the operator poll of a superimposed icon returned `false`, the
superimposed icon would just draw normally and fail silently. Instead it
will now be drawn grayed out, plus the tooltip of the icon can show the
usual "disabled hint" (a hint explaining why the button is disabled).
|
|
|
|
This follows three main targets:
* Make creation of new tree UIs easy.
* Groundwork to generalize tree UIs (so e.g. Outliner, animation
channels, asset catalogs and spreadsheet data-sets don't have to
re-implement basic tree UI code) or even other data-view UIs.
* Better separate data and UI state. E.g. with this, tree-item selection
or the open/collapsed state can be stored on the UI level, rather than
in data. (Asset Catalogs need this, storing UI state info in them is
not an option.)
In addition, the design should be well testable and could even be
exposed to Python.
Note that things will likely change in master still. E.g. the actually
resulting UI isn't very nice visually yet.
The design is documented here:
https://wiki.blender.org/wiki/Source/Interface/Views
Differential Revision: https://developer.blender.org/D12573
|
|
This allow users to show/hide:
* Library name / refresh.
* Assets names.
* Filter.
To set them in Python use:
display_options={'NO_NAMES', 'NO_FILTER', 'NO_LIBRARY'}
With contributions by Julian Eisel.
Differential Revision: https://developer.blender.org/D12476
|
|
Various changes to reduce risk of out of bounds errors in utf8 seeking.
- Remove BLI_str_prev_char_utf8
This function could potentially scan past the beginning of a string.
Use BLI_str_find_prev_char_utf8 instead which takes a limiting
string start argument.
- Swap arguments for BLI_str_find_prev_char_utf8 so the stepping
argument is first and the limiting argument is last.
This matches BLI_str_find_next_char_utf8.
- Change behavior of these functions to return it the start or end
pointers instead of NULL, which complicated use of these functions
to calculate offsets.
Callers that need to check if the limits were reached can compare
the return value with the start/end pointers.
- Return 'const char *' from these functions
so they don't remove const from the input arguments.
|
|
This patch removes the "Kerning Style" option for UI widget font
drawing and uses only the current default of "Fitted", since the other
option of "Unfitted" is just the result of truncation errors.
see D12231 for much more information.
Differential Revision: https://developer.blender.org/D12231
Reviewed by Campbell Barton
|
|
|
|
This button type shows a preview image above centered text, similar to
the File Browser files in Thumbnail Display Mode or the default Asset
Browser display. In fact we may want to port these over to use the new
button type at some point.
Will be used by the asset view UI template that will be added in a
following commit. That is basically a mini version of the Asset Browser
that can be displayed elsewhere in the UI.
|
|
This shows the text as part of the assertion message.
|
|
|
|
|
|
This patch horizontally centers the text inside the progress bar
widget. It is currently left-aligned and offset to the middle, which
doesn't center properly.
see D11205 for details and examples.
Differential Revision: https://developer.blender.org/D11205
Reviewed by Julian Eisel
|
|
IME conversion candidate window was displayed at the mouse position, instead of
below the cursor or text selection.
Blender need to tell the input method program where the conversion candidate
window is during Japanese and Chinese input.
In macOS, the `firstRectforCharacterRange` is called when input by the input
method starts, and the position of the conversion candidate window is
specified. Therefore, it is necessary to set the position of the conversion
candidate window before input starts. This patch changes it so that the position
of the conversion candidate window is always set when the cursor is drawn.
Differential Revision: https://developer.blender.org/D11697
|
|
When inserting text using IME on a button, the character after the cursor is
displayed before the cursor.
This bug seems to have occurred during the refactoring in D765.
Differential Revision: https://developer.blender.org/D11072
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
|
|
This patch adds a left aligned sidebar to the spreadsheet editor. This
Sidebar can be used to navigate the geometry component types and
attribute domains. It also provides a quick overview of domain sizes.
It replaces the two dropdowns in the regions header.
Next step will be to add the domain cycling shortcut
using the CTRL + mouse wheel.
Reviewer: Dalai Felinto (dfelinto), Julian Eisel (Severin),
Hans Goudey (HooglyBoogly).
Differential Revision: https://developer.blender.org/D11046
|
|
|
|
Removal of unused local variable. Calculation of underline thickness
no longer needed with change to text output of underscore character.
Introduced in aee04d496035
Differential Revision: https://developer.blender.org/D11641
|
|
When drawing mnemonic underlines for hotkeys, use text output of
underscore character instead of direct drawing a line. Otherwise these
are not visible in dialog buttons.
Introduced in 0fcc063fd99c
Differential Revision: https://developer.blender.org/D11641
Reviewed by Campbell Barton
|
|
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.
|
|
|
|
This patch improves the positioning of the little mnemonic underlines
shown under some hotkey letters in menus, especially when using custom
fonts.
see D11521 for details and examples.
Differential Revision: https://developer.blender.org/D11521
Reviewed by Campbell Barton
|
|
This patch introduces non linear sliders. That means, that the movement
of the mouse doesn't map linearly to the value of the slider.
The following changes have been made.
- Free logarithmic sliders with maximum range of (`0 <= x < inf`)
- Logarithmic sliders with correct value indication bar.
- Free cubic sliders with maximum range of (`-inf < x < inf`)
- Cubic sliders with correct value indication bar.
Cubic mapping has been added as well, because it's used for brush sizes
in other applications (Krita for e.g.).
To make a slider have a different scale type use following line in RNA:
`RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOGARITHMIC);`
or:
`RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);`
Test the precision, step size and soft-min if you change the scale type
of a property as it will feel very different and may need tweaking.
Ref D9074
|
|
This patch fixes the remaining issues described in T87749. The jitter
was caused by inconsistent rounding when using the floats icon_size
and icon_padding to offset the bound for the text drawing. Using
`round_fl_to_int` leads to consistent results and fixes the jitter
that remained in some buttons with icons, UI lists, and breadcrumbs.
Differential Revision: https://developer.blender.org/D11062
|
|
This patch fixes jittering text when resizing regions of the UI as
described in T87749. The jitter was caused by the text padding
being stored as an integer which lead to inconsistent rounding.
Most notably this patch fixes the jitter in the new spreadsheet editor,
but not all occurrences of jitter described in T87749 (e.g. in UI lists)
are addressed.
Differential Revision: https://developer.blender.org/D11060
|
|
The SB back-end optimizer for the mesa R600g driver corrupts the vertex
shader for widget drawing. This will not be fixed upstream because SB is
getting replaced as part of the new NIR path. This was thought to be an
issue with instancing and an attempted fix was submitted in D8374, but
it did not fix the issue.
This patch reimplements the array look-up part of the code using switch
case as a workaround and removes the old workaround implemented as part
of D8374.
Reviewed By: Clement Foucault
Differential Revision: https://developer.blender.org/D10967
|
|
|
|
|
|
Used for local structs/variables,
since `ofs` is by far the most widely used abbreviation.
|
|
|
|
Previously the padding size and the width saved for the icon were
constant regardless of the zoom level. This resulted in overlapping
icons and text, and ugly padding with more extreme zoom levels.
We can retrieve the size of the row from the `rect` argument.
|
|
Improved contrast for Status Bar report warning messages.
Differential Revision: https://developer.blender.org/D10242
Reviewed by Hans Goudey
|
|
|
|
Now the icon's rect are drawn wider than it should be, and with
overlapping, probably in order to compensate for the icon's offsets
inside the rect. The solution is to draw icon's rect of the correct
size and center the icon itself.
And make the hotspot exactly match the icon's rect. The last/right
button's hotspot also covers the extra padding on the right.
Differential Revision: https://developer.blender.org/D9936
Reviewed by: Julian Eisel
|