Commit Graph

870 Commits

Author SHA1 Message Date
eca7c96a28 Maybe slightly controversial pie commit:
Make pie menu item placement touch the radius from the internal side of
the buttons rather than placing on the center on the cirtcle. This
allows us to get rid of the separate visual angle property, also allows
for tighter placement of pies with a smaller radius without easily
overlapping.

Also pie menu title now always appears above the threshold indicator.
2014-08-13 15:11:19 +02:00
8d801c3afd Correct menu items active behavior applying to dialogs 2014-08-13 18:21:23 +10:00
dfd9bfd3a8 Spelling 2014-08-13 08:38:16 +10:00
028fd29eeb Pie Menus C code backend.
This commit merges the code in the pie-menu branch.

As per decisions taken the last few days, there are no pie menus
included and there will be an official add-on including overrides of
some keys with pie menus. However, people will now be able to use the
new code in python.

Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/

Thanks:
Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review
and design comments

Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for
suggestions during the development.

Special Thanks to Sean Olson, for his support, suggestions, testing and
merciless bugging so that I would finish the pie menu code. Without him
we wouldn't be here. Also to the rest of the developers of the original
python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who
did the research and first implementation and whose code I used to get
started.
2014-08-11 11:02:26 +02:00
64c7b2a122 UI: show ttips even if disabled, when holding alt key.
Patch by @sambler (Shane Ambler), with minor edits by myself (see also D727, T24055).
Reviewed feature-side by @carter2422 (Jonathan Williamson).
2014-08-09 22:04:55 +02:00
9ece95de48 Fix for out of bounds write while dragging 2014-08-06 12:13:11 +10:00
371fb516cc UI: remove tip when dragging a popup 2014-08-06 00:41:20 +10:00
4c3b25ec9e Correct another issue in recent menu handling
mouse clicks to exit a menu were ignored for non-floating popups
2014-08-06 00:06:38 +10:00
784c99f53c Correct glitch in recent menu commit, click-drag locked menus 2014-08-04 06:03:56 +10:00
47e7ce696c Fix for glitch with menus not reliably setting an active item (D674)
When menus are clamped to the window bounds,
its was possible not to have an active menu-item under the mouse,
Making Ctrl+S,Enter not completely reliable.

Changes needed to support this are:

- menu item is activated on popup menus
  (to avoid relying on mouse-over)
- moving mouse away from menu items only de-activates when over a new menu-item.
- Mouse clicks are ignored if they are not directly over the menu item.
2014-08-03 20:35:28 +10:00
36b6b69173 Fixes:
* Crash with image drag'n'drop
* Drag'n drop color to paint 2d canvas not working
* Change "Layers" to "Slots" to appease purists.
2014-07-24 15:18:49 +02:00
1cbe85b156 UI: prevent dragging a popup from activating a button 2014-07-24 16:53:10 +10:00
cf521f198a Correct last commit 2014-07-24 16:27:56 +10:00
dca61a6b20 Cleanup: ui_but_is_editable flip return value 2014-07-24 16:19:31 +10:00
256706ce7e Cleanup 2014-07-21 20:23:17 +10:00
f745564e4e GSOC 2013 paint
Yep, at last it's here!

There are a few minor issues remaining but development can go on in
master after discussion at blender institute.

For full list of features see:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting

Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
2014-07-21 12:02:05 +02:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
d419e2e90c WM: add WM_operator_properties_create_ptr
Call operator types directly and avoid a lookup when their known.
2014-07-11 15:07:55 +10:00
42959f05a4 Fix T40759: "Add Shortcut" operator was leaving new keymap items on
cancel.
2014-06-25 17:42:01 +02:00
8660a0cab3 UI: auto-open other menus by hovering over, once a menu is already open
D590 by Matthew Reid
2014-06-20 17:34:21 +10:00
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