Code cleanup / Layout script:

* Never ever use something like "rowsub" as variable.
This commit is contained in:
Thomas Dinges
2013-04-13 22:52:28 +00:00
parent 7c4be99281
commit 98f78fde23
3 changed files with 14 additions and 18 deletions

View File

@@ -1114,9 +1114,9 @@ class USERPREF_PT_addons(Panel):
def draw_error(layout, message):
lines = message.split("\n")
box = layout.box()
rowsub = box.row()
rowsub.label(lines[0])
rowsub.label(icon='ERROR')
sub = box.row()
sub.label(lines[0])
sub.label(icon='ERROR')
for l in lines[1:]:
box.label(l)
@@ -1199,14 +1199,14 @@ class USERPREF_PT_addons(Panel):
row.operator("wm.addon_expand", icon='TRIA_DOWN' if info["show_expanded"] else 'TRIA_RIGHT', emboss=False).module = module_name
rowsub = row.row()
rowsub.active = is_enabled
rowsub.label(text='%s: %s' % (info["category"], info["name"]))
sub = row.row()
sub.active = is_enabled
sub.label(text='%s: %s' % (info["category"], info["name"]))
if info["warning"]:
rowsub.label(icon='ERROR')
sub.label(icon='ERROR')
# icon showing support level.
rowsub.label(icon=self._support_icon_mapping.get(info["support"], 'QUESTION'))
sub.label(icon=self._support_icon_mapping.get(info["support"], 'QUESTION'))
if is_enabled:
row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name

View File

@@ -2702,13 +2702,10 @@ class VIEW3D_PT_background_image(Panel):
if has_bg:
col = box.column()
col.prop(bg, "opacity", slider=True)
rowsub = col.row()
rowsub.prop(bg, "draw_depth", expand=True)
col.row().prop(bg, "draw_depth", expand=True)
if bg.view_axis in {'CAMERA', 'ALL'}:
rowsub = col.row()
rowsub.prop(bg, "frame_method", expand=True)
col.row().prop(bg, "frame_method", expand=True)
row = col.row(align=True)
row.prop(bg, "offset_x", text="X")

View File

@@ -244,8 +244,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
if mesh.show_weight:
col.label("Show Zero Weights:")
rowsub = col.row()
rowsub.prop(tool_settings, "vertex_group_user", expand=True)
col.row().prop(tool_settings, "vertex_group_user", expand=True)
# ********** default tools for editmode_curve ****************
@@ -1091,9 +1090,9 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
col.prop(wpaint, "input_samples")
col.label("Show Zero Weights:")
rowsub = col.row()
rowsub.active = (not tool_settings.use_multipaint)
rowsub.prop(tool_settings, "vertex_group_user", expand=True)
sub = col.row()
sub.active = (not tool_settings.use_multipaint)
sub.prop(tool_settings, "vertex_group_user", expand=True)
self.unified_paint_settings(col, context)