Allow minimum width for cut plan

Also
* add ID for estimated time row
* make the <label> for the Save Bookmarks checkbox actually be its label.
This commit is contained in:
df 2020-11-11 12:19:32 +00:00 committed by HummyPkg
parent 269f844f43
commit f7c37e83ae

View File

@ -14,6 +14,7 @@ set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
set planwidth 500
puts "
<fieldset>
@ -29,7 +30,8 @@ puts [join [lmap i [$ts bookmarks 1] {
clock format $i -format "%T"
}] ", "]
puts "</td></tr><tr><th>&nbsp;</th><td id=cutplan>"
# set minimum width as positioned contents doesn't resize its cell
puts "</td></tr><tr><th>&nbsp;</th><td id=cutplan style=\"min-width: ${planwidth}px\">"
puts "<div style=\"position: relative; top: -10px\">"
@ -64,8 +66,8 @@ foreach b $bookmarks {
incr cur $l
append newbookmarks "[expr $cur + 3] "
set left $($start * 500 / $len)
set right $($end * 500 / $len)
set left $($start * $planwidth / $len)
set right $($end * $planwidth / $len)
div cut $last $($left - 1)
div keep $left $($right - 1)
@ -78,11 +80,11 @@ foreach b $bookmarks {
if {$start > 0} {
# Still in a keep section...
incr keeping $($len - $start)
set left $($start * 500 / $len)
set left $($start * $planwidth / $len)
div cut $last $($left - 1)
div keep $left 500
div keep $left $planwidth
} else {
div cut $last 500
div cut $last $planwidth
}
if {$cur > $keeping - 8 && $keeping - 8 > 0} {
@ -115,7 +117,7 @@ puts [join [lmap i $newbookmarks {
puts " )</td></tr>"
puts "
<tr><th>Time:</th>
<tr id=esttime><th>Time:</th>
<td>Cropping will take around [clock format $esttime -format "%T"]</td></tr>
</table>
@ -130,9 +132,9 @@ puts "
<td><button id=invert invert=$invert>Invert selection</button></td>
<td><button id=cropit>Perform crop operation</button></td>
<td>
Save new bookmarks?
<label id=saveitlabel for=saveit>Save new bookmarks?</label>
<input id=saveit type=checkbox name=saveit checked>
<label id=saveitlabel for=saveit>&nbsp;</label>
&nbsp;
</td>
</tr></table>
</div>