Some UI tweaks
This commit is contained in:
parent
6eab5ba0af
commit
21b60a9d6f
@ -156,7 +156,7 @@ class BlenderCloudPreferences(AddonPreferences):
|
|||||||
bsync_box = layout.box()
|
bsync_box = layout.box()
|
||||||
bsync_box.enabled = icon != 'ERROR'
|
bsync_box.enabled = icon != 'ERROR'
|
||||||
row = bsync_box.row().split(percentage=0.33)
|
row = bsync_box.row().split(percentage=0.33)
|
||||||
row.label('Blender Sync')
|
row.label('Blender Sync with Blender Cloud')
|
||||||
|
|
||||||
icon_for_level = {
|
icon_for_level = {
|
||||||
'INFO': 'NONE',
|
'INFO': 'NONE',
|
||||||
@ -164,8 +164,9 @@ class BlenderCloudPreferences(AddonPreferences):
|
|||||||
'ERROR': 'ERROR',
|
'ERROR': 'ERROR',
|
||||||
'SUBSCRIBE': 'ERROR',
|
'SUBSCRIBE': 'ERROR',
|
||||||
}
|
}
|
||||||
|
icon = icon_for_level[bss.level] if bss.message else 'NONE'
|
||||||
message_container = row.row()
|
message_container = row.row()
|
||||||
message_container.label(bss.message, icon=icon_for_level[bss.level])
|
message_container.label(bss.message, icon=icon)
|
||||||
|
|
||||||
sub = bsync_box.column()
|
sub = bsync_box.column()
|
||||||
|
|
||||||
@ -182,11 +183,11 @@ class BlenderCloudPreferences(AddonPreferences):
|
|||||||
|
|
||||||
buttons = layout.column()
|
buttons = layout.column()
|
||||||
row_buttons = buttons.row().split(percentage=0.5)
|
row_buttons = buttons.row().split(percentage=0.5)
|
||||||
row_pull = row_buttons.row(align=True)
|
|
||||||
row_push = row_buttons.row()
|
row_push = row_buttons.row()
|
||||||
|
row_pull = row_buttons.row(align=True)
|
||||||
|
|
||||||
row_push.operator('pillar.sync',
|
row_push.operator('pillar.sync',
|
||||||
text='Save %i.%i settings to Cloud' % bpy.app.version[:2],
|
text='Save %i.%i settings' % bpy.app.version[:2],
|
||||||
icon='TRIA_UP').action = 'PUSH'
|
icon='TRIA_UP').action = 'PUSH'
|
||||||
|
|
||||||
versions = bss.available_blender_versions
|
versions = bss.available_blender_versions
|
||||||
@ -194,11 +195,11 @@ class BlenderCloudPreferences(AddonPreferences):
|
|||||||
if bss.status in {'NONE', 'IDLE'}:
|
if bss.status in {'NONE', 'IDLE'}:
|
||||||
if not versions or not version:
|
if not versions or not version:
|
||||||
row_pull.operator('pillar.sync',
|
row_pull.operator('pillar.sync',
|
||||||
text='Find version to load from Cloud',
|
text='Find version to load',
|
||||||
icon='TRIA_DOWN').action = 'REFRESH'
|
icon='TRIA_DOWN').action = 'REFRESH'
|
||||||
else:
|
else:
|
||||||
props = row_pull.operator('pillar.sync',
|
props = row_pull.operator('pillar.sync',
|
||||||
text='Load %s settings from Cloud' % version,
|
text='Load %s settings' % version,
|
||||||
icon='TRIA_DOWN')
|
icon='TRIA_DOWN')
|
||||||
props.action = 'PULL'
|
props.action = 'PULL'
|
||||||
props.blender_version = version
|
props.blender_version = version
|
||||||
|
@ -274,6 +274,7 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin,
|
|||||||
bpy.types.Operator):
|
bpy.types.Operator):
|
||||||
bl_idname = 'pillar.sync'
|
bl_idname = 'pillar.sync'
|
||||||
bl_label = 'Synchronise with Blender Cloud'
|
bl_label = 'Synchronise with Blender Cloud'
|
||||||
|
bl_description = 'Synchronises Blender settings with Blender Cloud'
|
||||||
|
|
||||||
log = logging.getLogger('bpy.ops.%s' % bl_idname)
|
log = logging.getLogger('bpy.ops.%s' % bl_idname)
|
||||||
home_project_id = None
|
home_project_id = None
|
||||||
@ -331,7 +332,7 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin,
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
bss = bpy.context.window_manager.blender_sync_status
|
bss = bpy.context.window_manager.blender_sync_status
|
||||||
self.layout.prop(bss, 'version')
|
self.layout.prop(bss, 'version', text='Blender version')
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
if self.action != 'SELECT':
|
if self.action != 'SELECT':
|
||||||
|
Reference in New Issue
Block a user