Benchmark: use link button drawing in UI.

This commit is contained in:
2018-08-07 20:09:04 +02:00
parent db239757cb
commit 206d83d546

View File

@@ -458,6 +458,20 @@ class BENCHMARK_PT_main(Panel):
bl_space_type = 'BENCHMARK'
bl_region_type = 'WINDOW'
def draw_link(self, context):
layout = self.layout
layout.separator()
layout.separator()
col = layout.column()
sub = col.row()
sub.alignment = 'RIGHT'
sub.emboss = 'LINK'
sub.scale_y = 1.5
sub.active = False
sub.operator("benchmark.opendata_link")
def draw_welcome(self, context):
layout = self.layout
@@ -483,12 +497,14 @@ class BENCHMARK_PT_main(Panel):
col.separator()
sub = col.row()
sub.emboss = 'NONE'
sub.emboss = 'LINK'
sub.scale_y = 1.5
sub.operator("benchmark.run_complete", text="RUN COMPLETE BENCHMARK")
split.label()
self.draw_link(context)
def draw_submit(self, context):
layout = self.layout
@@ -506,12 +522,12 @@ class BENCHMARK_PT_main(Panel):
sub.operator("benchmark.share", text="SHARE ONLINE")
sub = col.row()
sub.emboss = 'NONE'
sub.emboss = 'LINK'
sub.scale_y = 1.5
sub.operator("benchmark.save", text="SAVE LOCALLY")
sub = col.row()
sub.emboss = 'NONE'
sub.emboss = 'LINK'
sub.scale_y = 1.5
sub.operator("benchmark.restart", text="START AGAIN")
@@ -779,6 +795,14 @@ class BENCHMARK_OT_share(bpy.types.Operator):
def invoke(self, context, event):
return {'FINISHED'}
class BENCHMARK_OT_opendata_link(bpy.types.Operator):
bl_idname = "benchmark.opendata_link"
bl_label = "opendata.blender.org"
def invoke(self, context, event):
bpy.ops.wm.url_open('INVOKE_DEFAULT', url="https://opendata.blender.org")
return {'FINISHED'}
################################################################################
# Restart benchmark.
@@ -839,6 +863,7 @@ classes = (
BENCHMARK_OT_run_complete,
BENCHMARK_OT_save,
BENCHMARK_OT_share,
BENCHMARK_OT_opendata_link,
)
Scene.compute_device = EnumProperty(