Commit Graph

356 Commits

Author SHA1 Message Date
d4c87f2f79 Code cleanup: remove unused button aspect 2014-02-13 09:37:27 +11:00
aea00c7a81 Code cleanup: style 2014-02-13 08:52:12 +11:00
13875564a9 Grr, another UI messages fix, forgot this one! 2014-02-12 17:55:47 +01: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
3432f34d05 UI: report if WM_OT_call_menu uses an unknown menu 2014-02-10 14:17:33 +11:00
05dfd852ec UI: fix for issue in last commit, popups show above the buttons again 2014-02-10 13:44:59 +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
b105d2ac7f UI: replace uiPupMenuOkee & uiPupMenuSaveOver with WM_operator_confirm 2014-02-09 12:32:20 +11:00
873f901e5a UI: improve reports popup
- use labels rather then menu items (items selected but did nothing)
- each report gets its own icon (icons besides first were ignored)
- use uiPupMenu rather then string based menu.
2014-02-09 12:00:03 +11:00
52f080604b Code cleanup: remove unused menu functions 2014-02-09 11:25:32 +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
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
7294c54db0 UI: Resolve T37917, disable tooltip scaling (zoomout only) 2013-12-23 12:46:50 +11:00
9fa7c235f3 Fix for tooltip right side having zero offset 2013-12-23 12:42:46 +11:00
7d2652ad7c User Interface: add colon separator for number buttons 2013-12-11 21:06:00 +11:00
c6620905a7 Tooltips: abbreviate long python operator tooltips
Some tooltips would end up containing long string/array args spanning the screen.
2013-12-09 14:25:03 +11:00
1ed822202f Code Cleanup: pass rectangles as const in insterface files 2013-12-07 15:47:57 +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
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
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
035d86402b Fix: tab completing a filepath name in file browsers asks to create a new
directory if name was not fully matched

When hitting tab to complete a directory name in the filepath field in the
filebrowser Blender shows a "create new directory?" popup, if the beginning
of directory name typed in the field matches many entries. For example if you
have directories in the open directory called "test123" and "test456", typing
"te", tab would complete up to "test", but ask to create a new folder with the
name "test".

This patch unsets the boolean storing the info about changing filepath if the
folder with the completed name does not exist.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D10
2013-11-19 16:42:50 +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
13a21588ae rename UI_OT_eyedropper to UI_OT_eyedropper_color to make way for other kinds of eyedroppers. 2013-10-08 10:52:33 +00:00
3579dfe23a interface, replace '|' with define UI_SEP_CHAR 2013-09-11 05:06:27 +00:00
90ff86a6d9 fix [#36699] ASCII-character "|" blocks parenting
don't split '|' for rna-property search buttons (but keep for operator search).
2013-09-11 04:56:35 +00:00
75a2b5ee35 add attributes to ghash and edgehash functions. 2013-09-01 22:47:44 +00:00
43ab02db14 code cleanup: remove redundant NULL checks 2013-07-31 09:18:40 +00:00
d7ff7ad3e9 correct sloppy NULL checks, in interface code:
- uiPupMenuBegin was checking for NULL title but would still crash if it were NULL.
- now tag the function as 'nonnull' and remove NULL checks. make sure NULL isnt passed to it.
2013-07-27 14:17:20 +00:00
1c15beb6b2 remove NULL checks on fixed size arrays, also was calling BLI_testextensie_glob every time in the file selector with a blank string. 2013-07-13 14:16:59 +00:00
750b30c7dd fix [#36008] Can't set values higher than 1.0 in HSV colour picker (But can in RGB) - also some strange behavior 2013-07-09 04:00:56 +00:00
bf6a74e3fc Bugfix [35841] WM_OT_context_[toggle/cycle/etc.] operators dont show shortcut
keys in menus (or tooltips) for properties they are used to toggle/cycle through

Some properties can be toggled using hotkeys via WM_OT_context_* operators, but
these hotkeys aren't really shown anywhere obvious like other hotkeys (i.e.
they're not shown in tooltips or menus). Although it is possible to look these
up in the userprefs/keymaps editor, it is quite tricky doing so, and most users
would just assume that since no shortcut is displayed, there simply isn't one at
all.

This commit introduces a slightly hacky fix which basically amounts to checking
if a property can be set by any of the few operators which are used for this
purpose. In order to keep this from being too sluggish, I've currently limited
this to only working on Editor (e.g. "Show Seconds" in Anim Editors) and
ToolSettings (e.g. "Use Proportional Edit") properties.

There are still some corner cases that would be nice to solve too (i.e. the
Pivot Type enum menu/dropdown should really be able to show the hotkeys which
have been assigned for each of those items, since they're by-and-large quite
hidden and obscure), though being able to show some of these is perhaps better
than not showing any!
2013-07-07 12:53:15 +00:00
2403a23953 Fix #35802: searchbox menu not opening when opened from a popup near the bottom
of the window.
2013-06-27 14:30:26 +00:00
b7ca8cef35 Fix #35880: popup menus like F6 redo did not use the right theme color for
highlighted text, it should use the UI instead of 3D view color.
2013-06-26 12:24:36 +00:00
9d4cc7885d fix for filesel autocomplete, it had the annoying behavior if you entered in a non-existing name, of executing it and then asking to add the dir. 2013-06-19 11:53:48 +00:00
8eb6b954fd internal change to searchbox: store the active search index rather then index + 1, simplifies checks. 2013-06-13 01:13:26 +00:00
860fce4eb9 Code cleanup: removed some unused UI button types
* CHARTAB: not needed anymore with improved copy/paste support and text input.
* IDPOIN: replaced by SEARCH_MENU.
* ICONROW/ICONTEXTROW: replaced by RNA enums.
* NUMABS: can use min/max limits instead.
* BUT_TOGDUAL, TOG3, TOGR, SLI: not used in 2.5 interface.
2013-06-09 18:05:50 +00:00
0123c7d2be This commit replaces old "manual" Editors menu with nice RNA-based one (so once again, some cleanup of old UI code). It makes the following changes:
* RNA's editor types enum (space_type_items) has been re-ordered, added icons, and removed internal-only SPACE_EMPTY value, so that it matches the menu.

* Two fixes in code drawing enums as dropdown menu:
** All items were taken into account when computing the number of needed columns, now simple separators (void string items) are ignored.
** Simple separators items were drawn as labels, taking far too much space!

And now translators will be free from that ugly, insane menu-string! :P

Thanks to Brecht for the review.
2013-06-09 16:18:23 +00:00
2d4a682a8e add popup menu to allow python scripts to show popups without having to define a menu class first. 2013-06-01 04:06:38 +00:00
10474c324d Fix #35342: multisample antialiasing makes tooltips look blurry. 2013-05-13 13:45:45 +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
cda9407177 Bug fix #35307
Popup menus in nodes, with nodes outside window boundary, were clipped very badly, even
causing it to fill entire window.

Now the clip code nicely translates the menu horizontally to be in view.
2013-05-11 15:29:57 +00:00
d5b36bf027 fix [#35178] Autoselect-in-list for Vertex Group selection doesn't work.
disallow assigning values that don't exist into a text field with a search-box.
2013-05-02 04:59:52 +00:00
e5a968276e fix [#35055] Crash in Edit Source feature for multilevel menus
dont show the option when operating on a menu since its not supported.
2013-04-23 15:22:22 +00:00
0d14a1414c fix for UI annoyance with popups (such as new image popup) opening their menus to the right of the button. 2013-04-22 22:32:42 +00:00
Lukas Toenne
0b0abfe6fb Fix for #35015, Alpha input in color selectors was showing 0 precision. Probably caused by r55910. The NUMSLI button now needs either -1 or an explicit precision value in a2. 2013-04-18 12:43:30 +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
677172fd65 code cleanup: use bools in interface handlers, dont show translation menu when right clicking on splash, use less confusing args for copy/paste function. 2013-04-04 15:16:29 +00:00
2804caff4c code cleanup: use bools, (float)sin/(float)cos -> sinf/cosf, more meaningful var names. 2013-04-04 04:22:38 +00:00