Commit Graph

295 Commits

Author SHA1 Message Date
9e05f6571f Make sure bool will always have the same size in C and C++
There were an issues with data structures defined in headers
and being used by both C and C++ on systems with stdbool
unavailable.

This happened because bool in this case will be defined as
unsigned int, which is 4 bytes. But C++'s bool is only 1
byte and this lead to alignment issues.

Now bool is always 1 byte, also made sure there's no situation
like bool foo = BitField & BitFlag, which could give overflow
issues. Use (BitField & BitFlag) != 0 instead.

Fixes #35553: Compositor broken (Backdrop & Preview)
2013-05-29 11:49:39 +00:00
38391d9a7d Fix #35281: search menu buttons (with an X on the right side to clear) had text
overlapping the X icon if the text was long.
2013-05-10 20:34:35 +00:00
a63be29da3 Fix #35252: Crash with the node placed partially behind the screen
Issue was caused by negative maximal possible text width happening
in label clipping.

Solved by clamping width to 0 if it's negative.
2013-05-08 13:16:39 +00:00
fdc4eea188 use smaller size for uiWidgetTrias.vec 2013-05-08 12:56:11 +00:00
f9ed2bf9e9 use const vars for UI arrays. 2013-04-30 01:51:25 +00:00
a4a2949309 Bug fix:
Labels in UI were not drawing greyed out when disabled.
Bug in post 2.66a commit to make greying out buttons draw much nicer.

User reported Addon menu was not clearly showing disabled Addons anymore.
2013-04-29 08:45:39 +00:00
8069d1ad1a "Bug" & usability fix, own collection.
Color Pickers in Blender support precision editing with holding Shift key.
Unfortunately, on first click the picker cursor moves to the mouse position,
making the precision dragging quite useless.

Now, if you hold Shift, the picker editing will only apply the delta motion
of your mouse drags, making it much nicer for fine tuning of color grades
in Sequencer or Compositor.
2013-04-27 12:54:45 +00:00
093f95afaa Bug fix #34868
Pulldown menus with long shortcut text labels got clipped badly occasionally.
Made the offset follow DPI better.
2013-04-18 08:51:07 +00:00
7404c1a553 Fix another part of #34877: cycles progress status text not showing correct with
per render layer samples in addition to the progress bar.

Also fixed job progress bar not working at all on high DPI / retina, was so small
the actual progress was not visible.
2013-04-05 17:57:26 +00:00
6ee5b2d40c fix [#34850] "x" to clear ID prop fields is too close to the right border 2013-04-03 05:02:33 +00:00
d74cf43575 UI small fixes:
- Theme color for the brush popup was not correctly coded. Now it follows menu item
  style correctly, which also allows all the themes we have to give readable text.

- RMB cancel also added for slider buttons and the color picker.
2013-03-24 18:59:15 +00:00
5a87e4d255 code cleanup: remove unused button type HSVSLI 2013-03-23 16:03:13 +00:00
Lukas Toenne
8066c09df2 Fix for extra string width padding in ui_text_icon_width, causing labels in right-aligned layouts show an annoying gap. If the layout is right-aligned, make the text button align right as well, so text is drawn at the right side of the alloted rect. 2013-03-21 12:58:31 +00:00
b38870ce25 quiet warning about writing to deprecated member with gcc. 2013-03-18 18:37:59 +00:00
25fa2eedc4 UI fix: drawing disabled buttons now draw OK in all cases.
The old 2.5 code was just drawing a blended rect over buttons, which looks bad
in cases the backdrop is undefined. 

Now widget drawing code just draws everything half transparent. Much nicer!
Time for textured backdrops? ;)
2013-03-18 18:29:22 +00:00
Lukas Toenne
4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
a816b0b3d2 avoid calling glGetFloatv() twice when UI_RB_ALPHA is enabled with uiRoundBox() 2013-03-07 06:46:50 +00:00
032923a9f5 Bug fix #34334
For 2.66a 

Soft shadow was drawing a complete rect, but it should skip the top edge.
That allows transparent menus to still have a shadow too.
2013-03-01 11:42:07 +00:00
47c29c1c2e Themes: disabled items on menus were using a color mix of text and text_selected, this didn't work nice with dark themes and text shadows and overall didn't make much sense.
Now, disabled items use a mix of text and menu item background (inner) color. Same results, but allows dark themes with bright selected text to use shadows.

Example case: http://pasteall.org/pic/show.php?id=45697
2013-02-18 21:19:43 +00:00
14a0ff90bc Fix a few DPI / retina draw issues:
* Color picker cursor was too small, and color cirle was not smooth enough.
* Border select gesture cross before first click did not reach to the border
  of the window.
* Buttons were not drawing emboss properly (also for non-retina actually).
  Note it doesn't draw entirely right for aligned buttons, but this was also
  the case before it got broken.
2013-02-10 18:03:01 +00:00
d760a86927 code cleanup: minor changes, replace len_v3 with len_squared_v3 for comparison. 2013-01-21 18:45:31 +00:00
2b80a7d5da use define for text offset & seletion.
and no need to calloc memory for string selection.
2013-01-17 18:59:19 +00:00
60e5583933 add NULL check for XInput device, since its possible only one is valid. 2013-01-17 02:06:54 +00:00
86d4786305 draw active+disabled menu-items, helps for keyboard navigation. 2013-01-17 01:48:42 +00:00
9a4a5fa2b4 Usability fix:
Blender's data link button (typically with menu and searching options)
now has a X icon to clear its contents. 

Before you had to click, delete text, enter.

For example:
- Object Parent
- Modifier objects or vertexgroups

This fix saves each user 100 clicks per day, with 100k users
that's 3 billion clicks per year!
2013-01-09 15:58:34 +00:00
c03d1270c8 fix bad left aligned text when zoomed out.
also minor change to cylinder_project_exec() - delay getting the MTFace.
2013-01-03 15:52:31 +00:00
1cffa7f339 style cleanup 2012-12-29 15:55:37 +00:00
7d6ea8cddf Finally fixing the issue where the bezier curve drawn while creating a link between two logic bricks doesn't match the mouse cursor location. The issue was the last line segment for the bezier curve was not getting drawn. This is why the error increased as the curve got longer. 2012-12-29 09:44:19 +00:00
60ffe9f8ec Bug fix (own collection)
Icons in search menus were not drawing on the right location when UI panels were zoomed in large.
Not very common, but annoying. (DPI setting worked fine)
2012-12-23 13:02:38 +00:00
566d350369 UI todo:
- Recoded soft shadow drawing for menus, giving better predictable results
  (and round off nicer on top side, was looking bad still)
- Brought it under DPI control
- Added Theme setting to control size and strength for it.

Max size 24 pix:
http://wiki.blender.org/index.php/File:MenuShadow.png
2012-12-20 16:50:39 +00:00
a970991da6 Icon scaling fix: for zoom levels near 1, icon positions are moved to exact pixel
locations. Makes default headers and menus always crisp.
2012-12-19 11:55:41 +00:00
6b2af22d37 DPI: fix wrong scaling of editor type choosing buttons, and for menu arrows
overlapping or being too close to icons in small buttons.
2012-12-18 20:00:52 +00:00
8168fba972 Icons now draw good again!
- Exported via Inkscape a 16 and 32 pixel bitmap version
- Use these as mipmap levels for OpenGL texture drawing.
- Changed code to get right sizes for drawing icons - better than last week's method.

Todo:

- Custom icons don't work yet (old one)
- Missing icons in the svg
- The .sh script for inkscape needs changed to support this
  (now do manual saving)
2012-12-18 19:35:54 +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
ce08127caf Bugfix, IRC submitted:
Color Pickers, square versions, didn't draw the 'cursor' correctly.
Was missing colorprofile check.
2012-12-15 18:12:38 +00:00
1ab6306177 minor edits
- add BLENDER_QUIT_FILE define.
- use const for passing rcti's in widget drawing.
2012-12-13 02:40:49 +00:00
12b642062c Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

Short list of main changes:

- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
  Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
  This allows keeping UI and data without actual saves, until you actually save.
  When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). 
  Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. 
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
  Old option is called "Save Startup File" the new one "Save User Settings".
  To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
  This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
55e55e21b0 Bugfix: softshadow in menus was broken.
Already since like 2.61 - when Array draw was added - drawing only shadow 
in bottom of menus with bad looking corners.
2012-12-09 11:57:06 +00:00
469324b049 Fix compositing normal node not properly showing vector XYZ values when opening
socket menu, and make the normal animatable.
2012-11-17 16:11:02 +00:00
c046b13b56 rename template_color_wheel() to template_color_picker() 2012-11-09 11:03:53 +00:00
3ce1d54e95 Bugfix #33124
User Preference setting for Color Picker type only affected the popup
version. Now it uses it for all color pickers in Panels too.

Note for UI Py team: col.template_color_wheel() function follows
the userpref - might be a need for rename here? Dunno how to handle
this. Comment noted in template code.
2012-11-09 10:33:42 +00:00
cf08068e10 fix [#33121] crashing when srolling down in text editor ! 2012-11-09 03:36:38 +00:00
9b948717b0 code cleanup: float <> double conversion. 2012-11-03 18:23:30 +00:00
f213ae0b19 style cleanup 2012-11-01 09:54:00 +00:00
9fc95bd7ee use min/max inline functions where MIN2/MAX2 were doing type conversion. 2012-10-27 11:18:54 +00:00
2821f822c5 * New string property subtype: PASSWORD
When this new subtypes is used, then string of property is hidden using
asterisks, e.g.: mysecretpassword -> ****************

This code was reviewed and modified by Brecht. Thanks very much:
 - https://codereview.appspot.com/6713044/

This new subtype of string property is intended mostly for Add-on developers
writing Add-on which communicates with some server (http, sql, ftp, verse,
etc.). When this server requires user authentication and user has to type
username and password, then current API didn't allow to type 'hidden' password,
e.g. when you want to demonstrate this script, then everybody can see this
security password. Some examples of Add-on which could use this new subtype:
 - On-line database of textures
 - Integration of render farm
 - Integration of Verse

Security Notes:
 - You can copy paste hiddent string of property from text input using (Ctrl-C, Ctrl-V),
but you can do this in other GUI toolkits too (this behavior it is widely used).
 - Text of string property is stored in plain text, but it is widely used in other
GUI toolkits (Qt, Gtk, etc.).

Simple examples:
 - https://dl.dropbox.com/u/369894/draw_op_passwd.py
 - https://dl.dropbox.com/u/369894/blender-password.png
2012-10-26 12:58:54 +00:00
7cf6786f31 Bugfix #32962
Menu buttons: the text label in a button was clipped on right too soon, there's
more space. Noticable especially on popup buttons with labels like "X" or "Y".
2012-10-25 10:51:03 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00