Commit Graph

2887 Commits

Author SHA1 Message Date
9fa7c235f3 Fix for tooltip right side having zero offset 2013-12-23 12:42:46 +11:00
c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
aab587817c Fix T37795: Resetting a button to the default value could crash
Added ui_handle_afterfunc_add_operator so a button can queue an operator
to run without executing it immediately.
2013-12-20 01:07:09 +11:00
dce82591a7 Fix T37830: UILists text now right align.
Simply check for non-embossed TEX buttons inside uiList items, and align their text like labels do.
2013-12-19 09:34:53 +01:00
4b206af1c9 Fix T37847: some buttons displayed too wide in multi-column menus. 2013-12-18 19:35:13 +01:00
6a2d5eb1ef UI: avoid using AT define for malloc id's
They're very verbose and while useful for debugging leaks - a unique
string is normally enough to track down the problem.
2013-12-19 04:08:16 +11:00
8106444756 Revert fix for T37705: it's messing up the panel order in another place. 2013-12-18 15:10:40 +01:00
d591f314f9 Fix T37705: texture panel order wrong when switching from cycles to blender render. 2013-12-18 13:15:13 +01:00
6f4515b614 Fix for button selection offset
Was using a different font size with selection and drawing,
But scaling both so they mostly matched.

This made selection shift noticeably when done on an interface zoomed in/out.
2013-12-18 19:33:05 +11:00
0e694b9b7e Code Clenaup: use const for button checking functions 2013-12-18 19:33:05 +11:00
d963bdf7d9 UI: more fixes for text clipping
Were still cases where numbers could be clipped incorrectly and icon
size was accounted for twice when left clipping (error in own recent commit).
2013-12-18 17:13:58 +11:00
d9e42cf43e Style Cleanup: minor edits in recent changes 2013-12-18 15:35:31 +11:00
d41b2bb25f Fix issue with right aligned number buttons overlapping the label
This also simplifies button clipping which was attempting to detect
offsets that were applied afterwards,
Now apply text clipping after adjusting the button rect margins.
2013-12-18 07:18:28 +11:00
f034e69f0c UI: Theme Colors for Info space 2013-12-18 05:03:30 +11:00
305fc82541 UI: don't attempt to draw with the menu-key when only drawing right aligned 2013-12-17 13:11:31 +11:00
9a623daf9c UserDefaults: disable orbit around object center and region-overlap
both have bad side-effects with strange behavior and viewport performance
2013-12-17 04:04:35 +11:00
a621d1e488 UI: Tabs categories for panels (D75)
- works by defining panel categories, currently restricted to the toolbar.
- no panels define bl_categories yet, so no user visible changes since tabs only show when there are multiple.
- panel pinning is available in rmb menu or alt+lmb.
2013-12-17 03:55:45 +11:00
09b4954d2d UI: use BLF_width_to_strlen for efficient text clipping 2013-12-16 22:00:30 +11:00
f372758257 Interface / Modifiers: Don't show cage placeholder in modifier header, if the current modifier does not support it or the cage is disabled (like Subsurf 0).
This way we save some space but still avoid the jumping around while changing settings in the header itself.

Thanks to Brecht for help on this. :)
2013-12-13 20:57:54 +01:00
3ec7bc05b7 UI: color ramp buttons were redesigned and get a button to pick the n-th color stop.
The add, delete and (f)lip buttons now use icons, and some button locations moved.

Reviewed By: brecht, dingto, billrey

Differential Revision: http://developer.blender.org/D97
2013-12-13 17:49:13 +01:00
51b9d85b09 UI: remove text margin when a slider is aligned to another button
Paint sliders had too much space on right (aligned with pressure icons)
2013-12-13 05:29:54 +11:00
c701082a92 RNA: Add pixels property type 2013-12-13 04:40:30 +11:00
9ad88fbe6d Fix for error exposed by right-align number buttons
When the entire label was clipped, the right aligned number component
could be clipped on its left hand side too.
So "Foo: 1.00" could be clipped to ".00"
2013-12-13 02:47:00 +11:00
09b859d03f UI: change how number button strings are concatenated (to easy add new suffix) 2013-12-12 00:33:41 +11:00
dde5e5ce25 User Interface: Align number buttons labels to the left, number right 2013-12-11 21:27:13 +11:00
7d2652ad7c User Interface: add colon separator for number buttons 2013-12-11 21:06:00 +11:00
8e94d3685a Interface: avoid setting \0 to drawstr in widget_draw_text 2013-12-11 20:35:28 +11:00
ebdaf4f192 Nodes UI: add the position field to the color ramp node.
Reviewed By: dingto, brecht

Differential Revision: http://developer.blender.org/D91
2013-12-10 17:13:59 +01:00
03059f31d8 uiList: Small tweak to drag-resize (switch to auto-size mode).
When you drag past the smallest size of the list, it switches back to auto-size mode.
This commit makes wider the gap between smallest size and auto-size activation,
previously it could switch to auto-size a bit too easily...
2013-12-10 16:23:16 +01:00
a1031d5dd5 Fix T37739: uiList drag-resize was not working as expected outside of panels.
Patch by Brecht, with minor edits by myself, thanks a lot!

Tech details: previous drag-resize handling code was based on the assumption that coords
returned by ui_window_to_block() was relative to the bottom on the uiBlock.
This is in fact completly eroneous, usually this func does not translate at all the coords,
it merely rescale them - except for blocks inside panels, where returned values are relative
to the left/bottom corner of the panel... Pretty confusing, solution for now is to store ref mouse
position in window space, and convert them to block each time, just like current mouse pos.
2013-12-10 16:23:16 +01:00
8dc80e9d73 Style Cleanup 2013-12-10 13:45:17 +11:00
f120adf65c Enhancement: added node colors for every node class
In the user preferences all node classes can get its own color
The in/out color is splitted into 2 sepatate colors
the rna has been updated to better names
2013-12-09 20:22:15 +01:00
c6620905a7 Tooltips: abbreviate long python operator tooltips
Some tooltips would end up containing long string/array args spanning the screen.
2013-12-09 14:25:03 +11:00
9f1ace2469 Add themable colors for edges in UV editor. Reuse WIRE_EDIT for outlines
and EDGE_SELECT theme colors for selected edges.
2013-12-08 01:37:19 +02:00
1ed822202f Code Cleanup: pass rectangles as const in insterface files 2013-12-07 15:47:57 +11:00
d74d6c7c1d Fix T37710: Missing bounds check for active UI list item could crash. 2013-12-06 10:53:41 +11:00
6976866d5a User Interface: Ctrl+C over a menu copies the py command
also use bools rather then ints
2013-12-05 17:26:03 +11:00
f91187d3c3 Code cleanup: replace rectf_scale with BLI_rctf_scale
and add area arg to ui_handler_panel_region
2013-12-03 23:53:21 +11:00
a169a109e5 User Interface: error in own recent commit, replacing loop with memset 2013-12-03 09:10:55 +11:00
a24f83855a Fix for crash pasting text into uilist filter 2013-12-03 01:48:32 +11:00
02aec1e758 User Interface: fix for crash pressing Ctrl+Delete
also remove redundant string duplication.
2013-12-02 21:35:42 +11:00
1815225faa Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-12-02 21:10:07 +11:00
ac38f2584f Code Cleanup: replace ABS() with fabsf() when used with float expressions. 2013-12-01 13:11:12 +11:00
cd4fd50562 Remove some extraneous glEnableClientState/glDisableClientState. This
part of the code is not interleaved with immediate mode drawing so they
are not necessary.
2013-11-29 21:38:01 +02:00
77719bfd06 File Browser: autocomplete keeps focus in the file field when entering a folder.
There is a bunch of internal refactoring going on too:
* No longer use operators to handle these directory and file fields, only makes
  things more complicated than they should be.
* Handle autocomplete partial/full match deeper in the UI code
* Directory field still does not keep focus, that's for another time to fix,
  you can already do pretty quick keyboard only navigation with the file field.

Reviewed By: elubie

Differential Revision: http://developer.blender.org/D29
2013-11-29 17:49:01 +01:00
ac088192d4 Fix T37383: wrong spacing on Add menu in 3D view header.
This also was in the info header but less obvious, mistake in the layout engine.
2013-11-27 05:25:17 +01:00
0570bdc13d Fix own regression in rB254aa8f3a0fb: Titles and sub-titles in menus were drawn shifted to the right.
Reported by plasmasolution over IRC, thanks.

Also fixes wrong handling of "sub-titles" with icons in EnumO menus (they were just treated as text-only ones).

Dev notes: in fact, that clean up commit revealed kind of an "hidden bug that happend to work well"
(or at least, a very bad hack): with titles without icon, code used to use uiItemL with ICON_NONE.
However, as the root layout is a menu one, internal ui code would add a dummy blank icon,
and set UI_HAS_ICON flag for the label button. But in the affected menus, code afterward assigned
UI_TEXT_LEFT to but->flag, thus erasing the (internal) UI_HAS_ICON. As UI_TEXT_LEFT was moved to
but->drawflag, the internal flag was no more erased, and the fake icon was drawn, creating that
shift-to-the-right effect. Turns out we do not even have to set UI_TEXT_LEFT in these cases,
just add label buttons without icon is enough!
2013-11-26 10:41:19 +01:00
02f90c0001 User Interface: don't show macro args in tooltips
was often making much too big strings to show in a tip.
2013-11-26 09:00:24 +11:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
d6e257d447 UIList: add proper support for ctrl-c/v (copy/paste) of names.
Dev notes: Another hack in ui_do_button(), to add a specific handling of LISTROW in case of copy/paste event, which fixes the same 'not working if no mouse mouve' issue for those actions as well. Also added an helper func to switch from listrow to text button, as we now do that in two different places.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D40
2013-11-25 17:42:07 +01:00