Commit Graph

700 Commits

Author SHA1 Message Date
716430ab64 Code cleanup: comments 2014-06-15 12:15:53 +10:00
ea2043eb3a UI: Add support for popups to refresh their layput (D578)
This is needed for popups to chance state once activated,
currently it makes use of operators `check` callback, after values are modified,
as the file selector does already.
2014-06-15 01:42:31 +10:00
34ae5bd378 UI: uiContextActivePropertyHandle wasn't passing the event to the uiBlockHandleFunc 2014-06-14 18:14:53 +10:00
c04c6a3b83 Fix T40538: Multi-button canceling edit-text could leave edited value 2014-06-09 15:35:34 +10:00
d3a94941ef Fix T40325: Part II
Use same cursors for GRIP buttons as for window resize e.g.
2014-05-23 13:06:36 +02:00
9892f038ef Fix T40154: UI Multi-drag sets value beyond max 2014-05-15 13:22:13 +10:00
0111f3505f UI: more changes for large textfields
- no longer set 'but->drawstr' when editing buttons.
- clip text and set cursor based on the 'editstr'.
2014-05-03 09:18:00 +10:00
43d5e54a79 Fix for paste clamping the string length to UI_MAX_DRAW_STR 2014-05-03 06:06:19 +10:00
867efab404 Correct own stupid mistake dragging popups (x/y swap) 2014-05-02 10:09:26 +10:00
f61e885706 UIL: Dragging popups wasn't updating safe-areas 2014-05-02 09:25:04 +10:00
4849ca8a56 Fix T39884: Displaying filenames with '|' failing in menus 2014-05-01 12:40:49 +10:00
6ac300ae72 Fix part of T39692: Text fields in datablocks editor are broken
Text field part. Issue with enums dropdowns remains a mystery currently.

As for pointer fields, afaict they have never worked here, though it should
not crash.

UI_EMBOSS are values, not bitflags (own fault, most likely)...

Note we should probably get rid of UI_EMBOSST, it is used nowhere in UI code (set
in one place only, used nowhere).
2014-04-27 21:42:50 +02:00
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
1a1bc281e6 Code cleanup: style 2014-04-21 01:01:33 +10:00
1b9db9911d Code cleanup: use bools
also rename BLI_omp_thread_count -> BLI_system_thread_count_omp
2014-04-17 16:04:28 +10:00
708b8d8716 Color pickers:
* Code Cleanup
* Fix some more color correction cases that were left unattended. (NDOF,
resetting the operation in circle pickers)
2014-04-07 19:35:29 +03:00
602629502c Clicking outside menus wasn't closing when opened from non menu popups 2014-04-04 07:33:42 +11:00
c019ae5ea3 I18N: add missing lines
Reviewed By: mont29

Differential Revision: https://developer.blender.org/D328
2014-04-03 22:49:27 +04:00
51abc2becd Fix for T39537 wasn't complete, buttons in popups remained unset. 2014-04-03 20:49:40 +11:00
f38331adef Code cleanup: style 2014-04-03 09:24:09 +11:00
9b3bd5582b Replace resize code of image scopes by use of new GRIP button.
This deduplicates/simplifies some code. Also cleanup up a bit scopes UI code!

Use new GRIP button for uiList grab-resize.

This allows us to greatly simplifies the code, and get rid of a few hacks in uiList event handling!

Note autosize mode of uiList is now trigered by any value of list_grip below a given threshold, rather than the fixed zero value...

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D343
2014-04-02 13:09:43 +02:00
4faef1e10c Add drag-resize to uiTemplatePreview (mat/tex/etc. preview widget).
This is done by adding a new button type, GRIP, similar to other numbuttons
(scroll, slider, ...), which here controls the preview height.

Then, we add a new DNA struct to be able to save that height in Blend files
(note I choose not to use Panel struct for this, because we would then have the
same limitation we used to have with uiLists, only one preview per panel
and no preview outside panel).

This implies a change to template_preview UI RNA/py API (each preview needs an ID),
but this is backward compatible, as by default datablock type will be used if no ID is
given (which means e.g. all material previews with no ID will have same height).

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D342
2014-04-02 13:03:11 +02:00
def5999f9b UI: support for dragging popups title area 2014-04-02 18:43:53 +11:00
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