Commit Graph

422 Commits

Author SHA1 Message Date
059e0dafb4 Cleanup: const correctness for BLI_sortlist 2014-09-24 14:55:02 +10:00
b42b0554ea Pie menus:
If user drags away from initial position, menu changes to drag style and
returning to that position won't remake the menu click-style. Allows to
use the threshold indicator to cancel the pie.
2014-08-14 14:17:39 +02:00
eca7c96a28 Maybe slightly controversial pie commit:
Make pie menu item placement touch the radius from the internal side of
the buttons rather than placing on the center on the cirtcle. This
allows us to get rid of the separate visual angle property, also allows
for tighter placement of pies with a smaller radius without easily
overlapping.

Also pie menu title now always appears above the threshold indicator.
2014-08-13 15:11:19 +02:00
028fd29eeb Pie Menus C code backend.
This commit merges the code in the pie-menu branch.

As per decisions taken the last few days, there are no pie menus
included and there will be an official add-on including overrides of
some keys with pie menus. However, people will now be able to use the
new code in python.

Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/

Thanks:
Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review
and design comments

Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for
suggestions during the development.

Special Thanks to Sean Olson, for his support, suggestions, testing and
merciless bugging so that I would finish the pie menu code. Without him
we wouldn't be here. Also to the rest of the developers of the original
python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who
did the research and first implementation and whose code I used to get
started.
2014-08-11 11:02:26 +02:00
cf9d5db75b Fix T41156: UILayout.prop_enum() does not observe "text" parameter override
We do have odd behaviors with name and expanded enums, but in this case it did
not made any sense at all! :)

Note the error was not in RNA, but in C UILayout api itself...
2014-07-23 14:34:21 +02:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
ea2043eb3a UI: Add support for popups to refresh their layput (D578)
This is needed for popups to chance state once activated,
currently it makes use of operators `check` callback, after values are modified,
as the file selector does already.
2014-06-15 01:42:31 +10:00
f663c4f857 Code cleanup: UI, unnecessary float/int conversion 2014-06-14 00:47:11 +10:00
7fddd7f013 Fix for own recent change to menu shortcut behavior
Missed setting the flag for operator-menus.
Now call `ui_but_add_shortcut` to match the rest of the api.
2014-05-06 18:14:00 +10:00
3d5ab5a496 Warning cleanup: signed/unsigned compare
also remove redundant loop in BKE_pose_copy_data
2014-05-01 05:57:01 +10:00
2025e4cbb9 Code cleanup: quiet warnings & style 2014-04-13 11:26:31 +10:00
9b3bd5582b Replace resize code of image scopes by use of new GRIP button.
This deduplicates/simplifies some code. Also cleanup up a bit scopes UI code!

Use new GRIP button for uiList grab-resize.

This allows us to greatly simplifies the code, and get rid of a few hacks in uiList event handling!

Note autosize mode of uiList is now trigered by any value of list_grip below a given threshold, rather than the fixed zero value...

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D343
2014-04-02 13:09:43 +02:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
44d6c686fa Fix for Layout.operator_enum ignoring alignment 2014-03-20 01:34:24 +11:00
e5e0888a8f UI: allow passing "" for icon only enum buttons and still get an icon
Enum icon-only buttons were getting their strings set,
then truncated with blenders string shortening methods, then not drawn
because there was no room (since buttons are icon width).

Modify UI code so icon-only buttons don't get names and passing "" to a
button won't have its text set later on.
2014-03-12 22:56:10 +11:00
5e7f995b08 Fix: 'F-Curve Editor' popup text was truncated. 2014-02-27 16:18:42 +11:00
bfd0b582ca fix/workaround for v3d object mode selector flipping direction
Allow menu functions to define their own direction, this way
menu_item_enum_opname_menu can keep menu flipping from 2.69.
2014-02-12 10:29:15 +11:00
4bf4c4111e Own recent removal of string encoded menus missed render layers/passes 2014-02-12 00:08:54 +11:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
9598990b9b UI API: don't use a text label when icon_only is set 2014-01-30 15:28:39 +11:00
029a7bbade UI: Fix for icon-only menus too small click-able area 2014-01-27 19:11:37 +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
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
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
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
f801f8057d fix for active bone not saving in editmode. 2013-11-22 10:37:50 +11: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
4ea79fcdda Patch T37363: Highlight bone layers with active bones (as for Object Layers)
Patch by Jose Molina Garcia (sentinel), with style fixes by myself.
2013-11-18 16:06:31 +13:00
0ff70d942f Code cleanup - Reduce duplication of layer number calculations here 2013-11-18 15:53:46 +13:00
a352670791 uiList: fix another bug, where active item labels in sublayouts would not get colored as active (need recursion in sublayouts!). Was affecting e.g. Group node inputs/outputs lists. 2013-11-09 18:44:37 +00: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
11f0e35236 Revert both own r60700 and r60702. API behavior for expanded enums is completly inconsistent, but again, better to do such changes (soft-breaking API) in bulk... 2013-10-12 11:28:37 +00:00
c7109b152e Followup to own r60700, fix was not correct... In fact, beahivor of expanded enums is not consistent with other properties, as there labels are never shown. Keep it for now, though, as this would break many scripts and ui file, better to do this in bulk!
Thanks to DingTo and plasmasolutions for notifying the issue.
2013-10-12 11:03:32 +00:00
b2d3b0244a Fix obvious error in expanded enum layout code, given uiname would never be use... 2013-10-12 09:43:57 +00:00
de3f6b3ec1 re-enable activating the text input field for new popup dialog boxes,
I'd disabled this for 2.68 since it caused bug [#36109].

This fix now only enabled text activation for popups. (so the toolbar textboxes are skipped)
2013-10-09 14:35:25 +00:00
033ca89f12 display angle in axis/angle buttons as degrees as with euler rotations. 2013-09-03 06:27:03 +00:00
6b51c27414 uiLists enhacements: dragresize and better GRID layout.
Many thanks to Brecht for the review!

* You can now drag-resize uiLists (in default or grid layouts).
** Note about "default" size: when you drag below minimal size of the uiList, it will automatically reset to automatic sizing (i.e. size between rows and maxrows, depending on the number of items to show). This often means (e.g. in Materials list with many mat slots) that the list will grow again to maxrows!

* Grid uiLists now have a customizable number of columns (previously it was a fixed value of 9), and they will respect the rows/maxrows settings as well (i.e. show a scrollbar when needed), instead of growing indefinitly!
2013-08-27 15:27:41 +00:00
5dacf174e6 UI layout: Fix the fact that children layouts were implicitely inconditionnaly aligned when the parent was. E.g.in
col = layout.column(True)
row = col.row(False)

Items in row would be 'aligned' in the same group as those in col. Now to get this happening, you have to set row as aligned as well.

Please note that fixes for py UI scripts will follow in another commit.

Also fixed labels of RNA pointers searchboxes, which were missing the colon!
2013-08-23 16:53:37 +00:00
5881fe5d67 avoid runtime overflow (1 << 31), for RNA and armature layer UI. 2013-08-04 00:01:41 +00:00
1d205f4446 fix [#36109] UI softlock when first property of an operator is String
disable editing a string on operator UI popups, causes feedback loop
2013-07-12 12:11:21 +00:00
a3643ee3d6 fix [#36073] Changing list items misses undo push 2013-07-09 23:40:53 +00:00
063be8fdc0 Fix [#35750] list items in properties editor (text colors not following list item theme).
Issue goes back since we stopped using LISTROW button to draw item's name (i.e. since we have custom buttons in list items!).

This commit:
* Adds a new flag to uiBlock, UI_BLOCK_LIST_ITEM, to mark blocks used for each list item.
* Adds a new button type, LISTLABEL, which basically behaves exactly as LABEL, but uses wcol_list_item color set.
* When uiItemL is called, it checks whether current block has UI_BLOCK_LIST_ITEM set, and if so, switch produced button to LISTLABEL type.
* Adds a new helper func, ui_layout_list_set_labels_active, called after the active list item has been "drawn", to set all LISTLABEL buttons as UI_SELECT.

Note custom widget_state_label() was removed, in interface_widgets.c, as it did nothing more than default widget_state().

Thanks to Brecht for the review and advices.
2013-06-26 07:28:55 +00:00
9ae8e4ca1a Fix #35715: graph editor > channels > move.. menu item showed wrong keyboard shortcut. 2013-06-25 12:26:49 +00:00
30a108ddad Fix for expanded enums with icon_only enabled, name of each item was still used to compute its button's size! 2013-06-19 15:08:07 +00:00
69e7fb6091 Fix #35715: incorrect shortcut shown for some menus after recent code refactoring. 2013-06-12 20:47:46 +00:00
3e97e2c8e8 style cleanup 2013-05-31 22:35:25 +00:00