Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py1
-rw-r--r--source/blender/editors/screen/screen_ops.c20
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c16
3 files changed, 21 insertions, 16 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 5cf28578217..5129b5648ce 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -557,6 +557,7 @@ class TOPBAR_MT_window_specials(Menu):
layout.operator_context = 'EXEC_AREA'
layout.operator("wm.window_new")
+ layout.operator("wm.window_new_main")
layout.operator_context = 'INVOKE_AREA'
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index ab0fbfacf93..4a8ab724c9a 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3659,27 +3659,38 @@ static void SCREEN_OT_header_toggle_menus(wmOperatorType *ot)
/** \name Header Tools Operator
* \{ */
+static bool header_context_menu_poll(bContext *C)
+{
+ ScrArea *sa = CTX_wm_area(C);
+ return (sa && sa->spacetype != SPACE_STATUSBAR);
+}
+
void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UNUSED(arg))
{
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
const char *but_flip_str = (ar->alignment == RGN_ALIGN_TOP) ? IFACE_("Flip to Bottom") : IFACE_("Flip to Top");
- uiItemO(layout, IFACE_("Toggle Header"), ICON_NONE, "SCREEN_OT_header");
+ if (!ELEM(sa->spacetype, SPACE_TOPBAR)) {
+ uiItemO(layout, IFACE_("Toggle Header"), ICON_NONE, "SCREEN_OT_header");
+ }
/* default is WM_OP_INVOKE_REGION_WIN, which we don't want here. */
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_DEFAULT);
- uiItemO(layout, but_flip_str, ICON_NONE, "SCREEN_OT_region_flip");
+ if (!ELEM(sa->spacetype, SPACE_TOPBAR)) {
+ uiItemO(layout, but_flip_str, ICON_NONE, "SCREEN_OT_region_flip");
+ }
+
uiItemO(layout, IFACE_("Collapse Menus"),
(sa->flag & HEADER_NO_PULLDOWN) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT,
"SCREEN_OT_header_toggle_menus");
- uiItemS(layout);
-
/* file browser should be fullscreen all the time, topbar should
* never be. But other regions can be maximized/restored... */
if (!ELEM(sa->spacetype, SPACE_FILE, SPACE_TOPBAR)) {
+ uiItemS(layout);
+
const char *but_str = sa->full ? IFACE_("Tile Area") : IFACE_("Maximize Area");
uiItemO(layout, but_str, ICON_NONE, "SCREEN_OT_screen_full_area");
}
@@ -3708,6 +3719,7 @@ static void SCREEN_OT_header_context_menu(wmOperatorType *ot)
ot->idname = "SCREEN_OT_header_context_menu";
/* api callbacks */
+ ot->poll = header_context_menu_poll;
ot->invoke = header_context_menu_invoke;
}
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 93670919d4c..fb2907983c8 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -64,17 +64,9 @@
static int context_menu_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
{
- bScreen *sc = CTX_wm_screen(C);
- SpaceButs *sbuts = CTX_wm_space_buts(C);
- PointerRNA ptr;
- uiPopupMenu *pup;
- uiLayout *layout;
-
- RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr);
-
- pup = UI_popup_menu_begin(C, IFACE_("Align"), ICON_NONE);
- layout = UI_popup_menu_layout(pup);
- uiItemsEnumR(layout, &ptr, "align");
+ uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Context Menu"), ICON_NONE);
+ uiLayout *layout = UI_popup_menu_layout(pup);
+ uiItemM(layout, "INFO_MT_area", NULL, ICON_NONE);
UI_popup_menu_end(C, pup);
return OPERATOR_INTERFACE;
@@ -84,7 +76,7 @@ void BUTTONS_OT_context_menu(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Context Menu";
- ot->description = "Display button panel context_menu";
+ ot->description = "Display properties editor context_menu";
ot->idname = "BUTTONS_OT_context_menu";
/* api callbacks */