Commit Graph

133 Commits

Author SHA1 Message Date
26c5a1c301 Cleanup: right shift in interface code 2018-07-01 20:12:07 +02:00
d886e32270 Cleanup: strip trailing space from interface files 2018-05-23 10:48:50 +02:00
2200e5a280 Fix strict compiler error after recent UI changes 2017-07-21 10:52:36 +02:00
d415a1cbd6 Fix T49034: multi-drag crashes when UI forces exit 2017-07-11 19:10:40 +10:00
e5fa738ce9 UI cleanup: simplify Icon handling of uiDefAutoButR for PROP_POINTER.
Comes from D113, but really not related to the patch's topic!
2017-03-31 12:14:27 +02:00
Julian Eisel
c4f60319d1 UI: Try limiting 'x' icon to search buttons
Reusing PROP_TEXTEDIT_UPDATE instead of adding a new property flag just for search strings. Currently it's only used for search strings anyway so seems fine for now.

Fixes T50336.
2017-01-11 22:15:50 +01:00
Julian Eisel
514db9f014 UI: Remove 'x' icon from paths and lists 2016-11-29 23:41:20 +01:00
Julian Eisel
e0307113a5 UI: Add 'x' icon to text buttons to clear content
This is useful e.g. for search buttons to quickly clear the filter string. We might want to make this optional for python scripts.
2016-11-28 19:03:31 +01:00
2e2dc9b9e3 Refactor translation code out of blenfont
- Add blentranslation `BLT_*` module.
- moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`).
- moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
2015-08-18 07:01:26 +10:00
7478eb9bd0 Cleanup: wrapped function indentation 2015-05-05 05:19:48 +10:00
Julian Eisel
cf366c8b66 UI: 'View Online Manual' Shortcut
D1031, implement proposal T37478 to give easy access to the online manual.

Use Alt+F1 while hovering over a button/setting.
2015-04-27 01:35:24 +10:00
d993bad5e7 Fix possible NULL pointer dereference
also remove redundant NULL check
2014-12-30 08:13:15 +11:00
3e034831de Refactor 'immediate search' feature
Currently, code just checks whether a text-edited button uses a given icon (VIEWZOOM) to decide to apply changes on each typed char.

This patch adds a propper button flag (UI_BUT_TEXTEDIT_UPDATE) and a dedicated RNA flag (PROP_TEXTEDIT_UPDATE) for that.
It's also now usable not only for text buttons, but also for example for num buttons when in 'text edit' mode, etc.

It also fixes an actual bug, which is for text properties, in 'immediate' mode, hitting escape would not restore org value, because `ui_apply_but_TEX()` would set its orgstr to NULL on first call (giving it to `but->rename_orig` instead of copying it).

Note no change in behavior is expected from user POV.
Update for addons using that 'VIEWZOOM' icon 'feature' will follow (if any).

Reviewers: campbellbarton

Reviewed By: campbellbarton

Projects: #user_interface, #bf_blender:_next

Differential Revision: https://developer.blender.org/D938
2014-12-25 12:55:29 +01:00
0efa41e996 Fix rare crash dragging number-buttons
Could happen dragging shape-keys UIList & the lower slider at once.
2014-12-01 23:39:06 +01:00
5c6e333780 UI Refactor T41640
Make the UI API more consistent and reduce confusion with some naming.

mainly:
- API function calls
- enum values

some internal static functions have been left for now
2014-11-10 23:06:54 +01:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
f0a3ea54f8 Fix for weak floating-point number comparison.
Was causing assertion failures in MinGW-w64.
2014-06-18 14:18:41 +09:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
433d55e9b4 Code cleanup: spelling & style 2014-03-15 23:46:02 +11:00
c17acf1d6e Code cleanup: quiet warning, 'else' would always crash (& never occurred)
also quiet waning clamping
2014-03-13 12:03:18 +11:00
e5e0888a8f UI: allow passing "" for icon only enum buttons and still get an icon
Enum icon-only buttons were getting their strings set,
then truncated with blenders string shortening methods, then not drawn
because there was no room (since buttons are icon width).

Modify UI code so icon-only buttons don't get names and passing "" to a
button won't have its text set later on.
2014-03-12 22:56:10 +11:00
04db32b698 Code cleanup: fix compiler warning with clang. 2014-02-09 13:56:49 +01:00
873f901e5a UI: improve reports popup
- use labels rather then menu items (items selected but did nothing)
- each report gets its own icon (icons besides first were ignored)
- use uiPupMenu rather then string based menu.
2014-02-09 12:00:03 +11:00
2dafd1bfb8 UI: butstore API to generalize button storage for modal handlers 2014-02-08 09:42:26 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
d5c9b509ec Fix issues with float precision in numinput, like 'R 123' who would show additional 'noise' digits.
Expose float precision helper in UI_interface.h API, so that numinput can use this helper as numbuttons already do.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D186
2014-01-08 17:05:05 +01:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11: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
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +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
319831d7b8 code cleanup: use an enum for uiBut->pointype (more useful debug display of members),
and rename COL -> COLOR --- less confusing since the layout engine has row/col's.
2012-09-11 23:10:23 +00:00
1a7eb3454e style cleanup 2012-09-08 08:59:47 +00:00
358f7d40b6 style cleanup: use TRUE/FALSE for ui align args. 2012-06-19 23:08:16 +00:00
9355bece59 click dragging with the eye dropper now averages out colors - useful when you have grainy footage of a green screen. 2012-06-14 22:48:40 +00:00
a5af5e8f50 style cleanup: re - http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Braces_with_Macros 2012-04-30 16:22:40 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
a6ebffe182 style cleanup: interface 2012-03-30 01:51:25 +00:00
ab4a2aaf4a style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:38:07 +00:00
2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
da25b50ccb image save operator now shares settings and UI with render & image out node.
details:
- setting format options from python isnt possible anymore since this isnt exposed via op->properties, python should use image.save() function instead.
- image save UI now hides 'Relative' option when copy is selected since it has no effect.
- default image depth is set to 8 or more if the image has no float buffer, otherwise its set to 32 or less.

other fixes:
- image new was adding an image with a filepath set to "untitled", if this file happened to exist in the current directory a save on the generated image would overwrite it, now initialize to empty path.
- BKE_ftype_to_imtype was returning an invalid value if ftype==0.
2011-11-21 23:56:32 +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
fbdfdfefd8 use BLI_snprintf rather than sprintf for interface functions 2011-09-26 16:53:04 +00:00
6d125e159d i18n: code clean-up
- Move all translation-related declarations to BLF_translation.h
- Reverted some changes to match trunk svn rev40365
2011-09-20 07:39:25 +00:00
706a2c80f0 i18n: code cleanup and fixing unneeded translation (when partial translation is used only) 2011-09-19 15:10:38 +00:00
Xiao Xiangquan
981f7fcd0d merge with trunk r39834 2011-09-01 15:08:32 +00:00
540f0c64b5 add in asserts for when array/non array RNA funcions are used incorrectly, would have made previous fix a lot easier to find.
also remove unused argument from RNA_property_array_check.
2011-08-14 10:28:18 +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