Workbench: hide background option for OpenGL render

When OpenGL renderer is selected the option for background colors are
displayed, but ignored. For now we hide this option as it makes no sense
to have a viewport color option without viewport or render a 'final'
with a theme color.
This commit is contained in:
Jeroen Bakker 2018-08-19 20:25:36 +02:00
parent c2c4420f89
commit b831accc01
2 changed files with 10 additions and 3 deletions

View File

@ -853,7 +853,7 @@ class RENDER_PT_opengl_color(RenderButtonsPanel, Panel):
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
VIEW3D_PT_shading_color.draw(self, context)
VIEW3D_PT_shading_color._draw_color_type(self, context)
class RENDER_PT_opengl_options(RenderButtonsPanel, Panel):

View File

@ -3991,20 +3991,27 @@ class VIEW3D_PT_shading_color(Panel):
shading = VIEW3D_PT_shading.get_shading(context)
return shading.type == 'SOLID'
def draw(self, context):
def _draw_color_type(self, context):
layout = self.layout
shading = VIEW3D_PT_shading.get_shading(context)
layout.row().prop(shading, 'color_type', expand=True)
if shading.color_type == 'SINGLE':
layout.row().prop(shading, 'single_color', text="")
def _draw_background_color(self, context):
layout = self.layout
shading = VIEW3D_PT_shading.get_shading(context)
layout.row().label("Background")
layout.row().prop(shading, 'background_type', expand=True)
if shading.background_type == 'VIEWPORT':
layout.row().prop(shading, "background_color", text="")
def draw(self, context):
self._draw_color_type(context)
self._draw_background_color(context)
class VIEW3D_PT_shading_options(Panel):
bl_space_type = 'VIEW_3D'