Commit Graph

387 Commits

Author SHA1 Message Date
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
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
a26c048fde Fix uiList labels themed colors.
r57760 broke usual labels, and r59511 broke again uiList labels! :P Hopefully every one works as expected now!
2013-08-26 12:32:46 +00:00
aa6eac3aad Bugfix #36324
Commit 57760, June this year, broke Theme colors for Label Buttons.
All labels, in every editor or region, now were using same color.

These colors have to be derived from the Editor settings. Code for
this was mistakingly removed.
2013-08-26 09:59:51 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
a926d9a0d4 code cleanup: remove redundant multiplying when jittering widget drawing. 2013-07-19 10:40:01 +00:00
a15ac6ee09 code cleanup: use bool for widget struct, also edit odd strncpy use. 2013-07-19 10:39:44 +00:00
af36eb86e2 Further fix for #35880: theme color of enabled option buttons in popups was still
controlled by the wrong color, now it's controlled by "Menu Back" text color. This
is somewhat confusing but we like some other widgets the standard colors do not
work well on the dark background of popups.
2013-06-26 20:28:12 +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
c88ea1c4f8 Made blender compilable with strict flags. 2013-06-18 10:09:45 +00:00
943388183d Added back left/right arrows for embossed number fields. (they where active but not drawn) 2013-06-18 09:02:13 +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
9e05f6571f Make sure bool will always have the same size in C and C++
There were an issues with data structures defined in headers
and being used by both C and C++ on systems with stdbool
unavailable.

This happened because bool in this case will be defined as
unsigned int, which is 4 bytes. But C++'s bool is only 1
byte and this lead to alignment issues.

Now bool is always 1 byte, also made sure there's no situation
like bool foo = BitField & BitFlag, which could give overflow
issues. Use (BitField & BitFlag) != 0 instead.

Fixes #35553: Compositor broken (Backdrop & Preview)
2013-05-29 11:49:39 +00:00
38391d9a7d Fix #35281: search menu buttons (with an X on the right side to clear) had text
overlapping the X icon if the text was long.
2013-05-10 20:34:35 +00:00
a63be29da3 Fix #35252: Crash with the node placed partially behind the screen
Issue was caused by negative maximal possible text width happening
in label clipping.

Solved by clamping width to 0 if it's negative.
2013-05-08 13:16:39 +00:00
fdc4eea188 use smaller size for uiWidgetTrias.vec 2013-05-08 12:56:11 +00:00
f9ed2bf9e9 use const vars for UI arrays. 2013-04-30 01:51:25 +00:00
a4a2949309 Bug fix:
Labels in UI were not drawing greyed out when disabled.
Bug in post 2.66a commit to make greying out buttons draw much nicer.

User reported Addon menu was not clearly showing disabled Addons anymore.
2013-04-29 08:45:39 +00:00
8069d1ad1a "Bug" & usability fix, own collection.
Color Pickers in Blender support precision editing with holding Shift key.
Unfortunately, on first click the picker cursor moves to the mouse position,
making the precision dragging quite useless.

Now, if you hold Shift, the picker editing will only apply the delta motion
of your mouse drags, making it much nicer for fine tuning of color grades
in Sequencer or Compositor.
2013-04-27 12:54:45 +00:00
093f95afaa Bug fix #34868
Pulldown menus with long shortcut text labels got clipped badly occasionally.
Made the offset follow DPI better.
2013-04-18 08:51:07 +00:00