Commit Graph

300 Commits

Author SHA1 Message Date
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
ba767857b8 fix for incorrect use of strncat in uiItemMenuEnumO 2013-05-30 18:42:32 +00:00
d003a08302 Fix stack corruptions in special cases
Issue was caused by wrong array length used
for result of name_uiprefix_id, which shall
actually be 1 byte bugger than MAX_ID_NAME.

Reported by Sebastian Koenig in IRC.
2013-05-23 18:19:50 +00:00
127c39b8a4 Fix for [#35224] Transform Orientation - order inconsistency
Fix turned out to remove as much "manual UI" from 3D view header as possible. Mode selector and all transform manipulators/orientations stuff are now RNA-based UI (leaving basically only edit mesh select modes with custom handlers, as they have some quite specific features).

To achieve this, four main modifications were done:
* enum-operator-generated menus are now MENU (i.e. dropdown lists) in headers too.
* All bit-flag enums expanded in ROW buttons now have a handling consistent with e.g. layers, or what we already have for transform manipulators, i.e. clicking select only one element, shift-click to select multiple ones.
* Consequently, the three RNA booleans manipulators flags are merged into a single bit-flag enum (yes, this is also an API change, though I doubt many scripts use it).
* Now the width of enum-based dropdown lists is computed from longest item name in enum, no more from a dummy place holder string (when no label/name is given).

All this allows to remove some code from 3DView/transform areas, that was actually mostly duplicating RNA/operator one.

Also done a few optimizations here and there (among others, do not pass &numitems to RNA_property_enum_items() when you do not need it, saves at least an iteration over enum items to count them).

Many thanks to Brecht for the reviews!
2013-05-12 13:16:11 +00:00
359edc27d3 style cleanup 2013-05-11 01:06:01 +00:00
00014949c8 Fix #35262: assiging shortcuts from e.g. delete or selection mode menus did not
work anymore. This was due to a bugfix to show missing shortcut keys for e.g. the
mesh > vertices > separate menu. Both should work now.
2013-05-10 23:41:41 +00:00
5c4f96af2c code cleanup: use 'const float[2]' where possible. 2013-05-08 12:54:33 +00:00
91ba6c9ced adjustment to own commit r56463.
when strings use 'PROP_NEVER_NULL' we still want them to show an unlink button.
2013-05-02 21:27:19 +00:00
479b330ac5 don't show an 'X' next to never-null pointer search menus.
also set ShapeKey.relative_key to never-null.
2013-05-02 04:16:41 +00:00
2b2099cd51 Fix #34875: 0 digits of precision was not supported for FloatProperty, now
you can specify precision=0 for this, and use -1 for the default 2.
2013-04-08 18:55:08 +00:00
7bbaf4853a code cleanup: use bools in UI and WM code, quiet some shadow warnings, remove unused function uiEmboss() 2013-04-04 02:05:11 +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
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
7fc79615e0 Any ID Selector Template: ID Type dropdown now shows icon only as originally
intended

Finally, I've figured out a way to get the ID Selector Template to only show the
icon for the type of ID block (i.e. the intended design), instead of icon+text.
This improves the layout a bit, as previously the type selector and ID-block
pointer and label would all be the same sizes (roughly 1/3rd of the overall
width each), which meant that there wasn't much room left to actually see which
datablock had been selected.

Additionally, I've fixed a few more layout types which still didn't correctly
propagate the red-alert flags.
2013-03-16 03:59:03 +00:00
284e59d608 Add the possibility to define the translation context for py rna classes (operators, panels and menus).
Thanks to Campell and Brecht for the reviews!
2013-03-15 14:32:29 +00:00
ac6c218cf4 Invalid Driver Targets are now indicated appropriately (using Red Backgrounds)
in the UI

This is the second part of the fixes for [#32492], making it easier to identify
which part of a driver (i.e. which of its targets) is causing problems

A number of additional/related changes needed to be made:
* Red-alert status for layouts is now propagated down to child layouts when they
are created. This is needed as otherwise some of the templates used in the Graph
Editor driver settings won't actually get the red-alert status flushed down to
them. Also, note that this status needs to be set before any widgets are added
to the layout, or else the settings aren't applied when the relevant widgets get
created.

* "Single Property" RNA-Paths resulting in out of bounds array access will now
trigger an error status and appropriate warnings

TODO:
* The error tagging doesn't get applied immediately after variables are created,
or their types changed
* There was also some other weirdness involved when a higher-value flag (1<<10)
was used for this setting, which needs further attention
2013-02-28 07:13:33 +00:00
2c0a3cf42e fix [#34113] operator_menu_enum() - Tooltip not showing descriptions
second fix from this report which makes the menu show tips even when 'bl_property' isn't set.
2013-02-05 05:39:18 +00:00
a9015e3f7d style cleanup 2013-01-31 21:15:38 +00:00
ba7e37c2b6 Fix #33874: active UV map chooser in uv editor should not have X button as you
can't not have an active UV map.
2013-01-31 13:44:13 +00:00
f93d6758b7 New 'X' icon in search buttons sometimes overlapped text, needs extra space. 2013-01-24 13:02:00 +00:00
350a776a52 fix for arrow keys being reversed in the snap menu (Ctrl+Shift+Tab)
also - when expanding rna enums into existing menus - don't nest inside a row/column.
2013-01-17 01:03:56 +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
8c00c57187 style cleanup: var naming for ui list 2012-12-28 10:32:49 +00:00