Commit Graph

212 Commits

Author SHA1 Message Date
7627a742ab UI list template: committing patch [#26629].
This adds the ability (esp. for py scripts) to add some controls for each list element. See http://wiki.blender.org/index.php/User:Mont29/UI_Template_List_Enhancement for details.
2011-10-28 13:09:43 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
8e2bc6cdbc Context menu 'Edit Source' operator no longer needs to be enabled as a build option, improved this so the python file:line lookups are only done when the operator runs (previously this was done for every button, every draw when the build option was enabled).
Perhaps this should be hidden when not running with --debug, easy to change.
2011-10-23 04:13:56 +00:00
874c96a2b9 Cleaning i18n code.
Previous state:
Right now, there are "memories" of the "old" (less than a month!) translation way:
* A few remaining calls to BLF_gettext() (only UI_translate_do_iface and UI_translate_do_tooltip should be used).
* The _() macro still also calls BLF_gettext()!

New state:
Here are the changes made by the patch:
* Removing the no more needed _() macro.
* Removing most N_() and _() calls, only keeping the few needed ones (i.e. strings that are in no other way findable by xgettext and/or update_msg script).
* Defining in UI_interface.h IFACE_() and TIP_() macros (resp. for UI_translate_do_iface and UI_translate_do_tooltip).
* Replacing all calls to BLF_gettext by relevant IFACE_ or TIP_ one.
* Replacing all calls to UI_translate_do_iface by IFACE_.
* Replacing all calls to UI_translate_do_tooltip by TIP_.

All this somewhat clarifies and simplifies the code.
On the bf-translations scripts side, this only implies adding IFACE_ and TIP_ as detection markers for xgettext.
It also allows to reduce POTFILES.in quite notably (only 20 files remaining in it).

Please also have a look at those pages:
* Coder POV: http://wiki.blender.org/index.php/Dev:2.5/Source/Interface/Internationalization
* Translator POV: http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Translate_Blender
2011-10-20 20:38:26 +00:00
f618bc5aca Fix #28202: (only) modifying keymap item properties did not save properly, the
update signal for this was missing. Problem is that the operator properties
RNA update callback doesn't know the associated keymap item, worked around it
with UI template now.
2011-10-04 13:24:48 +00:00
2ad45b5c4f fix 2 bugs with reset-default failing on operators redo panel.
- The operator its self was registered so resetting the defaults would unhelpfully replace the toolbar with the reset to defaults operator panel.
- The callback for the operator wasnt being used so the settings were changed but the operator didnt re-run.
2011-09-28 18:45:17 +00:00
f4dec97cef fix for building on windows, clear some warnings too 2011-09-27 01:32:27 +00:00
dc76be62d9 replace strnlen with BLI_strnlen, make some args const - no functional changes. 2011-09-26 17:30:56 +00:00
ae0124157f Translation: reload font on enabling/disabling use international fonts. 2011-09-21 15:15:30 +00:00
706a2c80f0 i18n: code cleanup and fixing unneeded translation (when partial translation is used only) 2011-09-19 15:10:38 +00:00
30293dc2ca svn merge -r39834:40222 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-15 13:02:37 +00:00
5fdbfbaf3a replace magic numbers for flags for uiSetRoundBox(); 2011-09-11 06:41:09 +00:00
Xiao Xiangquan
465c3b82fa merge with trunk r39216 2011-08-10 14:32:03 +00:00
79e359f92a rna/ui: avoid duplicate property gHash lookups by passing the property when its already been found.
added _prop suffix to ui functions which take a prop rather then a propname, may change this later since its not that nice but for gsoc branches this keeps existing UI functions working the same.
2011-08-06 16:00:00 +00:00
a157112ac5 fix for icon scaling with the DPI setting
- icons were scaling by the sqrt(dpi)/8.48528, but infact they only need to be scaled by (dpi/72).
- UI_icon_get_width value was being used without multiplying by dpi scale.
2011-08-05 10:45:32 +00:00
Xiao Xiangquan
77926a7f9d select uiStyle according to UserDef and update lang-packs 2011-07-16 18:28:24 +00:00
Xiao Xiangquan
b429af10d0 merge from trunk #37722 2011-06-24 03:30:50 +00:00
68a12c74b6 fix [#26621] Memory leaks when creating popup window.
also fixes memory leak when cancelling a popup dialog (new image for example).
2011-06-17 12:48:33 +00:00
88676349a4 Code holiday commit:
- fix: user pref, window title was reset to 'Blender' on tab usage

- Undo history menu back:
  - name "Undo History"
  - hotkey alt+ctrl+z (alt+apple+z for mac)
  - works like 2.4x, only for global undo, editmode and particle edit.

- Menu scroll
  - for small windows or screens, popup menus now allow to display
    all items, using internal scrolling
  - works with a timer, scrolling 10 items per second when mouse 
    is over the top or bottom arrow
  - if menu is too big to display, it now draws to top or bottom, 
    based on largest available space.
  - also works for hotkey driven pop up menus.

- User pref "DPI" follows widget/layout size
  - widgets & headers now become bigger and smaller, to match 
    'dpi' font sizes. Works well to match UI to monitor size.
  - note that icons can get fuzzy, we need better mipmaps for it
2011-06-04 17:03:46 +00:00
53a2f11148 fix [#27285] Renderslot missing
scale fixes size header buttons by DPI
2011-05-05 15:21:43 +00:00
c2f18383f9 Fix #27165: uvedit mesh selection sync did not handle click / shift+click
for switching selection modes in the header.
2011-05-02 11:34:57 +00:00
422f1674bb fix for using uiItemIntO for an enum, added uiItemEnumO_value function. 2011-03-24 12:36:12 +00:00
108d150032 From the todo:
Hanging Tooltips solved!

It appeared to be that an active button remained in that state when
another region/editor became active. It then kept the button-activate
state, and therefore also the optional tooltip.

This only happened on fast moves, when a mousemove event was not passed
on anymore to the previously active subwindow.

It has been solved with a new notifier (SWINACTIVE), which gets sent on
new active regions. The screen listener then calls uiFreeActiveButtons()
to find out if buttons were still active somewhere else.
2011-03-09 18:42:35 +00:00
4ed5cd6cef == UI icons ==
* Change ICON_NULL --> ICON_NONE to avoid two #defines with the same meaning.
2011-02-27 18:03:19 +00:00
Nathan Letwory
8172207d20 doxygen: editor entry 2011-02-21 07:25:24 +00:00
b47bfd85e8 UI Tweaks: Text field in Rename Markers popup now gets focus when the
popup appears, saving an extra click

I've separated out the "XXX"-'d event-adding-hack section from the
search-menu code into a separate API function (as recommended there).
This call is used to make sure that textboxes in popups can get
activated by default, to allow typing immediately.
2011-02-15 01:24:12 +00:00
4124804b4e many functions in blender are not marked static but should be.
most local modifier,GPU,ImBuf and Interface functions are now static.

also fixed an error were the fluid modifier definition and the header didnt have the same number of args.
2011-02-13 14:16:36 +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
86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
a7ceeafd71 - correct typos in comments.
- move boxpack struct out of the public header.
2011-01-02 11:06:50 +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
eb8458b064 Centralized operator UI drawing into a new function uiLayoutOperatorButs(),
Operator drawing calls were duplicated in file selector panel, redo panels, redo & dialog popups.

note, uiDefAutoButsRNA's column's argument was misleading, renamed to label_align.
2010-12-15 05:42:23 +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
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
15d37747b3 bugfix [#25074] visible, selectable and render toggles in outliner not available
outliner added UI buttons which exceeded the range of a short, use ints for x/y button positioning.
2010-12-07 09:22:14 +00:00
263830f000 Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
3066d82662 patch [#24800] Make scene type buttons from material preview optional
from Wenzel Jakob (wenzel)
2010-11-19 07:46:23 +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
dcda17b3b3 == filebrowser ==
Bringing back missing feature: Create new directory by typing a not existing name into the directory button.

Note: Small issue still with autocomplete -> if typing the new directory directly after autocomplete, it doesn't execute the operator yet.

Also fixed some minor compile/cleanup issues with warning about signed/unsigned comparison and missing header.
2010-11-06 16:09:12 +00:00
1807beabf5 - UNUSED macro wasn't throwing an error with GCC if a var become used.
- made interface, windowmanager, readfile build without unused warnings.
- re-arranged CMake's source/blender build order so less changed libs are build later, eg: IK, avi
2010-10-16 02:40:31 +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
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
e546d7666b minor changes needed for the next commit.
- BKE_add_image_extension now sets the extension rather then appending. (no more image.jpg.tga)
- py/rna functions which have no return value now raise an error if a non-None value is returned.
- added back the red-alert flag so buttons can have a red highlight if somethings wrong.
2010-09-17 05:58:06 +00:00
Nathan Letwory
2ac0a5637c Apply patch [#23779] Small cleanup with gl_roundbox*
By Luca Bonavita (mindrones)

The patch renames and moves gl_round_box, gl_round_box_shade and gl_round_box_vertical_shade to UI_interface.h, so the extern usages are not needed anymore.
2010-09-15 12:18:50 +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
ad405f0cb7 remove rna function template_triColorSet(), was only used in one place and can be done just as well with 3 function calls. 2010-08-25 00:34:40 +00:00
5c604e5524 remove recently added rna function uilayout.prop_search_self() and instead allow collections to be coerced into rna structs when they define a type.
eg:
 row.prop_search_self(scene, "active", "keying_sets", text="")
...becomes
 row.prop_search(scene.keying_sets, "active", scene, "keying_sets", text="")

This is more flexible since it works for other UI functions too.
2010-08-24 03:02:27 +00:00
69067cc2d5 new UI rna function
layout.prop_search_self(), the same as layout.prop_search() except it uses an attribute of the collection.

A number of collections have an 'active' member which couldnt be used with prop_search() and meant we had a mix of active properties being in collections and directly added as properties.
2010-08-23 06:06:26 +00:00
29ea841d1e 2.5 Modifier/Constraint Template
* Code removal of "compact" feature, after narrow_ui removal this was not functional anyway.
2010-08-16 23:28:20 +00:00