Benchmark: tweak opendata link to be centered correctly.
This commit is contained in:
@@ -452,6 +452,14 @@ def benchmark_thread(ctx):
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Panels
|
# Panels
|
||||||
|
|
||||||
|
def ui_scale_factor(x):
|
||||||
|
# To position the buttons exactly we add spacing, but there can be
|
||||||
|
# rounding errors with non-integer DPI scaling. We roughly compensate
|
||||||
|
# for those here.
|
||||||
|
ui_scale = bpy.context.user_preferences.system.ui_scale
|
||||||
|
widget_height = 20 * ui_scale
|
||||||
|
return x * widget_height / int(widget_height)
|
||||||
|
|
||||||
class BENCHMARK_PT_main(Panel):
|
class BENCHMARK_PT_main(Panel):
|
||||||
bl_label = "Benchmark"
|
bl_label = "Benchmark"
|
||||||
bl_options = {'HIDE_HEADER'}
|
bl_options = {'HIDE_HEADER'}
|
||||||
@@ -461,8 +469,10 @@ class BENCHMARK_PT_main(Panel):
|
|||||||
def draw_link(self, context):
|
def draw_link(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.separator()
|
col = layout.column()
|
||||||
layout.separator()
|
col.scale_y = ui_scale_factor(0.35)
|
||||||
|
col.label(text="")
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|
||||||
sub = col.row()
|
sub = col.row()
|
||||||
@@ -481,7 +491,7 @@ class BENCHMARK_PT_main(Panel):
|
|||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
sub = col.row()
|
sub = col.row()
|
||||||
sub.scale_y = 64.0
|
sub.scale_y = ui_scale_factor(64.0)
|
||||||
sub.separator()
|
sub.separator()
|
||||||
|
|
||||||
compute_device_list_get(None, context)
|
compute_device_list_get(None, context)
|
||||||
@@ -518,7 +528,7 @@ class BENCHMARK_PT_main(Panel):
|
|||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
sub = col.row()
|
sub = col.row()
|
||||||
sub.scale_y = 64.0
|
sub.scale_y = ui_scale_factor(64.0)
|
||||||
sub.separator()
|
sub.separator()
|
||||||
|
|
||||||
sub = col.row()
|
sub = col.row()
|
||||||
|
Reference in New Issue
Block a user