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:
authorJacques Lucke <mail@jlucke.com>2019-04-24 18:45:34 +0300
committerJacques Lucke <mail@jlucke.com>2019-04-24 18:45:34 +0300
commitca41548626f5f49a769dc018ab54d7ed06c05489 (patch)
tree6027ec36289a41d6914a117f6196469e113c2c32 /release
parentea8026438104f7be178fcb06562932e4e3d2f094 (diff)
UI: Simple confirm dialog when loading new file
I also had to make the "New" operator a submenu in the `File Context Menu`, so that you can still select the template. This partially solves T61599. Currently the confirm dialog is not shown when an already existing file is opened. Implementing that requires a bit more work and will be done in a separate patch. Reviewers: brecht Differential Revision: https://developer.blender.org/D4732
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index e75f4d1bb5d..e2bd203f520 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -262,7 +262,7 @@ class TOPBAR_MT_file_new(Menu):
@staticmethod
def draw_ex(layout, _context, *, use_splash=False, use_more=False):
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'INVOKE_DEFAULT'
# Limit number of templates in splash screen, spill over into more menu.
paths = TOPBAR_MT_file_new.app_template_paths()
@@ -557,7 +557,7 @@ class TOPBAR_MT_file_context_menu(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.read_homefile", text="New", icon='FILE_NEW')
+ layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
layout.separator()