UI: popover now use menu style buttons
authorCampbell Barton <ideasman42@gmail.com>
Sun, 22 Apr 2018 16:39:29 +0000 (18:39 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 22 Apr 2018 16:39:29 +0000 (18:39 +0200)
Also scale width with UI-scale.

source/blender/editors/interface/interface_region_popover.c
source/blender/editors/interface/interface_widgets.c

index 035efb368a692f4608b2114ccc7eca987d310963..1f5143981b20aa9e06629b1b698bae2a4b3dfa02 100644 (file)
@@ -162,7 +162,8 @@ uiPopupBlockHandle *ui_popover_panel_create(
        pup = MEM_callocN(sizeof(uiPopover), __func__);
        pup->block = UI_block_begin(C, NULL, __func__, UI_EMBOSS);
        UI_block_emboss_set(pup->block, UI_EMBOSS);
-       pup->layout = UI_block_layout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 0, MENU_PADDING, style);
+       pup->layout = UI_block_layout(
+               pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, U.widget_unit * 10, 0, MENU_PADDING, style);
        pup->slideout = false; // but ? ui_block_is_menu(but->block) : false;
        pup->but = but;
        uiLayoutSetOperatorContext(pup->layout, WM_OP_INVOKE_REGION_WIN);
index f1b1ef44befeefc2da4d45800690dacc47f82a0e..ea4dc831ac224b7a0ab18b390bbc4e0ebcb8606b 100644 (file)
@@ -4266,7 +4266,11 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
                                        }
                                }
                                break;
-                               
+
+                       case UI_BTYPE_POPOVER:
+                               wt = widget_type(UI_WTYPE_PULLDOWN);
+                               break;
+
                        case UI_BTYPE_PULLDOWN:
                                wt = widget_type(UI_WTYPE_PULLDOWN);
                                break;