Commit Graph

634 Commits

Author SHA1 Message Date
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
b8e8c0e325 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
53d655a0b3 Cleanup: use typed unsigned ints 2019-01-04 11:06:44 +11:00
54a4c1cf35 UI: refactor layout vars out of uiFontStyle
Word wrap and alignment layout args only used by UI_fontstyle_draw
were vars in uiFontStyle.
These were written to before drawing, so better pass as an argument.

Pass uiFontStyle & uiWidgetColors as const args.
2019-01-04 11:00:48 +11:00
Harley Acheson
4f98266cf6 UI: fix display of menu buttons without text and icon, and only a down arrow.
Differential Revision: https://developer.blender.org/D4123
2018-12-27 14:21:49 +01:00
c7cc97c7b9 Fix wrong color in center of HSV circle picker, after recent changes. 2018-12-14 17:29:41 +01:00
6601a89650 Fix T58549, T56741: HSV color picker issues with Filmic view transform.
In 2d655d3 the color picker was changed to use display space HSV values.
This works ok for a simple sRGB EOTF, but fails with view transforms like
Filmic where display space V 1.0 maps to RGB 16.292.

Instead we now use the color_picking role from the OCIO config when
converting from RGB to HSV in the color picker. This role is set to sRGB
in the default OCIO config.

This color space fits the following requirements:

* It is approximately perceptually linear, so that the HSV numbers and
  the HSV cube/circle have an intuitive distribution.
* It has the same gamut as the scene linear color space.
* Color picking values 0..1 map to scene linear values in the 0..1 range,
  so that picked albedo values are energy conserving.
2018-12-13 19:25:45 +01:00
c7ec1fa5e6 Cleanup: use BKE_object_* prefix for object API
Also minor style cleanup.
2018-12-11 15:09:09 +11:00
e79bb957fc User Interface: Add button color for indicating that the value differs from the interpolated one
One issue that especially newer users often run into is that they accidentally reset changes to the scene by switching frame without creating a keyframe first.

Therefore, this commit adds a new color that is used to draw properties if their current value differs from the one that would be set when switching to this frame.
This works both for existing keyframes as well as for currently interpolated frames.

Unfortunately the flags in but->flag are full, so I had to move the new flag to but->drawflag and pass that to all relevant functions.

I went with orange for the color since afaics it fits with the green and yellow that are currently used for keyframe states and since it's somewhat reddish to signify that there might be something to look out for here.

Reviewers: campbellbarton, #user_interface, brecht

Reviewed By: campbellbarton

Subscribers: brecht, predoe

Differential Revision: https://developer.blender.org/D3949
2018-12-08 18:06:23 +01:00
Julian Eisel
5e5db7db89 UI: Disable font shadow in tabs
This was used to fake a 3D look, however that doesn't work well with the new,
flat style. It just made text appear blurry.
2018-11-25 18:35:48 +01:00
0a3cf08364 Keymaps: take into account DPI for tweak/drag/pie thresholds.
The intention is to fix a too low default threshold on high DPI screen.
Users with high DPI screens that have increased the threshold to fix this
or liked the lower threshold will need to lower it again.

This is still somewhat of a guess, ideally this would be based on the
physical distance travalled, and maybe different per type of input device.
However we do not have access to this information, and hope this gives a
better default.
2018-11-21 19:31:20 +01:00
1e8a2e1a10 UI: support red alert on labels, not just buttons. 2018-11-01 19:43:46 +01:00
b5667c2ca7 UI: allow off/on icons to be in reverse order.
The same icons are reused for "hide" and "show" properties, which need
to be in reverse order compared to each other.
2018-10-29 19:04:07 +01:00
b2d495c2de UI: move reports / job back to status bar, but make it more visible with color. 2018-10-19 17:19:03 +02:00
Harley Acheson
90d1d39a95 UI: fix misaligned underline for menu item shortcut keys. 2018-10-16 20:31:42 +02:00
Harley Acheson
dd199d8032 UI: tweak icon spacing in menus to put them in the middle of the edge and text. 2018-10-16 20:31:03 +02:00
45477efd0e UI: increase spacing between icon and text.
To avoid the icon and text blending together too much, which happens with
the new monochrome and slightly bigger icons.
2018-10-11 14:20:25 +02:00
3f93091e8b UI: reduce greying out of icons in radio and toggle buttons.
With the monochrome icons this reduced the contrast too much.
2018-10-09 23:05:43 +02:00
e7218e7049 Cleanup: naming
- immAttrib*    -> immAttr*
- immSkipAttrib -> immAttrSkip

Term 'attr' is a convention for GPU module.
2018-10-09 11:01:50 +11:00
9c09998530 UI strings: Fix asserts in 'middle-splitting' fitting string code.
The problem is that string width computing is performed in integers
(pixels), which can generate a rather annoying error (a few pixels)...
Simply work around that for now, by trimming an extra middle char when
needed.
2018-10-03 16:24:35 +02:00
fb60fb055d Improvements to internals blf_font's blf_font_width_to_strlen()/to_rstrlen()
`to_strlen` just benefits from using pre-computed kerning table for
ascii chars (gives about 30% speed improvements).

`to_rstrlen` was re-written and heavily simplified, basically using same
logic as `to_strlen`, and `BLI_str_find_prev_char_utf8()` to loop
backward in the string, instead of looping forwards the whole string,
storing each gliph's width in temp array, and looping backward on that
temp array to find final string matching expected width. Gives about 70%
speed improvements!

And both functions can now share their core logic.
2018-10-03 16:24:35 +02:00
832f5d36e5 UI: Color the inside of pie menu items when selected
Follows the same as other selected/active items in the UI.
Tested in Default theme, 2.7x, 2.4x, Flatty Light and Amaranth
all seem to work fine.
2018-10-01 15:28:47 +02:00
8ee4fd0bdf Cleanup: style 2018-10-01 09:20:31 +10:00
28324143c4 UI: draw mono icons with button type text color, instead of area text color. 2018-09-27 18:39:50 +02:00
265b5238de Merge branch 'master' into blender2.8 2018-09-12 16:21:00 +10:00
a8c924423e Cleanup: remove alpha_check variable from DNA
Just pass as an argument.
2018-09-12 15:48:00 +10:00
8eedccb3f5 Fix T56752: Tooltip flicker alpha on redraw 2018-09-11 22:11:15 +02:00
0117a4c351 Cleanup: use UI_ prefix for block flag 2018-09-11 15:08:08 +10:00
c317a21a4c Cleanup: replace magic number 2018-09-11 14:31:19 +10:00
15bab56fbc Merge branch 'master' into blender2.8 2018-09-11 11:02:37 +10:00
5bb11cfde2 UI: split theme draw style into separate field
Was using UI_BLOCK_LOOP to control draw style,
this meant we couldn't use popup theme colors for cases
where it the interface has the same purpose as a popup but happens
not to use this flag.
2018-09-11 10:56:08 +10:00
a3c9f4de70 Cleanup: remove unused basic shader, we use many specialized shaders now. 2018-08-14 19:57:58 +02:00
771973869d Fix assert in UI string trimming code when we have 'protected' right part. 2018-08-02 16:39:15 +02:00
31fcd40efd Cleanup: use static variables 2018-07-31 20:45:43 +10:00
8cd7828792 GWN: Port to GPU module: Replace GWN prefix by GPU 2018-07-18 11:49:15 +02:00
57ab7daa2a GPU_matrix: use Blender's naming conventions
Thanks to @sergey for review
2018-07-15 15:34:13 +02:00
09431033e9 Cleanup: split GPU_batch
Split out presets and utilities for creating batches.
These functions are quite specialized and not related to typical usage.
2018-07-15 10:51:49 +02:00
804205babe Cleanup: rename 'ct' to 'len' for gawain 2018-07-08 13:05:41 +02:00
6d72d3c862 Cleanup: abbreviate unsigned types (editors, wm) 2018-07-08 12:49:36 +02:00
Julian Eisel
29b8adec61 UI: Add extra padding to menus to draw sub-menu triangles in
Shortcut strings would be offset to the left to make space for the triangles,
breaking the alignment with other shortcut strings. Now this alignment is kept
by making menus slightly wider if there's a sub-menu triangle visible, making
room for the triangle.
2018-07-06 19:33:13 +02:00
Julian Eisel
2a199f5093 UI: Use flat triangle drawing for indicating submenus
Left the RIGHTARROW_THIN icon in, even though it's not used in C code anymore.
However add-ons may do (e.g. Amaranth does).
2018-07-06 19:33:13 +02:00
3da1207b48 UI: draw search popups with menu background, instead of box.
Otherwise these are not visible well with the new dark theme.
2018-07-06 14:19:11 +02:00
a8b5658437 UI: Node Link Menu to use same colors as regular menus
Node link menus (like shader settings in Material properties) used a slightly
brighter variant of the menu widget. Making it hard to style and match the rest.

Make it use widget_menuiconbut, which is just the menu widget with an icon and no arrows.

Thanks Brecht for the help!
2018-07-04 18:00:12 +02:00
16878072a4 T55441: Pop-over large arrow offset when wide 2018-07-03 19:40:21 +02:00
c50e1216a6 Fix dimmed shortcut key display issues in toolbar menu and color picker.
Draw with alpha * 0.5 instead of using item them color, this doesn't work
well in the toolbar menu and highlighted menu items otherwise.
2018-07-03 13:08:25 +02:00
Julian Eisel
be5482ba2f UI: Dim color of shortcut label in menus and toolbar
The shortcut labels now use the "Item" theme color. Its contrast for hovered
items is a bit low, but not too bad.

Note that this also changes the color of the little toolbar triangle to be grey
(the same color we use for the keymap label). IMHO that looks better though.
This doesn't update any themes other than the default one.

Part of T54711.
2018-07-03 00:54:46 +02:00
37994e0af2 Merge branch 'master' into blender2.8 2018-07-01 20:15:21 +02:00
26c5a1c301 Cleanup: right shift in interface code 2018-07-01 20:12:07 +02:00
f3065ed365 Merge branch 'master' into blender2.8 2018-06-28 10:50:04 +02:00