Commit Graph

677 Commits

Author SHA1 Message Date
fb25a86f43 Fix T39537: Multi button editing is unreliable 2014-04-01 22:10:41 +11:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
c450ea2ab0 Fix T39203: Boid particle naming UI semi-freeze
uiList was not handling correctly UI_BUT_DISABLED TEX name buttons!
2014-03-18 15:24:34 +01:00
4d44f70d5f Follow up to previous commit:
Make HSL wheel useful in compositing.

In HSL, 0.5 lightness corresponds to most vibrant colors so make that
default for locked wheels (previous value of 1.0 just made it white).
Also, unlock the wheel for both very bright and very dark colors.
2014-03-18 01:33:28 +02:00
06de5be90e Fix T39228 Gamma/lift/gain are burned out in the circular color pickers
and value/lightness slider stops midway.

Issue here is manyfold:

Color wheel does not support properties with different soft min/max
values than 1.0 (which after experimenting a little I left as is), and
also color management is completely destroying the mapping between the
value slider and the RNA property value range. To solve this I have
disabled color management by setting the property to gamma corrected
(only in RNA, Sequence editor coders please check!), otherwise it will
just become a big mess of tracking where color comes from and what kind
of color transforms it needs in different color pickers (if property has
non normalized range etc). HSL is not really meant to represent colors
outside a normalized space so I have disabled setting lightness above
1.0 in this model.

This will work, however it is hacking a color picker to do something
other than what it is supposed to do: pick a color from the screen
accurately. Which means normalized values always. The non normalized
colors picked for lift/gain/gamma through the pickers do not correspond
to any accurate colors; they are rather a user friendly way to 'sort of'
choose a color and a gamma with an indication of maximum value.

I think that lift/gamma/gain nodes need a dedicated widget for this
(besides it is quite clear that some options are written for that use
case) -or- a separate gamma multiplier for the picked color (which
should itself be in a normalized space)
2014-03-18 01:08:36 +02:00
8f1a6e26b6 Fix Circle picker not liking linear color properties much. Again, visual
result for picked color was different from what was displayed on color
wheel under the cursor.
2014-03-14 02:30:27 +02:00
4fa93b1ea4 Code cleanup (tm): Some code deduplication for HSL 2014-03-12 19:12:58 +02:00
bce924b43c HSL color wheel implementation.
This is a standard Hue - Saturation - Lightness model
(see for instance entry on wikipedia here: https://en.wikipedia.org/wiki/HSL_and_HSV)
Note though the difference between HSV and HSL saturation, which are not the same.

The advantage of having this color selection scheme is that artists can select
shades and tints of a color easily by using the lightness slider. Also colors
are arranged on (approximated) perceived lightness on the color wheel.

Beware, Old files opened with this preference saved will crash!

Reviewers: sergey, brecht, campbellbarton

Differential Revision: https://developer.blender.org/D385
2014-03-12 18:58:50 +02:00
330272be9a Fix T39060: "Choose by numbers" do not work with Enum-menus, but work with operators-menus
The "layer" exception in handling numbers for menus was a bit too much greedy, eating numbers for all RNA props instead of just for layers ones...
2014-03-11 21:07:57 +01:00
571f184d35 Fix T39000: Align Objects Axis button is not redraw.
We have to apply button *before* checking others in the ROW, else changes are not propagated to them yet.
2014-03-06 22:03:11 +01:00
13ea967cce Code cleanup: correct abs use and quiet warnings 2014-03-01 14:26:18 +11:00
45fc0514fb Fix for crash copying from non RNA color buttons 2014-02-28 23:45:31 +11:00
6a43c2ac1a Fix text select offset /w zoomed UI & popups (colorpicker) 2014-02-25 14:18:04 +11:00
b6c439d0c4 UI: remove number specific button offset when selecting text 2014-02-25 12:42:17 +11:00
97c66c9bf1 Fix T38812: color picker incorrectly cancelling operation when clicking next to it. 2014-02-24 19:53:15 +01:00
739ae1d809 NDOF: fix for view3d ignoring lens values when panning
image, mce, view2d and view3d now have matching pan speed.
2014-02-22 16:30:48 +11:00
a00ebaecce UI: Increase cursor distance to leave keyboard navigation
This mitigates T38505, where moving the mouse while using the wheel/keys
can exit the submenu.
So at least smaller unintentional movements won't be misinterpreted.
2014-02-21 15:57:09 +11:00
c9233bfd82 Code cleanup: style 2014-02-19 08:02:59 +11:00
a66236c8f9 Fix T38661: make number button increment/decrement areas smaller.
Previously 1/3 of the button was used to decrement, 1/3 to edit and 1/3 to
increment. However with the number text now right aligned this meant that
the increment area would overlap the number text, which is confusing. So it
was made to smaller to only cover the arrows.

It's not as easy to click but I don't know of a better solution with right
aligned number text.
2014-02-18 19:54:42 +01:00
dcdb4eaf9c NDOF: Fix for fly/walk mode ignoring axis invert options 2014-02-18 23:55:58 +11:00
f468904e9b NDOF: use like a joystick for cube picker (as with circle picker) 2014-02-18 11:57:48 +11:00
2413b444d0 Fix T38640: password values showed in tooltips
also disable copying password text.
2014-02-15 12:06:46 +11:00
80e21f6fc5 Code clearnup: warnings 2014-02-14 22:03:09 +11:00
4c21e2b382 UI: split ui_popup_menu_memory into get/set functions and store as uint 2014-02-13 09:37:28 +11:00
d4c87f2f79 Code cleanup: remove unused button aspect 2014-02-13 09:37:27 +11:00
bc41d255cb NDOF: minor color picker improvements
- swap Z/Y axis so Z changes hue and X/Y change location.
  this way you can use ndof like a joystick and Z rotation like a dial
  for the hue.

- change sensitivity when shift is held to be 1/5th
2014-02-12 21:05:24 +11:00
e2089e1406 NDOF: fix for negative colors and flickering hue when picking with HSVCUBE 2014-02-12 21:05:24 +11:00
c046cb80ed UI: allow clicking to close menus and popups (but not submenus). 2014-02-11 04:23:44 +11:00
35f62bdced UI: refactor menus to remove menus encoded in strings
On every redraw a single unopened dropdown boxe would translate
and convert every EnumPropertyItem into a string,
then decode every item, and search those items to find the name of the button to draw.

Replace this with a custom menu callback for RNA enums,
tooltips for enums now show too.
2014-02-10 13:04:43 +11:00
385c892418 UI: use proportional option while dragging buttons 2014-02-09 08:42:45 +11:00
127330d6ca UI: multi-drag number button editing
clicking and dragging down edits multiple number buttons at once. (patch D270)
2014-02-08 09:42:26 +11:00
ff0ceb9926 UI: split ui_button_execute_do into begin/end 2014-02-08 09:42:26 +11:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
fc9626b1df Change confusing check discovered while working on HCL color wheel:
COLOR widgets never get created with UI_GRAD_V_ALT values. This is
intended for HSVCUBE color sliders only so reverting this to old value
before it was substituted with a define, which was -1.

There's one case where COLOR buttons get defined with a1 value different
than -1 which is in ui_def_but_rna. There the step value of the RNA
property is used. However, that meant that if step equaled to 9, which
is UI_GRAD_V_ALT value (unlikely) or if UI_GRAD_V_ALT was changed to 10
in future, or we added check for e.g. UI_GRAD_L_ALT which is 10 in HCL
branch, color widget would not get a color selection menu spawned.
2014-02-05 10:45:14 +02:00
a1a0ebbf49 Code cleanup: use length squared where possible 2014-02-02 02:24:48 +11:00
9612433884 UI: minor optimization for button lookup, break early when button found
also reduce int/float conversion
2014-01-29 23:05:32 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
8b6b42b694 UI: tweak menu padding and make separator line more visible.
Adds some padding to the left of the icon, adds more space around the separator
line and make it more visible, and add some spacing at the top and bottom of
the menu. Ref T37794

Reviewed By: dingto, billrey

Differential Revision: https://developer.blender.org/D223
2014-01-17 17:06:11 +01:00
b8b412230b Code Cleanup: use iroundf
also increase precision of rctf print functions
2014-01-15 13:40:40 +11:00
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
2dba2e72b7 Code Cleanup: de-duplicate text pasting which only used the first line 2014-01-08 17:39:12 +11:00
ca78e402eb UI: Use shift+lmb for toggling panel pinning (not to conflict with MMB emulation) 2014-01-06 03:00:54 +11:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
aab587817c Fix T37795: Resetting a button to the default value could crash
Added ui_handle_afterfunc_add_operator so a button can queue an operator
to run without executing it immediately.
2013-12-20 01:07:09 +11:00
6a2d5eb1ef UI: avoid using AT define for malloc id's
They're very verbose and while useful for debugging leaks - a unique
string is normally enough to track down the problem.
2013-12-19 04:08:16 +11:00
6f4515b614 Fix for button selection offset
Was using a different font size with selection and drawing,
But scaling both so they mostly matched.

This made selection shift noticeably when done on an interface zoomed in/out.
2013-12-18 19:33:05 +11:00
0e694b9b7e Code Clenaup: use const for button checking functions 2013-12-18 19:33:05 +11:00
a621d1e488 UI: Tabs categories for panels (D75)
- works by defining panel categories, currently restricted to the toolbar.
- no panels define bl_categories yet, so no user visible changes since tabs only show when there are multiple.
- panel pinning is available in rmb menu or alt+lmb.
2013-12-17 03:55:45 +11:00
a1031d5dd5 Fix T37739: uiList drag-resize was not working as expected outside of panels.
Patch by Brecht, with minor edits by myself, thanks a lot!

Tech details: previous drag-resize handling code was based on the assumption that coords
returned by ui_window_to_block() was relative to the bottom on the uiBlock.
This is in fact completly eroneous, usually this func does not translate at all the coords,
it merely rescale them - except for blocks inside panels, where returned values are relative
to the left/bottom corner of the panel... Pretty confusing, solution for now is to store ref mouse
position in window space, and convert them to block each time, just like current mouse pos.
2013-12-10 16:23:16 +01:00