Commit Graph

765 Commits

Author SHA1 Message Date
758bb8c70d Clenaup: odd use of ternary operators 2019-04-16 12:09:34 +02:00
90638d850d Remove evaluated RNA pointer lookup in interface
Since there is a flush of evaluated values back to the original
for an active dependency graph we don't need this lookup anymore.

Not only it slows interface drawing down, but also is becoming
in a way of the upcoming fix.
2019-04-01 14:30:42 +02:00
67516b93d8 Fix T62515: crash when rendering finishes with mouse over progress bar.
Tooltip should be copied entirely, not just the the argument because then the
function and argument don't always match.
2019-03-26 12:04:14 +01:00
a3e9b61a2f RNA: add UILayout.prop_with_menu function
Matches prop_with_popover, supporting menu types,
useful if we want to control behavior of enum switching.
2019-03-25 20:34:47 +11:00
d8d06120e4 RNA: rename prop_popover_enum to prop_with_popover
A version for menu's is going to be added next and we already have
UILayout.prop_menu_enum.

This name indicates the popover is added behavior instead of a
different kind of widget.
2019-03-25 20:34:30 +11:00
e583642312 UI: add UILayout.prop_popover_enum function
Support for RNA enum buttons that activate popovers when clicked.

This means we get useful tooltips, shortcuts and Ctrl-Wheel cycling
over enum items.

It also avoids inconvenient & slow access of enum values currently done
via RNA type lookups on the type to get the name & icon to use for a
regular popover button.

Resolves T57738
2019-03-25 19:05:13 +11:00
e86e0aad55 Cleanup: use braces for interface code 2019-03-25 11:16:46 +11:00
da1350acdc Fix T60815: drag & drop crash when search menu is opened immediately after.
Patch by matc, some further refactoring by me.

Differential Revision: https://developer.blender.org/D4250
2019-03-20 19:50:21 +01:00
a1addc5c63 UI: support for popups starting with buttons activated
While this could already be done from C,
this is now exposed to Python
2019-03-20 23:10:34 +11:00
81a03e17f7 Merge branch 'blender2.7' 2019-03-14 19:00:10 +01:00
57b5852bc8 Fix T62120: number button editing outside of soft max range jumps. 2019-03-14 18:29:42 +01:00
107c94c338 UI: New option to display factors as percentages
The option can be changed in the Preferences
in `Interface -> Editors -> Factor Display Type`.

Reviewers: campbellbarton, brecht, billreynish

Differential Revision: https://developer.blender.org/D4462
2019-03-13 16:58:00 +01:00
1abd120e70 Cleanup: rename uiBlock.mx,my to bounds_offset
Use a name that related to block bounds calculation
(mx/my are typically used for mouse x,y).
2019-03-13 16:41:35 +11:00
ee01b660eb Fix use of uninitialized stack memory
The matrix multiply uses x,y values so both must be initialized.
2019-03-12 15:31:54 +11:00
d617466d87 Refactor building the draw string for floats and ints
Differential Revision: https://developer.blender.org/D4466
2019-03-07 12:02:27 +01:00
cb7e66737d Fix T62216: order of items flipped in some menus like object mode. 2019-03-05 14:51:48 +01:00
Dalai Felinto
92182495da Fix T62016: Outliner visibility icons drag behaviour broken
We are mixing bool and fancy 3-in-1 func-set buttons in the outliner.
So they would return different pushed state in
ui_drag_toggle_but_pushed_state().

We now have a callback function that allows the button to set its own
pushed_button_state callback function.

Note: This is a bit of overkill since we are planning to change the
3-in-1 outliner buttons. That said, it may be nice to have, since in the
future we can mix those buttons for other things.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4434
2019-03-01 15:39:04 -03:00
Dalai Felinto
6c0cbfcd53 Fix T61696: Filepath buttons not accepting empty values
The reported case was with the render output filename,
however the same was happening for file open.

Bug introduced on c20c203b82.
I can't find in the original commit any reasoning for the change
that introduced this bug.
2019-02-19 17:24:10 -03:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
43156d8304 Preferences: remove tweak/drag threshold distinction
Currently the preferences have both tweak and drag threshold,
this is confusing because most actions users would consider
dragging use the 'tweak' setting.

Now one drag threshold is used for both, with a maximum limit of half
the button unit-size in case of dragging UI elements.
2019-02-11 15:48:46 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
8c68ed6df1 Cleanup: remove redundant, invalid info from headers
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.
2019-02-02 02:40:00 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
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.
2019-02-02 01:36:28 +11:00
d4c851b976 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-16 00:26:16 +11:00
b8e8c0e325 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
66c3eb36d2 Cleanup: use typed unsigned ints 2019-01-04 11:09:18 +11:00
53d655a0b3 Cleanup: use typed unsigned ints 2019-01-04 11:06:44 +11:00
d9ac4653e7 Fix T59574: Prop_search fails to set objects from scene.
Another case where editstr from search button would be used, when we
actually have desired pointer itself already available in button.

Am growing tired of doing bandaids fixes on that search menu stuff,
whole thing would require some real re-coding imho, to get rid of that
tantacular dependency over string 'identifier' only (when we should also
have access to at the very least, the active index, and also probably
active data pointer itself...).
And/or clearly separate string identifier from 'UI' string shown to user.
2018-12-19 17:02:55 +01:00
1a21c0c239 UI: show panel type in Python tooltips
Handy when editing UI scripts.
2018-12-19 21:49:04 +11:00
a7b3d58066 Fix T58014, T58650: issues with hex color and Filmic view transform.
Hex color values are now always in sRGB space, as would be expected by
most other applications. Previously they were in display space and using
the view transform.
2018-12-13 19:25:47 +01:00
6601a89650 Fix T58549, T56741: HSV color picker issues with Filmic view transform.
In 2d655d3 the color picker was changed to use display space HSV values.
This works ok for a simple sRGB EOTF, but fails with view transforms like
Filmic where display space V 1.0 maps to RGB 16.292.

Instead we now use the color_picking role from the OCIO config when
converting from RGB to HSV in the color picker. This role is set to sRGB
in the default OCIO config.

This color space fits the following requirements:

* It is approximately perceptually linear, so that the HSV numbers and
  the HSV cube/circle have an intuitive distribution.
* It has the same gamut as the scene linear color space.
* Color picking values 0..1 map to scene linear values in the 0..1 range,
  so that picked albedo values are energy conserving.
2018-12-13 19:25:45 +01:00
49490e5cfb Merge branch 'master' into blender2.8 2018-12-12 13:02:09 +11:00
e757c4a3be Cleanup: use colon separator after parameter
Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.
2018-12-12 12:50:58 +11:00
d89faac7d2 Merge branch 'master' into blender2.8 2018-12-03 19:31:54 +11:00
6bb825e083 Fix T54580: Pointer buttons skip undo push 2018-12-03 18:43:33 +11:00
925380050d Keymap: fix error in recent enum-menu support 2018-12-02 15:09:15 +11:00
6dbc820633 Fix crash creating enum tooltips
Error from recent changes to shortcut display.
2018-11-30 08:03:30 +11:00
9f2bc87e57 UI: update shortcut display to check space cycling 2018-11-29 18:45:37 +11:00
8055871e5b UI: support enum key shortcut detection
Shows shortcuts in space-selector.
2018-11-29 17:32:35 +11:00
a7f9b57983 UI: activate tabs immediately on press, and drag to quickly cycle through. 2018-11-22 21:10:12 +01:00
3a13b89296 Cleanup: unused args, indentation 2018-11-21 06:29:19 +11:00
Julian Eisel
a287194bce Fix Properties tabs all showing tooltip of active tab 2018-10-30 23:21:34 +01:00
Julian Eisel
ce148716c8 UI: Support Displaying Enums as Tabs
Adds `uiLayout.prop_tabs_enum(data, property, icon_only)` to BPY.
2018-10-29 21:20:58 +01:00
b5667c2ca7 UI: allow off/on icons to be in reverse order.
The same icons are reused for "hide" and "show" properties, which need
to be in reverse order compared to each other.
2018-10-29 19:04:07 +01:00
2b6253175e Cleanup: comments and unused code 2018-10-25 13:41:32 +00:00
f2e6f8bb8d Fix misaligned icon in search buttons after recent changes. 2018-10-12 15:55:36 +02:00
cc1d6b849d Fix T56898: misaligned icons in buttons in popovers. 2018-10-11 17:45:17 +02:00
2d21eb79ad Units: Support for fixed units
Users can select the main unit they want to use now.
Previously the displayed unit always depended on the magnitude of the value.
The old behavior can be restored by switching to the "Adaptive" mode for length, mass and time units.

Meters, kilograms and seconds are the default units for new and old scenes.

The selected unit is also the default unit for user input.
E.g. if cm is selected, whenever the user inputs a unitless number into a field of type length, it will be interpreted as cm.

Reviewer: brecht

Differential: https://developer.blender.org/D3740
2018-10-03 10:20:16 +02:00
58adc58661 Merge branch 'master' into blender2.8 2018-09-27 15:49:59 +02:00