Commit Graph

356 Commits

Author SHA1 Message Date
33f51abe4e Better fix for T37545.
This was supposed to fix inaccuracies between S-H wheel but it makes the
colors selected through the SV-H color cube wrong (see http://
%28SV-H%29-Inaccurate). Instead of deactivating color management for SV
and H widgets just reenable correction for the Hue wheel. This is wrong
because HSV always refers to display space and we -have- to account for
that when using linear color RNA properties.
2014-03-14 01:42:50 +02:00
4fa93b1ea4 Code cleanup (tm): Some code deduplication for HSL 2014-03-12 19:12:58 +02:00
bce924b43c HSL color wheel implementation.
This is a standard Hue - Saturation - Lightness model
(see for instance entry on wikipedia here: https://en.wikipedia.org/wiki/HSL_and_HSV)
Note though the difference between HSV and HSL saturation, which are not the same.

The advantage of having this color selection scheme is that artists can select
shades and tints of a color easily by using the lightness slider. Also colors
are arranged on (approximated) perceived lightness on the color wheel.

Beware, Old files opened with this preference saved will crash!

Reviewers: sergey, brecht, campbellbarton

Differential Revision: https://developer.blender.org/D385
2014-03-12 18:58:50 +02: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
118d86aa73 UI: avoid for divide by zero for icon buttons (no need to clip text) 2014-02-27 18:30:06 +11:00
c35ac8f7ac Fix T38678: Long strings on Search widget not getting shortened/no tooltip.
Note this commit only makes search menus wider and adds shortening to their strings.
Adding tooltips here is not trivial, would need much bigger changes...

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D341
2014-02-26 21:53:56 +01:00
d0ec83c1a2 Fix T38809: regression, text cursor offset in number buttons
Use the same offset for all edit-buttons now.
2014-02-25 10:31:04 +11:00
002b2c1541 MSVC: resolve utf8 encoding issue with some codepages 2014-02-23 14:38:27 +11:00
1df068c39a UI: Fix for rna-enum submenus not showing a right arrow 2014-02-20 13:30:52 +11:00
d4c87f2f79 Code cleanup: remove unused button aspect 2014-02-13 09:37:27 +11:00
7e300ed3a1 UI: change to give sliders more text space, messes with alignment 2014-02-12 02:46:43 +11:00
d2b5f0f6c2 UI: fix own error, dont add slider pad when neither sides align 2014-02-11 03:38:48 +11:00
127330d6ca UI: multi-drag number button editing
clicking and dragging down edits multiple number buttons at once. (patch D270)
2014-02-08 09:42:26 +11:00
fed1b8b16d Code cleanup: suffix vars to make obvious they are squared 2014-02-03 02:46:45 +11:00
abf18033f3 Fix T38383: glitch drawing inactive slider 2014-01-29 04:10:39 +11:00
44855f9ef2 Code Cleanup: remove redundant NULL checks and add function attributes 2014-01-20 11:13:53 +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
1914d804cf Fix T38083: submenu arrow is overlayed by menu hotkey 2014-01-10 02:25:49 +11:00
7bcb34e59b Fix T38131: node link buttons (like for cycles in material properties) were not
giving correct colors with theme menu colors set to bright values.

Thanks to Denis Declara for finding the cause of this bug.
2014-01-08 20:41:38 +01:00
e87095fa5d Cleanup: silence warnings. 2014-01-07 14:53:32 +01:00
256a069987 Middle-clip tweaks:
* Now only middle-clip when both left and right parts of remaining strings are at least two times icon-width (thus most short labels will never be middle-clipped).
* Add a trailing ellipsis to right-clipped strings (unless it would take more than 20% of whole available width, in this case just clip chars, to keep as much data visible as possible!).
2014-01-07 14:53:32 +01:00
0074eac1ed More tweaks to clip middle:
* Do not apply margins with MENU (i.e. dropdowns) either.
* When middle clipping would remove only a few chars, rather clip right part!
2014-01-04 16:50:42 +01:00
76d9244843 Fix core issue with clipping labels (labels have no margins, so border should be 0 in this case!). 2014-01-04 16:18:08 +01:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
56a531eb29 Fix T38043: Text clipping when it shouldn't
Tweak some more 'middle clipping' (zoom issues).
2014-01-03 15:49:07 +01:00
f489e0c14c Code Cleanup: remove strlen() and unneeded include in recent commit
also fix for incorrect sizeof() use.
2014-01-03 19:40:29 +11:00
3c6b5b72a4 Add a new "shortening process" for UI string drawing, which keeps both right and left parts
of the drawstr and replaces the middle by '...'

Rationnal:
It's usually easier to figure out what a troncated string means if you have both its start and end parts.

Details:
It currently affects all UI items (text fields, buttons, labels...).
Only exceptions are buttons inside menus, text fields & co being edited, and numbuttons/sliders.
Note that some static texts (like panels' titles or items in outliner) do not use usual UI items,
and just draw the whole text, using OpenGL to clip it. Will make another patch to fix this.

Reviewers: campbellbarton, brecht, carter2422, #user_interface

Reviewed by: brecht, carter2422

CC: billrey

Differential Revision: https://developer.blender.org/D114
2014-01-01 11:58:45 +01:00
8901701808 UI: Display alpha checkers in image info's color swatch. 2013-12-24 17:20:37 +11:00
dce82591a7 Fix T37830: UILists text now right align.
Simply check for non-embossed TEX buttons inside uiList items, and align their text like labels do.
2013-12-19 09:34:53 +01:00
d963bdf7d9 UI: more fixes for text clipping
Were still cases where numbers could be clipped incorrectly and icon
size was accounted for twice when left clipping (error in own recent commit).
2013-12-18 17:13:58 +11:00
d41b2bb25f Fix issue with right aligned number buttons overlapping the label
This also simplifies button clipping which was attempting to detect
offsets that were applied afterwards,
Now apply text clipping after adjusting the button rect margins.
2013-12-18 07:18:28 +11:00
305fc82541 UI: don't attempt to draw with the menu-key when only drawing right aligned 2013-12-17 13:11:31 +11:00
09b4954d2d UI: use BLF_width_to_strlen for efficient text clipping 2013-12-16 22:00:30 +11:00
51b9d85b09 UI: remove text margin when a slider is aligned to another button
Paint sliders had too much space on right (aligned with pressure icons)
2013-12-13 05:29:54 +11:00
9ad88fbe6d Fix for error exposed by right-align number buttons
When the entire label was clipped, the right aligned number component
could be clipped on its left hand side too.
So "Foo: 1.00" could be clipped to ".00"
2013-12-13 02:47:00 +11:00
dde5e5ce25 User Interface: Align number buttons labels to the left, number right 2013-12-11 21:27:13 +11:00
8e94d3685a Interface: avoid setting \0 to drawstr in widget_draw_text 2013-12-11 20:35:28 +11:00
1ed822202f Code Cleanup: pass rectangles as const in insterface files 2013-12-07 15:47:57 +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
ac38f2584f Code Cleanup: replace ABS() with fabsf() when used with float expressions. 2013-12-01 13:11:12 +11:00
cd4fd50562 Remove some extraneous glEnableClientState/glDisableClientState. This
part of the code is not interleaved with immediate mode drawing so they
are not necessary.
2013-11-29 21:38:01 +02:00
91a24654dd Code Cleanup: whitespace / formatting 2013-11-24 15:23:38 +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
2b2c03aa7c fix for UI glitch with HSVCUBE color picker, color was noticeably not very smooth or aligned.
- HSV values need to be shifted.
- drawing the quads wasnt aligned well to colors.
2013-10-25 23:50:55 +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
3579dfe23a interface, replace '|' with define UI_SEP_CHAR 2013-09-11 05:06:27 +00:00