Commit: 6355d98267963984160b7cae212d0353b6846a7d
Author: Campbell Barton
Date:   Fri Nov 3 00:22:59 2017 +1100
Branches: master
https://developer.blender.org/rB6355d98267963984160b7cae212d0353b6846a7d

UI: free up bit in uiBut.flag

===================================================================

M       source/blender/editors/include/UI_interface.h
M       source/blender/editors/interface/interface_intern.h
M       source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index a4720aa8b83..1482937d6a0 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -155,7 +155,7 @@ enum {
 
 /* but->flag - general state flags. */
 enum {
-       /* warning, the first 6 flags are internal */
+       /* warning, the first 5 flags are internal */
        UI_BUT_ICON_SUBMENU    = (1 << 6),
        UI_BUT_ICON_PREVIEW    = (1 << 7),
 
diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index da11c2abab2..7ee18549342 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -118,8 +118,7 @@ enum {
        UI_SCROLLED     = (1 << 1),  /* temp hidden, scrolled away */
        UI_ACTIVE       = (1 << 2),
        UI_HAS_ICON     = (1 << 3),
-       UI_TEXTINPUT    = (1 << 4),
-       UI_HIDDEN       = (1 << 5),
+       UI_HIDDEN       = (1 << 4),
        /* warn: rest of uiBut->flag in UI_interface.h */
 };
 
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 79571e24a4b..9c80b30100d 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -67,14 +67,16 @@
 #define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect))
 
 #define UI_BUT_FLAGS_PUBLIC \
-       (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_TEXTINPUT | 
UI_HIDDEN)
+       (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_HIDDEN)
 
-/* Bits 0..5 are from UI_SELECT .. etc */
+/* Don't overlap w/ UI_BUT_FLAGS_PUBLIC buts. */
 enum {
        /* Show that holding the button opens a menu. */
        UI_STATE_HOLD_ACTION = (1 << 6),
+       UI_STATE_TEXT_INPUT   = (1 << 7),
 };
 
+
 /* ************** widget base functions ************** */
 /**
  * - in: roundbox codes for corner types and radius
@@ -1984,7 +1986,7 @@ static void widget_state(uiWidgetType *wt, int state)
 {
        uiWidgetStateColors *wcol_state = wt->wcol_state;
 
-       if ((state & UI_BUT_LIST_ITEM) && !(state & UI_TEXTINPUT)) {
+       if ((state & UI_BUT_LIST_ITEM) && !(state & UI_STATE_TEXT_INPUT)) {
                /* Override default widget's colors. */
                bTheme *btheme = UI_GetTheme();
                wt->wcol_theme = &btheme->tui.wcol_list_item;
@@ -2678,14 +2680,14 @@ static void widget_numbut_draw(uiWidgetColors *wcol, 
rcti *rect, int state, int
        }
 
        /* decoration */
-       if (!(state & UI_TEXTINPUT)) {
+       if (!(state & UI_STATE_TEXT_INPUT)) {
                shape_preset_init_number_arrows(&wtb.tria1, rect, 0.6f, 'l');
                shape_preset_init_number_arrows(&wtb.tria2, rect, 0.6f, 'r');
        }
 
        widgetbase_draw(&wtb, wcol);
        
-       if (!(state & UI_TEXTINPUT)) {
+       if (!(state & UI_STATE_TEXT_INPUT)) {
                /* text space */
                rect->xmin += textofs;
                rect->xmax -= textofs;
@@ -2964,7 +2966,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors 
*wcol, rcti *rect, int s
        widgetbase_draw(&wtb, wcol);
        
        /* draw left/right parts only when not in text editing */
-       if (!(state & UI_TEXTINPUT)) {
+       if (!(state & UI_STATE_TEXT_INPUT)) {
                int roundboxalign_slider;
                
                /* slider part */
@@ -3015,7 +3017,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors 
*wcol, rcti *rect, int s
        widgetbase_draw(&wtb, wcol);
 
        /* add space at either side of the button so text aligns with 
numbuttons (which have arrow icons) */
-       if (!(state & UI_TEXTINPUT)) {
+       if (!(state & UI_STATE_TEXT_INPUT)) {
                rect->xmax -= toffs;
                rect->xmin += toffs;
        }
@@ -3910,7 +3912,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle 
*style, uiBut *but, rct
                if ((but->editstr) ||
                    (UNLIKELY(but->flag & UI_BUT_DRAG_MULTI) && 
ui_but_drag_multi_edit_get(but)))
                {
-                       state |= UI_TEXTINPUT;
+                       state |= UI_STATE_TEXT_INPUT;
                }
 
                if (but->hold_func) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to