Commit Graph

304 Commits

Author SHA1 Message Date
02458c0d4b Bugfix #25840
UI bug: when a button has an open menu, the menu closed on any 
mouse-over of other buttons in this panel. That's not too bad,
but it didn't check for whether the mouse was already inside the
menu itself (respecting safety region).

The bug showed error on zoomed in UI, using FPS presets, in case
the menu-button was drawing aligned with other buttons. A real
boundary case... :)
2011-01-30 13:51:02 +00:00
0097997911 no functional changes.
- remove unneeded casts to (char*) in interface code.
- replace strcmp(.., "") with checks on the first char of the string.
2011-01-24 02:56:23 +00:00
f49d7d59dc Bugfix #25652
Report was that move-to-layer menu failed. The real cause was
more complex; had to dive deep in the dungeons of the interface
code that handled undos and operators. Found several issues:

- popup menus (like redo operator, color picker) executed again
  on a mouse-exit
- far too many buttons were sending undo pushes; even worse, in
  the operator redo-panel each button action was pushed twice
- in case operator redo-buttons have own callbacks (like layer
  buttons) the redo wasn't working
- layerbutton menu was called without creating a proper undo/redo
  case

Things should all work smoother now!

On todo:
- better definition and handling of all versions for operator menus
  (four types now, not fun)
  also: make operator "do" menu, which on first action does operator
  and then switches to redo-ing
- bring back Undo menu, to list the undo stack and jump in it.
2011-01-19 14:19:20 +00:00
63018144ba remove redundant assignments & unused vars.
also minor functional changes
- OBJECT_OT_make_links_data() type property is now assigned to the operator property (so popup menu can find it)
- removing BG image now returns cancelled if no image is removed.
2011-01-12 03:41:12 +00:00
1b9c56c423 bugfix [#25577] Ctrl-Z after adding Color Ramp key resets ramp.
buttons would not add an undo event if the button had no tooltip/draw-string.

 add a fallback string 'Unknown Action' so undo's are predictable.
2011-01-11 03:22:37 +00:00
70a828d5a5 remove unused vars, comment some which look like they could be useful still. have makesrna.c omit unused _data definitions for rna funcs with no args. 2011-01-09 01:17:56 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
be5f30416b Todo item
Drag/drop now has a User preset for dragging threshold.
Noticed this was set to 3 pixels even, made it 5 as default.
Tablet owners can put it larger too :)

Note: the tweak-threshold (3d win) is 10 pixels now, I think
this needs another preset too, leave this for now.

Also: fixed crash in filewindow: drag .blend icon and drop it.
You can't test anything in Blender or you get a bug :)
2011-01-03 17:00:49 +00:00
72e8a0c552 check modifier keys are not pressed when using keys as accelerators, it meant you couldn't copy the operator from a menu with Ctrl+C because C would be used to activate an item. 2011-01-03 13:13:54 +00:00
a7ceeafd71 - correct typos in comments.
- move boxpack struct out of the public header.
2011-01-02 11:06:50 +00:00
2ff790d0bd Removing the not-working test "Submit description" from RMB
menu on buttons.
2010-12-27 11:05:01 +00:00
86b89af5dd use ICON_NULL define rather then 0, makes UI calls less confusing. (no functional change)
eg: uiItemR(row, &dvar_ptr, "type", 0, "", 0); -> uiItemR(row, &dvar_ptr, "type", 0, "", ICON_NULL);
2010-12-23 02:43:40 +00:00
6cdc631d98 Todo item: (Luca report in IRC)
Pulldown and other popup menus: this button type exits on release.
While holding mouse you then can move around, but the highlight of button
didn't disappear if you were outside item. The menu then doesn't close
when you release the mouse.
Now highlight goes on/off on mouse moves to show this better.

Implementation note: menu items are coded similar to regular activate
buttons (like for tools). There's no provision to make highlights go
to the next item while holding mouse in menus. That I rather not mess
with now.
2010-12-19 14:39:36 +00:00
97b0e17577 Bugfix #25243
Pressing Enter twice on enum-menus or pulldowns sent an 'OK execute'
with illegal values (no menu item active). Caused crashes too.
2010-12-15 19:10:42 +00:00
29d2e53463 Bugfix, own collection
Using RMB on menus to change hotkeys was broken.
- the input button was on a weird place outside menu, assign
  would close pulldown, so you had to reopen to check
- ESC didn't close the button, but assigned ESC as hotkey.
  This key is a protected key, and always should be escaping.
- Worst bug: if you used this on a 'user keymap' it removed
  all entries from the map...
2010-12-15 18:09:25 +00:00
35f431b3d0 Menu UI feature common in other widget sets:
Automatically assign menu keys based on name, alternative to pressing number 0-9 on menus items.

 keys are assigned by first giving each menu item the first character of any word, if that fails any key in the name is used.

- active key is shown underlined.
- only ascii keys are assigned currently.
- can run operators, open menu items.
- currently this only works in cases where number buttons were used (UI_BLOCK_NUMSELECT), but could be enabled for file menu, splash etc by removing this check.
2010-12-14 02:38:29 +00:00
7a581f95d0 check if a path can be created to a property before showing keyframe items in menus since they only give an error when accessed. 2010-12-13 11:39:11 +00:00
b27f52ce24 bugfix [#25154] .MXF files should be included as a known video file type in the sequencer
[#25159] Vertex locations dont read correctly and are not labeled correctly in the properties bar.

- non rna buttons can now have units set.
- calls with invalid units system now raises an assert().
- include .mxf in filter.
2010-12-10 04:10:21 +00:00
4640833747 Two nice usability fixes:
- On inserting keyframes in buttons, no redraw happened
- Keyframe in icon-only buttons now draw color in background.
2010-12-09 18:08:58 +00:00
2f366d1544 use BLI_strnlen rather then strlen when comparing against fixed lengths. 2010-12-05 23:50:55 +00:00
c98f5b2e4b Bug fix #25042
Emulate numpad option: failed to use zero key to reset color picker.
2010-12-05 12:14:02 +00:00
cd97253502 - added GCC warning -Wstrict-prototypes
- fixed bug in paste material, exposed by stricter warnings.
- removed/renamed various shadowed vars.
- removed BGE lamp.colour, only allow lamp.color attribute.
2010-12-03 12:30:59 +00:00
6c7403b8bd bugfix [#24944] Crash on attempting to keyframe HSV color
prevent eternal loop
2010-11-27 18:30:56 +00:00
01117ca27b Bugfix #24823
Color picker: RMB "insert single value" was inserting all three values.
Same case as yesterday, made code recurse into open menu to check for
active button there.
2010-11-22 18:51:40 +00:00
722376ed7b Bugfix #24824
Color Picker: when inserting keys (right mouse menu), the colors didn't
change for buttons to indicate such. The function that sets the flags
returned too early.
2010-11-21 13:01:22 +00:00
51dcbdde03 use 'const char *' by default with RNA functions except when the value is flagged as PROP_THICK_WRAP.
Also use const char in many other parts of blenders code.

Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
2010-11-17 09:45:45 +00:00
7f96852176 fix for creating movie paths with non utf8 names.
button test if non utf8 chars are allowed was inverted.
2010-11-16 08:53:55 +00:00
fe18f517a1 bugfix [#24635] "Add Shortcut" 2010-11-10 11:19:52 +00:00
022e72e148 bugfix [#24432] HS+V color picker 2010-10-28 12:01:02 +00:00
e205a9a142 for the color picker functions use UI_GRAD_* constants rather then numbers, no functional change. 2010-10-28 11:49:56 +00:00
53c1d1a18a patch [#24320] Fix for [#24311] Copy and Paste
from Alexander Kuznetsov (alexk)

   This check was dubious to begin with, if it causes more problems it should be removed.
2010-10-19 08:35:30 +00:00
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
2a7f585fba bugfix [#23070] some shortcuts cannot be saved in a usual way 2010-10-14 13:18:42 +00:00
f8e7ad91e9 fix unused args warnings and remove some unused args. 2010-10-14 13:17:34 +00:00
843d8859a7 bugfix [#23355] Square Color picker moving by itself and locking up 2010-10-13 13:53:49 +00:00
7c538107ea bugfix [#24030] Grease Pencil + Driver keys 2010-10-13 03:17:58 +00:00
159cf6e5dd bugfix [#24214] F6 "last operator" panel repeatable segmentation fault 2010-10-10 23:37:25 +00:00
942d5dd804 bugfix [#24158] Object text fields immediately search based on existing content
also remove some unused struct members from uiBlock/uiBut.
2010-10-07 00:14:21 +00:00
cca8fce807 Bugfix #23031: adding a driver ontop of keyframe makes driver undeletable
Now drivers cannot be added to properties that have been animated (and visa versa). Previously, the check was only checking if there was a keyframe, not whether the property was animated.
2010-09-30 10:39:05 +00:00
30bd26d435 [#24028] Minor fixes to BLI_math_vector
+ minor warning fixes.
2010-09-28 11:48:13 +00:00
Nathan Letwory
b2c42b8ad1 Fix [#24038] keyboard navigation not working in second level menus
Reported by David Sullivan

Commit #32066 applying patch [#23675] broke keyboard and mouse wheel navigation in menu in deeper levels.
2010-09-28 01:20:36 +00:00
58082beda9 Fix #23847: keyframe insert on button not working in popup menus, e.g.
the vector popup for node inputs.
2010-09-25 14:32:26 +00:00
725c8dde92 patch [#23675] fix #22787 with workaround
from Shane Ambler (sambler)
2010-09-22 17:13:23 +00:00
36c273b1f7 - bone roll now in degrees not radians.
- rna buttons with units set now use the units base value for snapping. 
- bone head/tail radius could be set negative.

matt: removed a check in ui_is_but_unit() which made angle buttons return false, what was this for?
2010-09-16 04:19:22 +00:00
7d8f0fce7a patch [#23758] Better handling of UTF chars in UNITS fields (lengths, angles, etc.)
from Lorenzo Tozzi (oni_niubbo) with minor edits.

--- from the tracker
The present situation is this: due to bug#22274, during editing, UTF chars are stripped from buttons with a unit associated
(length, angles, etc.).
Example: if the button displays '90°' and you click on it with LMB, the editing string will become '90'.

The problem arises if you use microns: '34µm' becomes '34' that blender interprets as 34 meters. So clicking on a button
and hitting enter won't confirm the previous value, but will change it (very badly also).

Of course nobody is using microns in blender, but the problem will arise when we will implement areas and option 'Separate
Units' will be enabled. The value '2m² 3cm²' will become '2m' during editing.

This patch solves the problem rewriting the string in a smarter way than just stripping the UTF chars: the unit is translated
from unit->name_short ('µm') to unit->name_alt ('um'). So clicking on '34µm' the editing string will become
'34um'.
--- end

note: rather then allowing empty strings in name_alt field I made it so if the unit system was the default one a NULL name_alt will just strip the string, since its the default its not needed.
2010-09-15 17:37:00 +00:00
f28b5e672e python/utf8 compatibility fixes. (as discussed on the mailing list)
- user input gets non utf8 chars stripped all text input other then file paths.

- python has the same limitations, it will raise an error on non utf8 strings except for paths use unicode escape literals so its possible to deal with saving to these file paths from python.

- new string functions
  BLI_utf8_invalid_byte(str, len) returns the first invalid utf8 byte or -1 on on success.
  BLI_utf8_invalid_strip(str, len) strips non utf-8 chars.
2010-08-28 12:34:22 +00:00
85dcd4c636 Fix #23433: crash with undo where a UI button was still active and accessing
data that was freed.
2010-08-25 09:33:48 +00:00
e2826f379d Small UI Tweak: Added NumPad-0 as additional hotkey for Reset to Default Values. Previously, only ZeroKey (i.e. 0 on top row) was used, which was not very convenient to hit) 2010-08-12 09:50:04 +00:00
8c455e1da8 remove unused includes 2010-08-08 08:33:47 +00:00
9a9e04edfb patch [#23060] ColorRamp python access functions
from Dan Eicher (dna)
 elem = color_ramp.elements.new(position=0.3)
 color_ramp.elements.remove(elem)

- Modified the patch to make generic functions for adding and removing (inline code was in 3 different places)
2010-07-30 00:20:05 +00:00