[Bf-blender-cvs] [9971eb4437a] blender2.8: Cleanup: includes & comments

Campbell Barton noreply at git.blender.org
Mon Apr 23 08:53:03 CEST 2018


Commit: 9971eb4437acc0eeeed24f3975c3352599271f2a
Author: Campbell Barton
Date:   Mon Apr 23 08:09:47 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9971eb4437acc0eeeed24f3975c3352599271f2a

Cleanup: includes & comments

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

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

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

diff --git a/source/blender/editors/interface/interface_region_popover.c b/source/blender/editors/interface/interface_region_popover.c
index 0b3fcff886a..ff87770655e 100644
--- a/source/blender/editors/interface/interface_region_popover.c
+++ b/source/blender/editors/interface/interface_region_popover.c
@@ -36,7 +36,7 @@
  * - UI is not constrained to a list.
  * - Pressing a button won't close the pop-over.
  * - Different draw style (to show this is has different behavior from a menu).
- * - #PanelType are used insetead of #MenuType.
+ * - #PanelType are used instead of #MenuType.
  * - No menu flipping support.
  * - No moving the menu to fit the mouse cursor.
  * - No key accelerators to access menu items
@@ -46,38 +46,23 @@
  * - No title.
  */
 
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
 #include "MEM_guardedalloc.h"
 
 #include "DNA_userdef_types.h"
 
-#include "BLI_math.h"
 #include "BLI_listbase.h"
 
-#include "BLI_string.h"
 #include "BLI_rect.h"
 #include "BLI_utildefines.h"
-#include "BLI_ghash.h"
 
 #include "BKE_context.h"
-#include "BKE_screen.h"
-#include "BKE_report.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "RNA_access.h"
 
 #include "UI_interface.h"
 
-#include "BLT_translation.h"
-
-#include "ED_screen.h"
-
 #include "interface_intern.h"
 #include "interface_regions_intern.h"
 
@@ -221,7 +206,9 @@ uiPopover *UI_popover_begin_ex(bContext *C, const char *block_name)
 	uiPopover *pup = MEM_callocN(sizeof(uiPopover), "popover menu");
 
 	pup->block = UI_block_begin(C, NULL, block_name, 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 * UI_POPOVER_WIDTH_UNITS, 0, MENU_PADDING, style);
 
 	/* Copied from menus, change if needed. */
 	uiLayoutSetOperatorContext(pup->layout, WM_OP_EXEC_REGION_WIN);
@@ -282,6 +269,6 @@ uiLayout *UI_popover_layout(uiPopover *pup)
 
 /** \} */
 
-/* We may want to support this in futurew */
+/* We may want to support this in future */
 /* Similar to UI_popup_menu_invoke */
 // int UI_popover_panel_invoke(bContext *C, const char *idname, ReportList *reports);



More information about the Bf-blender-cvs mailing list