[Bf-blender-cvs] [0bbc97b63ae] temp-tab_drag_drop: Merge branch 'topbar' into temp-tab_drag_drop
Julian Eisel
noreply at git.blender.org
Sun May 13 14:57:18 CEST 2018
Commit: 0bbc97b63ae9e71890089ff0c3da02eb8ddfdea3
Author: Julian Eisel
Date: Sat May 12 15:36:59 2018 +0200
Branches: temp-tab_drag_drop
https://developer.blender.org/rB0bbc97b63ae9e71890089ff0c3da02eb8ddfdea3
Merge branch 'topbar' into temp-tab_drag_drop
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_screen.h
index 3fee98bd60f,36708cb11a4..273c424e624
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@@ -58,9 -58,7 +58,10 @@@ struct wmWindowManager
struct WorkSpace;
struct GPUFXSettings;
struct wmMsgBus;
+ struct ScrAreaMap;
+struct uiBlock;
+struct uiButtonGroup;
+struct uiButtonGroupItemInfo;
#include "BLI_compiler_attrs.h"
diff --cc source/blender/editors/interface/interface_templates.c
index f3f8a5d2ec3,ca00fb325da..3c53b4f411b
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@@ -991,14 -809,35 +991,15 @@@ static void template_ID_tabs
bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag,
const char *newop, const char *UNUSED(openop), const char *unlinkop)
{
- const ARegion *region = CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
const PointerRNA active_ptr = RNA_property_pointer_get(&template->ptr, template->prop);
const int but_align = (region->alignment == RGN_ALIGN_TOP) ? UI_BUT_ALIGN_DOWN : UI_BUT_ALIGN_TOP;
+ wmOperatorType *unlink_ot = WM_operatortype_find(unlinkop, false);
+ const int but_height = UI_UNIT_Y * 1.1;
uiBlock *block = uiLayoutGetBlock(layout);
- uiStyle *style = UI_style_get_dpi();
-
- for (ID *id = template->idlb->first; id; id = id->next) {
- wmOperatorType *unlink_ot = WM_operatortype_find(unlinkop, false);
- const bool is_active = active_ptr.data == id;
- const unsigned int but_width = UI_fontstyle_string_width(&style->widgetlabel, id->name + 2) + UI_UNIT_X +
- (is_active ? ICON_DEFAULT_WIDTH_SCALE : 0);
- uiButTab *tab;
-
- tab = (uiButTab *)uiDefButR_prop(
- block, UI_BTYPE_TAB, 0, "", 0, 0, but_width, UI_UNIT_Y * 1.1,
- &template->ptr, template->prop, 0, 0.0f,
- sizeof(id->name) - 2, 0.0f, 0.0f, "");
- UI_but_funcN_set(&tab->but, template_ID_set_property_cb, MEM_dupallocN(template), id);
- tab->but.custom_data = (void *)id;
- tab->unlink_ot = unlink_ot;
-
- if (is_active) {
- UI_but_flag_enable(&tab->but, UI_BUT_VALUE_CLEAR);
- }
- UI_but_drawflag_enable(&tab->but, but_align);
- }
+ ui_template_sortable_id_tabs(region, block, template, unlink_ot);
if (flag & UI_ID_ADD_NEW) {
const bool editable = RNA_property_editable(&template->ptr, template->prop);
diff --cc source/blender/windowmanager/WM_api.h
index b4ff0e2b555,9176385c40d..d4e0ed8ee65
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@@ -68,7 -70,7 +70,8 @@@ struct ScrArea
struct Main;
struct bToolDef;
struct ViewLayer;
+ struct GPUViewport;
+struct uiButtonGroupType;
#ifdef WITH_INPUT_NDOF
struct wmNDOFMotionData;
diff --cc source/blender/windowmanager/WM_types.h
index 6b0f4850206,825948a13a9..56d16752b13
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@@ -635,38 -635,14 +635,18 @@@ typedef struct wmIMEData
typedef void (*wmPaintCursorDraw)(struct bContext *C, int, int, void *customdata);
-
- /* ****************** Messages ********************* */
-
- enum {
- WM_LOG_DEBUG = 0,
- WM_LOG_INFO = 1000,
- WM_LOG_WARNING = 2000,
- WM_ERROR_UNDEFINED = 3000,
- WM_ERROR_INVALID_INPUT = 3001,
- WM_ERROR_INVALID_CONTEXT = 3002,
- WM_ERROR_OUT_OF_MEMORY = 3003
- };
-
- typedef struct wmReport {
- struct wmReport *next, *prev;
- const char *typestr;
- char *message;
- int type;
- } wmReport;
-
/* *************** Drag and drop *************** */
-#define WM_DRAG_ID 0
-#define WM_DRAG_RNA 1
-#define WM_DRAG_PATH 2
-#define WM_DRAG_NAME 3
-#define WM_DRAG_VALUE 4
-#define WM_DRAG_COLOR 5
+enum wmDragType {
+ WM_DRAG_ID,
+ WM_DRAG_RNA,
+ WM_DRAG_PATH,
+ WM_DRAG_NAME,
+ WM_DRAG_VALUE,
+ WM_DRAG_COLOR,
+ /* Drag the entire button for button drag & drop reordering */
+ WM_DRAG_BUT_REORDER,
+};
typedef enum wmDragFlags {
WM_DRAG_NOP = 0,
diff --cc source/blender/windowmanager/intern/wm_window.c
index 9d1feb7f121,49adfcefd4e..2444f88c1e9
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@@ -793,11 -776,13 +776,16 @@@ void wm_window_ghostwindows_ensure(wmWi
{
ListBase *lb = WM_dropboxmap_find("Window", 0, 0);
WM_event_add_dropbox_handler(&win->handlers, lb);
+
+ lb = WM_dropboxmap_find("User Interface", 0, 0);
+ WM_event_add_dropbox_handler(&win->handlers, lb);
}
wm_window_title(wm, win);
+
+ /* add topbar */
+ if (BLI_listbase_is_empty(&win->global_areas.areabase)) {
+ ED_screen_global_areas_create(win);
+ }
}
}
More information about the Bf-blender-cvs
mailing list