Improved the Quit Confirm behaviour: Now confirm only shows up when current session is dirty
This commit is contained in:
@@ -83,7 +83,6 @@ class INFO_MT_file(Menu):
|
|||||||
bl_label = "File"
|
bl_label = "File"
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
import sys
|
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.operator_context = 'INVOKE_AREA'
|
layout.operator_context = 'INVOKE_AREA'
|
||||||
@@ -132,7 +131,7 @@ class INFO_MT_file(Menu):
|
|||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
layout.operator_context = 'EXEC_AREA'
|
layout.operator_context = 'EXEC_AREA'
|
||||||
if sys.platform == "darwin":
|
if bpy.data.is_dirty:
|
||||||
layout.operator_context = 'INVOKE_SCREEN' # quit dialog
|
layout.operator_context = 'INVOKE_SCREEN' # quit dialog
|
||||||
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
|
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user