diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-02 16:31:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-02 16:31:47 +0300 |
commit | 7eb4ef6cacbb4cf0fbc2ff01d2e1a5fa133072cf (patch) | |
tree | 39df21ec691f7c00fcc357303bdd6dbb72a15eb7 /source/blender/editors | |
parent | 90788adb665ae0b011a0cbc668c3fcfd0cb5f24b (diff) | |
parent | 6355d98267963984160b7cae212d0353b6846a7d (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 18 |
3 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index efa5328fc71..8d5807660f8 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 983653675d6..cbe8fb75d61 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -119,8 +119,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 f419ab2d1ed..eddff59257b 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 @@ -2037,7 +2039,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; @@ -2772,14 +2774,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; @@ -3066,7 +3068,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 */ @@ -3117,7 +3119,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; } @@ -4069,7 +4071,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) { |