Commit Graph

680 Commits

Author SHA1 Message Date
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
03aa664b23 replace snap values with enum and bool depending on use (it wasn't clear which was used when both were int's).
Ctrl+Shift now snaps normal button to 15deg increments.
2013-10-25 07:47:08 +00:00
d859bcf3ad patch [#37197] angle snapping for NORMAL button
from Philipp Oeser (lichtwerk) with minor edits.
2013-10-25 06:59:57 +00:00
69d66f98a8 patch [#37114] copypaste for NORMAL buttons (BUT_NORMAL)
from Philipp Oeser (lichtwerk)
2013-10-16 23:42:44 +00:00
af6636bbed Project Pampa request: copy-paste for curve mapping widgets
Use C-c for copy, C-v for paste over the widget.
2013-10-16 17:48:33 +00:00
d4cf5e3605 fix [#37078] Search props don't react on click at the right end (where 'X' is if field not empty) 2013-10-15 00:24:53 +00:00
03f7885b0a id-data eyedropprt, currently only accessible via the Ekey,
We need to investigate ways to add options like this without cluttering the interface.
2013-10-08 15:32:54 +00:00
e8551313f6 e-key to access the eyedropper over a color button. 2013-10-08 13:58:28 +00:00
d41413758d move color button event handling into its own function. 2013-10-08 13:49:42 +00:00
7e5d5e61ae avoid allocating a dummy string for the unlink button. 2013-10-08 13:10:22 +00:00
7a9bc838de pressing enter over a file-text button is ignored (so enter in the file selector works again). 2013-10-04 18:34:28 +00:00
592443816d re-shuffle ifdef for osx to make it more clear 2013-10-02 16:13:24 +00:00
4bc998d0b3 OSX: readd ctrl-a for 'select all' in text(-boxes) against my own conviction for now - really to be discussed 2013-10-02 16:09:09 +00:00
b5fcc340b6 OSX/keys: change to OSX conform cmd-a for 'select-all' in text(-boxes) 2013-10-01 17:47:08 +00:00
74828cc609 Fix #36783: click outside splash screen to close it would not highlight the
button under the mouse, and so clicking the button failed without first
moving the mouse. Similar issues could happen with popups and switching
windows.

The problem is that a notifier was being used to deactivate possible other
activated buttons, but as notifiers are delayed it could undo the correct
activation too. If anyone notices hanging tooltips or other issues after this
fix, please report them.
2013-09-23 23:31:42 +00:00
Lukas Toenne
37b82a2d26 Fix #36226, Select Linked works not in touch with Prefs.
When setting keymap properties to values equalling the RNA default, they will
get "unset" and automatic operator behavior is used. There is no way to
explicitly set the default value as a user.

1) To allow distinguishing uninitialized (not set) properties in the keymap
items, a few changes to the RNA struct comparison function are needed: Instead
of allowing only strict/non-strict comparison of 2 properties A and B in a
struct, this now has 3 modes:
* STRICT: compare only the actual property values (same as 'strict' before)
* UNSET_MATCH_ANY: if either A or B is unset, consider them a match (same as
non-strict before)
* UNSET_MATCH_NONE: if one property is set and the other not, consider them a
mismatch.

The new UNSET_MATCH_NONE mode is useful for keymaps, because it allows keeping
user-defined property values in the keymap even if they match the default
property value (see wm_keymap_diff function in wm_keymap.c)

2) A new operator is added for unsetting ID properties in the RMB context menu
and in user preferences next to keymap properties. This only works on ID
properties and deletes the ID property storage, so that the default value is used.

In the user preferences for keymaps the properties are shown in an inactive
layout to indicate that the default value is used (which some operators such as
the "select linked" op from the report use to trigger automatic behavior). When
the user sets a property it gets set and stays that way until explicitly "unset"
using the new operator.
2013-09-20 09:10:17 +00:00
f801661f3d when handling the escape key, check for press (ignore release events), right mouse already did this.
ensures the escape key isn't handled twice for one press.
2013-09-12 22:48:46 +00:00
630a06dd83 Fix #36682: disable shift+backspace shortcut to delete all text in text fields,
it's too easy to hit accidentally and isn't a standard shortcut. Deleting all
text is quite easy by just pressing backspace right after clicking the text
field anyway.
2013-09-09 14:23:47 +00:00
35cd649c66 rename cursor setting functions to make modal set/restore more clearly related functions. 2013-09-06 22:34:29 +00:00
d685b18c2f remove calls to CTX_wm_region(C) when the region is already known.
also remove unused toggle vars in uiHandleButtonData
2013-08-31 04:22:55 +00:00
3d0e56e8d9 fix for ui glitch, pressing backspace over a button to reset to the default value didnt work for the uilist text button (others too), missing redraw. 2013-08-31 04:11:50 +00:00
658e72f47d minor ui edits
- move addon refresh button into header
- uilist, use icon for sorting by name (gives more room for name, icon is used in fileselector for same purpose).
- rename orderby to sort in rna and flag names.
- simplify BKE_nurb_handle_calc_simple
2013-08-30 11:49:35 +00:00
113997a03c Last uiList patch (for now!): filtering and reordering of shown elements.
Thanks to Brecht for the reviews. :)

This commit adds a show/hide extension below each uiList, containing by default an option to filter and/or reorder items by name (and to reverse those filtering and reordering).

Each derived uiList class in Python can define more specific filtering by implementing callbacks: the draw_filter() function to draw options in UI, and the filter_items() function to effectively filter/reorder items.

Note: the advanced options for vgroups shown as "proof od concept" in patches do not go in trunk for now, we have to find a better way to get those vgroups info for UI code, we can't afford to loop over each vertex here!

And doc (release notes and uiList example) is still to be updated, will do this in next days.
2013-08-29 12:55:31 +00:00
bcf18878a2 Some tweaking to uiList dragsize, to make it more reactive to very quick moves.
Note that, even though not officialy supporting non-UI_UNIT_Y height items (other point like scrollbar size would faill too), we try to maintain a not-that-bad behavior in this case, which implies a bit of black magic (esp. as our ref point is the bottom of the list, which moves when it is resized :/)...
2013-08-28 19:23:15 +00:00