Commit Graph

703 Commits

Author SHA1 Message Date
d4c87f2f79 Code cleanup: remove unused button aspect 2014-02-13 09:37:27 +11:00
bc41d255cb NDOF: minor color picker improvements
- swap Z/Y axis so Z changes hue and X/Y change location.
  this way you can use ndof like a joystick and Z rotation like a dial
  for the hue.

- change sensitivity when shift is held to be 1/5th
2014-02-12 21:05:24 +11:00
e2089e1406 NDOF: fix for negative colors and flickering hue when picking with HSVCUBE 2014-02-12 21:05:24 +11:00
c046cb80ed UI: allow clicking to close menus and popups (but not submenus). 2014-02-11 04:23:44 +11:00
35f62bdced UI: refactor menus to remove menus encoded in strings
On every redraw a single unopened dropdown boxe would translate
and convert every EnumPropertyItem into a string,
then decode every item, and search those items to find the name of the button to draw.

Replace this with a custom menu callback for RNA enums,
tooltips for enums now show too.
2014-02-10 13:04:43 +11:00
385c892418 UI: use proportional option while dragging buttons 2014-02-09 08:42:45 +11:00
127330d6ca UI: multi-drag number button editing
clicking and dragging down edits multiple number buttons at once. (patch D270)
2014-02-08 09:42:26 +11:00
ff0ceb9926 UI: split ui_button_execute_do into begin/end 2014-02-08 09:42:26 +11:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
fc9626b1df Change confusing check discovered while working on HCL color wheel:
COLOR widgets never get created with UI_GRAD_V_ALT values. This is
intended for HSVCUBE color sliders only so reverting this to old value
before it was substituted with a define, which was -1.

There's one case where COLOR buttons get defined with a1 value different
than -1 which is in ui_def_but_rna. There the step value of the RNA
property is used. However, that meant that if step equaled to 9, which
is UI_GRAD_V_ALT value (unlikely) or if UI_GRAD_V_ALT was changed to 10
in future, or we added check for e.g. UI_GRAD_L_ALT which is 10 in HCL
branch, color widget would not get a color selection menu spawned.
2014-02-05 10:45:14 +02:00
a1a0ebbf49 Code cleanup: use length squared where possible 2014-02-02 02:24:48 +11:00
9612433884 UI: minor optimization for button lookup, break early when button found
also reduce int/float conversion
2014-01-29 23:05:32 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
8b6b42b694 UI: tweak menu padding and make separator line more visible.
Adds some padding to the left of the icon, adds more space around the separator
line and make it more visible, and add some spacing at the top and bottom of
the menu. Ref T37794

Reviewed By: dingto, billrey

Differential Revision: https://developer.blender.org/D223
2014-01-17 17:06:11 +01:00
b8b412230b Code Cleanup: use iroundf
also increase precision of rctf print functions
2014-01-15 13:40:40 +11:00
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
2dba2e72b7 Code Cleanup: de-duplicate text pasting which only used the first line 2014-01-08 17:39:12 +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
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +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
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
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
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
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
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
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
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
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
9c262e5649 Code Cleanup: style comments 2013-11-25 11:00:55 +11:00
1fe114a876 UI List: renaming can now also be done with double click and ctrl+enter.
This also fixes a bug where ctrl+click would not properly work when pressing
ctrl after moving the mouse over the text, it had to be pressed beforehand.

Hack is now to have LISTROW active, but when it detects any of these events
it will activate the text field that the mouse overlaps with instead.

Reviewed By: mont29

Differential Revision: http://developer.blender.org/D38
2013-11-24 12:58:13 +01:00
5009346907 revert part of last commit, add ui_but_find_mouse_over_ex()
so we dont need to pass event to functions to get a button at a location.
2013-11-24 05:59:16 +11:00
f842ce82e6 UI List: ctrl click on names in list can be used for renaming.
Summary:
More information here:
http://lists.blender.org/pipermail/bf-committers/2013-November/042113.html

Reviewers: brecht

Reviewed By: brecht

CC: mont29

Differential Revision: http://developer.blender.org/D8
2013-11-23 18:43:23 +01:00
904129fd9b Squashed commit of the following:
commit b8b7180760b7c57f15b9930c29207febcf5fefb3
Author: Bastien Montagne <montagne29@wanadoo.fr>
Date:   Thu Nov 21 16:31:16 2013 +0100

    Code cleanup: replace "LISTLABEL" button type by an "UI_BUT_LIST_ITEM" button flag.

    Summary:
    Rationals:
    I) I was never that happy to have a full button type just to set custom colors to labels inside listitems!
    II) If we use (as planned) TEX buttons instead of labels to allow listitems click-rename, I'd like to be able to use listitems' theme color here as well, much easier witha flag than adding yet another button type!

    Note: related to D8

    Reviewers: brecht

    Differential Revision: http://developer.blender.org/D25
2013-11-21 16:51:29 +01:00
254aa8f3a0 Squashed commit of the following:
commit 6f97e194e58aab38d351c796bf7bb6abca33f5f9
Author: Bastien Montagne <montagne29@wanadoo.fr>
Date:   Wed Nov 20 21:18:20 2013 +0100

    Code cleanup: Move some uiBut->flag to uiBut->drawflag, make those flags anonymous enums.

    Summary:
    Make some room in but->flag (I did not add another flag, we already have drawflag, which was nearly not used up till now).

    Note: I’m not sure whether REDALERT (and perhaps even DISABLED?) should not go to but->drawflag as well...

    Related to D8

    Reviewers: brecht

    Differential Revision: http://developer.blender.org/D22
2013-11-21 14:43:08 +01:00
25560a3734 Fix T37545: SV+H color cube display changes H slider position when modifying S or V.
The widget for the SV gradient was disabling display colorspace transform, but this was not happening for the H slider below, leading to varying H values used to calculate the slider position.
2013-11-20 11:37:56 +01:00
df060e5d21 Fix T37088: Crash with eyedropper (shortcut E) 2013-11-19 05:49:39 +11:00
b6b4aabf04 Fix T37511: toggle-drag feature was crashing with menu items. 2013-11-19 02:28:21 +11:00
d49498a461 Fix T37442: Disabled uiList would "freeze" Blender when trying to drag-resize it.
For now, simply disable drag-resize for disabled uiLists!
2013-11-16 11:32:32 +01:00
ad34a5cc1b Fix [#34675] *AFTER 2.69* Info view shows duplicate operators with incorrect values of args
Refactored a bit WM api to generate operator's pystring, now it can also handle correctly macro operators. Thanks to Campbell for the review!
2013-11-06 20:56:18 +00:00
db8e02bc85 revert own commit r60607, caused bug [#37253] 2013-10-30 11:32:30 +00:00
bb66da5e02 holding ctrl now snaps the hue for color wheel and hsvcube.
this makes it easy to set primary colors without using RGB sliders.
2013-10-25 23:05:34 +00:00
2a387436bb code cleanup: use bool for shift arg, order args more consistently between functions. 2013-10-25 22:09:31 +00:00