Commit Graph

432 Commits

Author SHA1 Message Date
a3643ee3d6 fix [#36073] Changing list items misses undo push 2013-07-09 23:40:53 +00:00
750b30c7dd fix [#36008] Can't set values higher than 1.0 in HSV colour picker (But can in RGB) - also some strange behavior 2013-07-09 04:00:56 +00:00
bf6a74e3fc Bugfix [35841] WM_OT_context_[toggle/cycle/etc.] operators dont show shortcut
keys in menus (or tooltips) for properties they are used to toggle/cycle through

Some properties can be toggled using hotkeys via WM_OT_context_* operators, but
these hotkeys aren't really shown anywhere obvious like other hotkeys (i.e.
they're not shown in tooltips or menus). Although it is possible to look these
up in the userprefs/keymaps editor, it is quite tricky doing so, and most users
would just assume that since no shortcut is displayed, there simply isn't one at
all.

This commit introduces a slightly hacky fix which basically amounts to checking
if a property can be set by any of the few operators which are used for this
purpose. In order to keep this from being too sluggish, I've currently limited
this to only working on Editor (e.g. "Show Seconds" in Anim Editors) and
ToolSettings (e.g. "Use Proportional Edit") properties.

There are still some corner cases that would be nice to solve too (i.e. the
Pivot Type enum menu/dropdown should really be able to show the hotkeys which
have been assigned for each of those items, since they're by-and-large quite
hidden and obscure), though being able to show some of these is perhaps better
than not showing any!
2013-07-07 12:53:15 +00:00
a8d5a22f7f ui precision drawing - avoid calling pow(10, -prec) since the range is small use a fixed array. 2013-06-19 14:08:27 +00:00
5e9e906bd3 Take precision into account for calculating display of small numbers 2013-06-19 12:16:50 +00:00
9d4cc7885d fix for filesel autocomplete, it had the annoying behavior if you entered in a non-existing name, of executing it and then asking to add the dir. 2013-06-19 11:53:48 +00:00
c9341334b1 add BLI_strcpy_rlen, replace strcat, which was used in misleading way. 2013-06-16 08:29:02 +00:00
815a87a652 fix [#35346] Python: still UI issue with popup and dropdown list 2013-06-13 09:12:53 +00:00
860fce4eb9 Code cleanup: removed some unused UI button types
* CHARTAB: not needed anymore with improved copy/paste support and text input.
* IDPOIN: replaced by SEARCH_MENU.
* ICONROW/ICONTEXTROW: replaced by RNA enums.
* NUMABS: can use min/max limits instead.
* BUT_TOGDUAL, TOG3, TOGR, SLI: not used in 2.5 interface.
2013-06-09 18:05:50 +00:00
7068a5eba7 tweak to recent commit, don't show keymap in menu tooltips. 2013-06-02 15:58:43 +00:00
876cc99aff display menu items key shortcuts in the button tooltips. 2013-06-01 05:53:44 +00:00
127c39b8a4 Fix for [#35224] Transform Orientation - order inconsistency
Fix turned out to remove as much "manual UI" from 3D view header as possible. Mode selector and all transform manipulators/orientations stuff are now RNA-based UI (leaving basically only edit mesh select modes with custom handlers, as they have some quite specific features).

To achieve this, four main modifications were done:
* enum-operator-generated menus are now MENU (i.e. dropdown lists) in headers too.
* All bit-flag enums expanded in ROW buttons now have a handling consistent with e.g. layers, or what we already have for transform manipulators, i.e. clicking select only one element, shift-click to select multiple ones.
* Consequently, the three RNA booleans manipulators flags are merged into a single bit-flag enum (yes, this is also an API change, though I doubt many scripts use it).
* Now the width of enum-based dropdown lists is computed from longest item name in enum, no more from a dummy place holder string (when no label/name is given).

All this allows to remove some code from 3DView/transform areas, that was actually mostly duplicating RNA/operator one.

Also done a few optimizations here and there (among others, do not pass &numitems to RNA_property_enum_items() when you do not need it, saves at least an iteration over enum items to count them).

Many thanks to Brecht for the reviews!
2013-05-12 13:16:11 +00:00
00014949c8 Fix #35262: assiging shortcuts from e.g. delete or selection mode menus did not
work anymore. This was due to a bugfix to show missing shortcut keys for e.g. the
mesh > vertices > separate menu. Both should work now.
2013-05-10 23:41:41 +00:00
a4634bfe67 code cleanup: ui_but_is_rna_undo --> ui_is_but_rna_undo (ui_is_but_*** is used elsewhere) 2013-05-08 13:00:33 +00:00
e5a968276e fix [#35055] Crash in Edit Source feature for multilevel menus
dont show the option when operating on a menu since its not supported.
2013-04-23 15:22:22 +00:00
e430ee20d5 More fix (cleanup) to r56063: remove call to RNA_create_pointer, it has already been called by uiButGetOperatorPtrRNA() if needed.
(I thought it would also copy idproperties, but as it does not...).
2013-04-19 13:03:30 +00:00
c4dbd8bc49 fix for crash in r56063, was just missing an ID property copy (which menu does) 2013-04-19 12:14:15 +00:00
03d6319862 Fix: when using a search menu with an operator's enum prop, the operator was previously always executed with default options (appart from the search-set enum, of course). Now we store the op's properties in search button, so that you can specify non-default options (as it was already possible with e.g. pop-up menu from an operator's enum prop).
To achieve this, some code (callbacks and search button creation) was moved from wm_operators.c to interface/interface.c, and a new UI function was added, uiDefSearchButO_ptr.

Note: This new code uses the fact that uiButHandleFunc callbacks get executed before operator when one of its arg is the button itself!

Many thanks to Campbell who helped me a lot with this patch!

Cleanup: also removed two unused pointers from uiBut struct.
2013-04-15 15:01:12 +00:00
649b92e688 Fix: uiBlockSetNFunc was using uiButHandleFunc as param signature, instead of uiButHandleNFunc one (was working because both are the same currently). 2013-04-13 16:28:39 +00:00
2b2099cd51 Fix #34875: 0 digits of precision was not supported for FloatProperty, now
you can specify precision=0 for this, and use -1 for the default 2.
2013-04-08 18:55:08 +00:00
634dfcdecc fix for fix: re-activating buttons to fix [#33466], meant the icon didn't get refreshed immediately. 2013-04-08 00:32:32 +00:00
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
677172fd65 code cleanup: use bools in interface handlers, dont show translation menu when right clicking on splash, use less confusing args for copy/paste function. 2013-04-04 15:16:29 +00:00
7bbaf4853a code cleanup: use bools in UI and WM code, quiet some shadow warnings, remove unused function uiEmboss() 2013-04-04 02:05:11 +00:00
8f8613df90 fix for missing redraw in own commit r55554 (Ctrl+F text editor find).
since an event wasn't added to the queue no redraws we're done when the panel was already open, instead use a notifier.
2013-03-25 21:31:24 +00:00
5a87e4d255 code cleanup: remove unused button type HSVSLI 2013-03-23 16:03:13 +00:00
d39c6fdf2d Various cleanup around default i18n context.
Issue is that the real default context is NULL, however, in python and RNA, this value can't be used easily. So we use a specific string instead ("*"), defined as BLF_I18NCONTEXT_DEFAULT_BPYRNA.

From now on, all bpy/rna code should only use the BLF_I18NCONTEXT_DEFAULT_BPYRNA value, while all "usual" C code should use the BLF_I18NCONTEXT_DEFAULT value (BLF_pgettext is still able to "understand" both, anyway).

Also added BLF_is_default_context helper func, so that we can keep that check in a single place!

Finally, we should no need anymore to understand the void string "" as default context too - two values for a same thing are more than enough!
2013-03-19 19:37:22 +00:00
63d3594975 ui_def_but() allocating an extra byte in 'but->str' for no reason. 2013-03-14 11:29:15 +00:00
5162a155af Fix #34481: camera focal length and sensor size did not use units yet, now they do.
I've added a separate camera unit type. It's a bit strange to have an exception for
this but it ensures units are shown in familiar millimeters and it also ensures
backwards compatibility.
2013-03-13 17:16:49 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
c36f20a7d2 style cleanup 2013-03-08 04:00:06 +00:00
84aa1dd31c fix for bug where array buttons would use -1 index, causing an out-of-bounds check on an array.
added assert so this wont happen again.
2013-03-06 16:32:05 +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
3d63b2308a code cleanup: minor refactor of button pressed state checking, needed for drag toggle fix. 2013-03-01 00:19:32 +00:00
c9d1f6fc5b Fix for uiButGetStrInfo: We need a string value here, return BPY_I18NCONTEXT_DEFAULT_BPY when using default NULL label's context. 2013-02-24 08:46:01 +00:00
4df5b943ed patch [#34103] - listbase.patch, insertlinkbefore.patch
from Lawrence D'Oliveiro (ldo) 


notes from tracker:
use bool for return type from BLI_remlink_safe, necessitating including BLI_utildefines.h in BLI_listbase.h
get rid of duplicate BLI_insertlink, use BLI_insertlinkafter instead.

A few places which were using BLI_insertlinkafter (actually BLI_insertlink), when it would be simpler to use BLI_insertlinkbefore instead.
2013-02-22 14:12:55 +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
86793fec42 fix [#34198] Scene unit size and dyntopo detail size
there were 2 bugs here.
- int buttons scaling values on input but not on display.
- pixel distances were using PROP_DISTANCE subtype - which isn't correct.

added assert incase PROP_INT values have PROP_DISTANCE subtype applied in future.
2013-02-12 05:09:35 +00:00
533f359c0d code cleanup: some style edits, also allow mul_v2_m2v2() to have the same value as in-out, since this is a convention for existing matrix functions. 2013-02-12 00:35:31 +00:00
07a3ebbd38 fix for annoyance where header menus would get scroller arrows added because it would be clamped within the screen a few pixels.
This was caused from using theme shadow setting to clip the popups and a hard-coded value to translate the popup within screen bounds - these values should be the same.
2013-02-07 02:03:31 +00:00
88aa33d3f4 fix [#34104] vertex color: color select bug
changing the hue in a color picker on a panel when black/white was selected would fail because the hue from the previous state wasnt stored.
2013-02-04 12:32:24 +00:00
518bfbb1c9 style cleanup 2013-02-02 04:58:03 +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
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
26752e8b3a minor cleanup to ui_get_but_vectorf / ui_set_but_vectorf, change the vector with one function call if its size 3. 2012-12-21 00:11:45 +00:00
edf826d924 Various minor fixes to i18n code (mostly, translation of enum items' tooltips was wrongly bound to iface option, not tooltips one, and recent changes in r53119 were incorectly using BLF_pgettext, made them simpler by using CTX_IFACE_ macro).
Also fixed CTX_FOO_ macros when building without i18n, those were kinda wrong.

And hid i18n ui section in userpreferences when built without its support too.
2012-12-18 18:25:48 +00:00
63731453e2 make sure color picker and color swatch buttons have rnaindex of -1.
Some were 0 some -1, but this messed up reporting - making it think that only red was being changed for each button.
2012-12-18 17:00:49 +00:00
db14a81e04 some speedup by avoiding translation on entire enum arrays, and just translate the single name that ends up being used. 2012-12-18 13:46:37 +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
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