Commit Graph

520 Commits

Author SHA1 Message Date
dfa8540cdf use bool for rna funcs. 2013-03-07 02:44:55 +00:00
24da4a6032 fix [#34490] Copy and paste floating point number fields losses precision
- copy now gets up to 6 decimal places
- copy and UI float button editing now strip zeros: 1.000 -> 1.0
2013-03-04 04:21:51 +00:00
a02c8c4177 move toggle drag into a UI handler (was modal operator) 2013-03-03 03:29:57 +00:00
2de8dfd784 fix for drag-toggle, bit-buttons weren't handled which made drag toggle fail for buttons in the graph editor for eg. 2013-03-01 00:35:01 +00:00
2398e074d3 fix [#33466] alt + mouse wheel
Alt+Mouse Wheel events depended on the button under the mouse being active, else it would change the current frame.
Button re-activation wasn't 100% reliable since it depends on fake mousemove events.

Now keep button active when its executed if the mouse stays over it.
2013-02-28 11:39:13 +00:00
d4d45711dc fix for error with drag toggle which showed up with overlapping regions. 2013-02-27 11:26:51 +00:00
fcac25e08d simplify drag toggle operator, use BLI_rctf_isect_segment between mouse events rather then many calls to ui_but_find_mouse_over(). 2013-02-26 00:09:26 +00:00
88be0a852e add define for drag toggle. 2013-02-25 23:27:32 +00:00
e2b41cb96f revert some changes from own commit r54850 which broke undo for toggle buttons, also make toggle buttons auto-key. 2013-02-25 21:13:40 +00:00
ac345fce9a fix for toggle buttons not taking effect on mousedown. 2013-02-25 11:52:18 +00:00
a9b9fcc951 style cleanup 2013-02-24 20:33:21 +00:00
ce54cc111d Fix #34357: image editor scope and clip editor track preview did not resize
properly with different DPI settings.
2013-02-22 16:11:27 +00:00
c12eeb4ec6 code cleanup: switch argument order for button_activate_exit() but/data args were flipped compared to other functions. 2013-02-22 06:02:52 +00:00
a9e25ac433 Toggle-Drag UI Feature
Dragging on toggle buttons can now be used to press multiple buttons at once, especially useful for layer and outliner buttons.


notes:
- automatically enabled for all toggle buttons
  (may change this if it becomes a problem).
- only buttons of the same type are pressed
  (helps avoid annoyances eg; dragging past layer buttons onto other 3d header buttons and pressing by accident).
- automatic axis locking - dragging will lock to X/Y depending on the initial drag direction,
  makes swipe motions work better, especially with the outliner.


implementation details:
- may re-implement as a region handler (currently its a modal operator).
- checking buttons in-between cursor motion events could be more efficient (but currently works ok).
- button execution needs to be improved
  (currently executing a button thats not under the mouse needed a workaround for passing uiHandleButtonData),
  requires further changes to UI code, will do next.
2013-02-22 05:56:20 +00:00
e3b2df5806 Fix #34315: memory leak cancelling move to layer operator, after change to make
it not execute immediately when opening the popup.
2013-02-19 13:37:48 +00:00
2d2164f10b fix [#34295] Color picker brightness to infinity
simply clamp the color to the buttons softrange since color conversion can cause the value to scale outside the intended button limits.
2013-02-19 09:41:48 +00:00
ab7ca2dc44 fix for double clicking in the text editor not working usefully (double clicking a pair chars would select 3 - one to the left). 2013-02-14 03:03:12 +00:00
1dfb6404b7 Release todo: added userpref for Mac users having "Natural Scroll" set.
As per discussion and analysis of all trackpad usage, we now
follow this convention:

- Blender follows system setting for trackpad direction preference.

- If you set your system to "natural" scroll, we need to invert a couple
  of cases in Blender we do "natural" already. Like:

   - view rotate (the inversed option just never feels ok)
   - scroll active items in list or pulldown menu (up/down is absolute)
   - ALT+scroll values in buttons (up/down is absolute)

The new User Preference setting "Trackpad Natural" handles this.

For 2.66 we only have trackpad handling for OS X... so this isn't
affecting trackpad usage in Windows and Linux, which stick to be mapped
to Scroll Wheel still.

(Note: viewrotate now is "natural" always, changing how it worked in the
past weeks).
2013-02-08 12:12:57 +00:00
296444e1dc style cleanup: some warnigs & spelling. 2013-02-06 14:02:19 +00:00
a47bef3622 fix for [#33803], error was caused by sloppy coding in r53487, converting trackpad to wheel events.
if you moved your mouse fast over a button the event would get converted to a wheel, even if the input event wasnt a MOUSEPAN event.

When Alt was held this was noticable because Alt+Wheel changes button values.

added an assert to avoid this happening again.
2013-02-01 01:11:27 +00:00
6341919354 code cleanup: make wmEvent's 'const' in interface code (reduces manual checking that they are not modified). 2013-02-01 01:01:20 +00:00
7b6e78e48a Fix #34034: keyframe display of color/curve buttons was broken after revision
53132 which changed the RNA index to -1 for these. Also made it so that these
buttons no longer display "Insert Single Keyframe" and only "Insert Keyframe"
as you can't edit individual components here so it's only confusing.
2013-01-31 16:19:44 +00:00
8f038c2410 enable continuous grab for sliders, initially this was disabled because we didnt support un-grabbing at the new slider location. 2013-01-29 23:33:58 +00:00
Dalai Felinto
27eeb89bd9 real fix for Logic Bricks UI smart controller (#33746)
previous commit (54102) actually reintroduces an old bug where Blender sigfaults when
the sensor and controllers are not from the active object.

The real fix for report #33746 is to clear the "object" property after the operator ran.
I'm not sure why when I call the operator from command line the property is cleared, but not
when I called it from C. Either way all should be working now.
2013-01-26 03:30:21 +00:00
Dalai Felinto
a8644deeef bugfix for 33746 Unable to add Controller to objects correctly
(live from the global game jam Vancouver ;)
2013-01-26 02:46:07 +00:00
833104e647 fix for own regression since 2.4x, non-linear number button range was too insensitive for int buttons. 2013-01-23 04:55:34 +00:00
8a0ad8f8b5 fix for text selection glitch, moving the mouse to the left would sometimes not entirely select the start of the text. 2013-01-17 19:12:11 +00:00
2b80a7d5da use define for text offset & seletion.
and no need to calloc memory for string selection.
2013-01-17 18:59:19 +00:00
0193c88083 Bug fix #33887
Ancient issue: on much zoomed in UIs, text selecting or cursor placement
in Text-input buttons was off.
2013-01-17 11:35:33 +00:00
350a776a52 fix for arrow keys being reversed in the snap menu (Ctrl+Shift+Tab)
also - when expanding rna enums into existing menus - don't nest inside a row/column.
2013-01-17 01:03:56 +00:00
9a4a5fa2b4 Usability fix:
Blender's data link button (typically with menu and searching options)
now has a X icon to clear its contents. 

Before you had to click, delete text, enter.

For example:
- Object Parent
- Modifier objects or vertexgroups

This fix saves each user 100 clicks per day, with 100k users
that's 3 billion clicks per year!
2013-01-09 15:58:34 +00:00
682df047a0 style cleanup 2013-01-08 02:06:16 +00:00
bbd95fafef Three fixes:
- Old issue: on scrolling button views, tooltips could open or stayed open.

- New fix: alt+swipe now changes button values again

- Removed test print, from WIP code project.
2013-01-06 18:28:39 +00:00
4fa340c716 Fixes - post 2.65a
- Trackpad swipes now behave same as scrollwheel for listview scrolls
  (disabling 2d view scroll when mouse over)

- Added back 2.4 debug print for glGetError()
  Only useful for developers - to check what goes on when ogl messes up.

- Made more clear print for read factory default. It's not error :)
2013-01-04 14:51:02 +00:00
be519ad7ff Further trackpad work:
When trackpad swipes don't convert to ScrollWheel steps anymore, several hardcoded
wheel events need to support swipe too.

This adds swipe support to:
- Menu item scroll
- Search item scroll
- ALT + number/slider/swatch values

The amount of old style scroll "clicks" is calculated based on how trackad is
being mapped to move a mouse pointer. Move it one widget unit = 1 click.

The swatch option applies trackpad swipe motion in analog way.
2013-01-01 16:42:35 +00:00
8c00c57187 style cleanup: var naming for ui list 2012-12-28 10:32:49 +00:00
7504cf34b4 This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
fa28e50ac2 Region scrollbar fix!
Now scrollbars correctly hide and show, making space for the actual contents
in a region. It solves several old hacks, and puts view2d code a bit more
back in control as well. 

Implementation notes:

- The view2d mask feature is working again
- The #define V2D_SCROLL_HORIZONTAL_HIDE means: "turn on hiding".
- Code for UI_view2d_region_reinit() is enforcing better standard view settings

But... two hack/patches needed to be added:

- Region panel drawing: if after generating the button panels it appears
  a scroller hides or reveils, it calls all the generating code again.
  (a simple scale doesn't work due to rounding differences in layout code)

- View2d code that maps 'tot' and 'cur' rects: if this code detects that
  the mask changes, it calcs the map code again.

Also a bugfix (issue in 2.65)

- The left/bottom area split widget was drawing 1 pixel too large sometimes, 
  leaving bad trails on moving area dividers.
2012-12-26 13:05:39 +00:00
97bdec1811 fix for use of uninitialized variable with ui_handler_region_menu. 2012-12-23 16:08:02 +00:00
c5de14ae1e Bugfix, irc collection:
Copy/Paste from and to color swatches now includes alpha.
Buttons without alpha have this value on '1' on copy.
2012-12-20 18:18:09 +00:00
5fcb12d754 changing RNA properties now prints python script in the info view.
next will add context so bpy.data.xxx[id] are not used for all references.
2012-12-18 15:22:06 +00:00
81d240c8c8 avoid using strlen() for comparisons in for loops. for expanding whitespace in the text editor and ui paste. 2012-12-15 07:57:16 +00:00
69ba2d3edb Crash, IRC report.
Moving panels in a buttons-region around was calling menu code, reading NULL pointer.
Seems to be an existing issue, not caused by my previous commit :)
2012-12-12 19:56:24 +00:00
12b642062c Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

Short list of main changes:

- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
  Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
  This allows keeping UI and data without actual saves, until you actually save.
  When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). 
  Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. 
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
  Old option is called "Save Startup File" the new one "Save User Settings".
  To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
  This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
868cb64d6c Bug fix [#33492] Right click on 'confirm reload' crashes
Context check could result in NULL - added provision for it and made
sure the check is local only (for 1 new option)
2012-12-12 12:18:29 +00:00
04c27843ea UI: revert the previous fix for middle click on button, conflicts with panning. 2012-12-02 05:27:03 +00:00
f7f4148b40 change uiButGetStrInfo() to use a trailing NULL arg rather then passing the number of args as an arg. 2012-12-02 04:51:15 +00:00
807fd448a5 UI: allow middlemouse in addition to leftmouse for clicking on various buttons,
means that if you have emulate 3 button mouse enabled and still have alt pressed
when clicking, it works.
2012-12-01 19:14:55 +00:00
079a0a30e4 Usability:
Made SHIFT+drag mouse in Curve and ColorPicker widgets move with more precision.
This was only working with UserPref "continuous grab".
2012-11-09 13:33:23 +00:00
360528d667 Bugfix #29072 (Color pickers don't close properly when moving the mouse away)
This rewinds the fix for revision 50483. 

- the removed code there (as comment said) closes menus on hoovering over another
  button in panels. Is unfinished feature to allow quick inspecting menus
  by mouse-hold going over menu popup buttons. 

- It added yet another check for closing menus - should be done with ->saferct

- The actual bug was simple; the block flag with UI_BLOCK_MOVEMOUSE_QUIT was
  accidentally cleared for colorpickers.
2012-11-08 16:50:31 +00:00