Commit Graph

2804 Commits

Author SHA1 Message Date
2dba2e72b7 Code Cleanup: de-duplicate text pasting which only used the first line 2014-01-08 17:39:12 +11:00
e87095fa5d Cleanup: silence warnings. 2014-01-07 14:53:32 +01:00
256a069987 Middle-clip tweaks:
* Now only middle-clip when both left and right parts of remaining strings are at least two times icon-width (thus most short labels will never be middle-clipped).
* Add a trailing ellipsis to right-clipped strings (unless it would take more than 20% of whole available width, in this case just clip chars, to keep as much data visible as possible!).
2014-01-07 14:53:32 +01:00
ede891808c UI: pin icon was ignoring DPI 2014-01-06 03:10:15 +11:00
ca78e402eb UI: Use shift+lmb for toggling panel pinning (not to conflict with MMB emulation) 2014-01-06 03:00:54 +11:00
0074eac1ed More tweaks to clip middle:
* Do not apply margins with MENU (i.e. dropdowns) either.
* When middle clipping would remove only a few chars, rather clip right part!
2014-01-04 16:50:42 +01:00
76d9244843 Fix core issue with clipping labels (labels have no margins, so border should be 0 in this case!). 2014-01-04 16:18:08 +01:00
6734936c13 RNA API: use bool's for enum itemf callbacks. 2014-01-04 18:10:01 +11:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
cde3ff75d9 UI: Fix issue where tab text was too small and closely spaced 2014-01-04 13:55:40 +11:00
56a531eb29 Fix T38043: Text clipping when it shouldn't
Tweak some more 'middle clipping' (zoom issues).
2014-01-03 15:49:07 +01:00
f489e0c14c Code Cleanup: remove strlen() and unneeded include in recent commit
also fix for incorrect sizeof() use.
2014-01-03 19:40:29 +11:00
99ed221a6b UI: Tooltip fix for the Particle Template ID.
Reviewed By: brecht, dingto
Differential Revision: https://developer.blender.org/D165
2014-01-03 02:14:32 +01:00
3c6b5b72a4 Add a new "shortening process" for UI string drawing, which keeps both right and left parts
of the drawstr and replaces the middle by '...'

Rationnal:
It's usually easier to figure out what a troncated string means if you have both its start and end parts.

Details:
It currently affects all UI items (text fields, buttons, labels...).
Only exceptions are buttons inside menus, text fields & co being edited, and numbuttons/sliders.
Note that some static texts (like panels' titles or items in outliner) do not use usual UI items,
and just draw the whole text, using OpenGL to clip it. Will make another patch to fix this.

Reviewers: campbellbarton, brecht, carter2422, #user_interface

Reviewed by: brecht, carter2422

CC: billrey

Differential Revision: https://developer.blender.org/D114
2014-01-01 11:58:45 +01:00
33a027b3a3 Fix T37993: mass of Rigid Body ignores scene unit scale
Mass units weren't scaled in the ui.
2013-12-31 18:10:30 +01:00
8901701808 UI: Display alpha checkers in image info's color swatch. 2013-12-24 17:20:37 +11:00
7294c54db0 UI: Resolve T37917, disable tooltip scaling (zoomout only) 2013-12-23 12:46:50 +11:00
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