Commit: 6ff89166a8e9b442f912bbcaa4bbaa9e9d9ea01b
Author: Campbell Barton
Date:   Wed Jun 6 09:27:23 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6ff89166a8e9b442f912bbcaa4bbaa9e9d9ea01b

Cleanup: USE_UI_* prefix for UI defines

Otherwise there is no quick way to see where this comes from.

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

M       source/blender/editors/include/UI_interface.h
M       source/blender/editors/interface/interface_handlers.c
M       source/blender/editors/interface/interface_icons.c
M       source/blender/editors/interface/interface_region_popover.c
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 4d1f1350047..b5d59f42b8d 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1244,10 +1244,10 @@ void UI_widgetbase_draw_cache_flush(void);
 void UI_widgetbase_draw_cache_end(void);
 
 /* Special drawing for toolbar, mainly workarounds for inflexible icon sizing. 
*/
-#define USE_TOOLBAR_HACK
+#define USE_UI_TOOLBAR_HACK
 
 /* Support click-drag motion which presses the button and closes a popover 
(like a menu). */
-#define USE_POPOVER_ONCE
+#define USE_UI_POPOVER_ONCE
 
 bool UI_but_is_tool(const uiBut *but);
 
diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 0ebe079703b..aef86e037f8 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -506,7 +506,7 @@ bool ui_but_is_toggle(const uiBut *but)
        );
 }
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
 bool ui_but_is_popover_once_compat(const uiBut *but)
 {
        return (
@@ -8362,7 +8362,7 @@ static int ui_handle_button_event(bContext *C, const 
wmEvent *event, uiBut *but)
                                data->cancel = true;
                                button_activate_state(C, but, 
BUTTON_STATE_EXIT);
                                break;
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
                        case LEFTMOUSE:
                        {
                                if (event->val == KM_RELEASE) {
@@ -9527,7 +9527,7 @@ static int ui_handle_menu_event(
                retval = ui_handle_menu_button(C, event, menu);
        }
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
        if (block->flag & UI_BLOCK_POPOVER_ONCE) {
                if ((event->type == LEFTMOUSE) && (event->val == KM_RELEASE)) {
                        UI_popover_once_clear(menu->popup_create_vars.arg);
diff --git a/source/blender/editors/interface/interface_icons.c 
b/source/blender/editors/interface/interface_icons.c
index 2c813d152e9..c2ada1e3733 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1252,7 +1252,7 @@ static void icon_draw_size(
                /* We need to flush widget base first to ensure correct 
ordering. */
                UI_widgetbase_draw_cache_flush();
 
-#ifdef USE_TOOLBAR_HACK
+#ifdef USE_UI_TOOLBAR_HACK
                /* TODO(campbell): scale icons up for toolbar, we need a way to 
detect larger buttons and do this automatic. */
                {
                        float scale = (float)ICON_DEFAULT_HEIGHT_TOOLBAR / 
(float)ICON_DEFAULT_HEIGHT;
diff --git a/source/blender/editors/interface/interface_region_popover.c 
b/source/blender/editors/interface/interface_region_popover.c
index 9d10713c868..c681cfe776f 100644
--- a/source/blender/editors/interface/interface_region_popover.c
+++ b/source/blender/editors/interface/interface_region_popover.c
@@ -87,7 +87,7 @@ struct uiPopover {
        uiMenuCreateFunc menu_func;
        void *menu_arg;
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
        bool is_once;
 #endif
 };
@@ -136,7 +136,7 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, 
uiPopupBlockHandle *handle, v
        UI_block_region_set(block, handle->region);
        UI_block_layout_resolve(block, &width, &height);
        UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT | 
UI_BLOCK_KEEP_OPEN | UI_BLOCK_POPOVER);
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
        if (pup->is_once) {
                UI_block_flag_enable(block, UI_BLOCK_POPOVER_ONCE);
        }
@@ -231,7 +231,7 @@ uiPopupBlockHandle *ui_popover_panel_create(
        pup->menu_func = menu_func;
        pup->menu_arg = arg;
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
        pup->is_once = true;
 #endif
 
@@ -365,7 +365,7 @@ uiLayout *UI_popover_layout(uiPopover *pup)
        return pup->layout;
 }
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
 void UI_popover_once_clear(uiPopover *pup)
 {
        pup->is_once = false;
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index b20fe3c62dd..eadefc606b3 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2010,7 +2010,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, 
uiWidgetColors *wcol, uiB
 
                /* XXX add way to draw icons at a different size!
                 * Use small icons for popup. */
-#ifdef USE_TOOLBAR_HACK
+#ifdef USE_UI_TOOLBAR_HACK
                const float aspect_orig = but->block->aspect;
                if (is_tool && (but->block->flag & UI_BLOCK_POPOVER)) {
                        but->block->aspect *= 2.0f;
@@ -2021,7 +2021,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, 
uiWidgetColors *wcol, uiB
                int icon_size_init = is_tool ? ICON_DEFAULT_HEIGHT_TOOLBAR : 
ICON_DEFAULT_HEIGHT;
                const float icon_size = icon_size_init / (but->block->aspect / 
UI_DPI_FAC);
 
-#ifdef USE_TOOLBAR_HACK
+#ifdef USE_UI_TOOLBAR_HACK
                if (is_tool) {
                        /* pass (even if its a menu toolbar) */
                        but->drawflag |= UI_BUT_TEXT_LEFT;
@@ -2043,7 +2043,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, 
uiWidgetColors *wcol, uiB
                
                widget_draw_icon(but, icon, alpha, rect, show_menu_icon);
 
-#ifdef USE_TOOLBAR_HACK
+#ifdef USE_UI_TOOLBAR_HACK
                but->block->aspect = aspect_orig;
 #endif
                
@@ -4372,7 +4372,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle 
*style, uiBut *but, rct
        uiFontStyle *fstyle = &style->widget;
        uiWidgetType *wt = NULL;
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
        const rcti rect_orig = *rect;
 #endif
 
@@ -4426,7 +4426,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle 
*style, uiBut *but, rct
                                break;
 
                        case UI_BTYPE_BUT:
-#ifdef USE_TOOLBAR_HACK
+#ifdef USE_UI_TOOLBAR_HACK
                                if (UI_but_is_tool(but)) {
                                        wt = widget_type(UI_WTYPE_TOOLBAR_ITEM);
                                }
@@ -4652,7 +4652,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle 
*style, uiBut *but, rct
                if (disabled)
                        glEnable(GL_BLEND);
 
-#ifdef USE_POPOVER_ONCE
+#ifdef USE_UI_POPOVER_ONCE
                if (but->block->flag & UI_BLOCK_POPOVER_ONCE) {
                        if ((state & UI_ACTIVE) && 
ui_but_is_popover_once_compat(but)) {
                                uiWidgetType wt_back = *wt;

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

Reply via email to