[Bf-blender-cvs] [118ac491d20] master: Fix poor display of time codes in sequencer Info panel
Mal Duffin
noreply at git.blender.org
Mon May 27 13:31:33 CEST 2019
Commit: 118ac491d2043cf3fc78cc99034b78666523b865
Author: Mal Duffin
Date: Mon May 27 13:05:27 2019 +0200
Branches: master
https://developer.blender.org/rB118ac491d2043cf3fc78cc99034b78666523b865
Fix poor display of time codes in sequencer Info panel
Allow using : in labels inside buttons.
Differential Revision: https://developer.blender.org/D4944
===================================================================
M release/scripts/startup/bl_ui/space_sequencer.py
M source/blender/editors/interface/interface_widgets.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index dae7c13082f..62ae500d3a0 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1320,15 +1320,15 @@ class SEQUENCER_PT_info_timecodes(SequencerButtonsPanel, Panel):
split = sub.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="Start")
- split.prop(strip, "frame_start", text=str(bpy.utils.smpte_from_frame(strip.frame_start)).replace(':', ' '))
+ split.prop(strip, "frame_start", text=str(bpy.utils.smpte_from_frame(strip.frame_start)))
split = sub.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="End")
- split.prop(strip, "frame_final_end", text=str(bpy.utils.smpte_from_frame(strip.frame_final_end)).replace(':', ' '))
+ split.prop(strip, "frame_final_end", text=str(bpy.utils.smpte_from_frame(strip.frame_final_end)))
split = sub.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="Duration")
- split.prop(strip, "frame_final_duration", text=str(bpy.utils.smpte_from_frame(strip.frame_final_duration)).replace(':', ' '))
+ split.prop(strip, "frame_final_duration", text=str(bpy.utils.smpte_from_frame(strip.frame_final_duration)))
if not isinstance(strip, bpy.types.EffectSequence):
layout.alignment = 'RIGHT'
@@ -1336,22 +1336,22 @@ class SEQUENCER_PT_info_timecodes(SequencerButtonsPanel, Panel):
split = sub.split(factor=0.5 + max_factor, align=True)
split.alignment = 'RIGHT'
split.label(text="Soft Trim Start")
- split.prop(strip, "frame_offset_start", text=str(bpy.utils.smpte_from_frame(strip.frame_offset_start)).replace(':', ' '))
+ split.prop(strip, "frame_offset_start", text=str(bpy.utils.smpte_from_frame(strip.frame_offset_start)))
split = sub.split(factor=0.5 + max_factor, align=True)
split.alignment = 'RIGHT'
split.label(text='End')
- split.prop(strip, "frame_offset_end", text=str(bpy.utils.smpte_from_frame(strip.frame_offset_end)).replace(':', ' '))
+ split.prop(strip, "frame_offset_end", text=str(bpy.utils.smpte_from_frame(strip.frame_offset_end)))
layout.alignment = 'RIGHT'
sub = layout.column(align=True)
split = sub.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="Hard Trim Start")
- split.prop(strip, "animation_offset_start", text=str(bpy.utils.smpte_from_frame(strip.animation_offset_start)).replace(':', ' '))
+ split.prop(strip, "animation_offset_start", text=str(bpy.utils.smpte_from_frame(strip.animation_offset_start)))
split = sub.split(factor=0.5 + max_factor, align=True)
split.alignment = 'RIGHT'
split.label(text='End')
- split.prop(strip, "animation_offset_end", text=str(bpy.utils.smpte_from_frame(strip.animation_offset_end)).replace(':', ' '))
+ split.prop(strip, "animation_offset_end", text=str(bpy.utils.smpte_from_frame(strip.animation_offset_end)))
playhead = frame_current - strip.frame_start
col = layout.column(align=True)
@@ -1363,7 +1363,7 @@ class SEQUENCER_PT_info_timecodes(SequencerButtonsPanel, Panel):
split = col.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="Playhead")
- split.label(text="%s: %s" % ((bpy.utils.smpte_from_frame(playhead).replace(':', ' ')), (str(playhead))))
+ split.label(text="%s: %s" % ((bpy.utils.smpte_from_frame(playhead)), (str(playhead))))
''' Old data - anyone missing this data?
col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e31646f9fdb..e9de703db35 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2185,7 +2185,7 @@ static void widget_draw_text(const uiFontStyle *fstyle,
ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) &&
/* if we're editing or multi-drag (fake editing), then use left alignment */
(but->editstr == NULL) && (drawstr == but->drawstr)) {
- drawstr_right = strchr(drawstr + but->ofs, ':');
+ drawstr_right = strrchr(drawstr + but->ofs, ':');
if (drawstr_right) {
drawstr_right++;
drawstr_left_len = (drawstr_right - drawstr);
More information about the Bf-blender-cvs
mailing list