| OLD | NEW |
| 1 SKY MODULE | 1 SKY MODULE |
| 2 <import src="sky:core" as="sky"/> | 2 <import src="sky:core" as="sky"/> |
| 3 <script> | 3 <script> |
| 4 // display: toolbar; | 4 // display: toolbar; |
| 5 // toolbar-spacing: <length> | 5 // toolbar-spacing: <length> |
| 6 // display: spring; // remaining space is split equally amongst the springs | 6 // display: spring; // remaining space is split equally amongst the springs |
| 7 // children are vertically centered, layout out left-to-right with toolbar-spac
ing space between them | 7 // children are vertically centered, layout out left-to-right with toolbar-spac
ing space between them |
| 8 // last child is hidden by default unless there's not enough room for the other
s, then it's shown last, right-aligned | 8 // last child is hidden by default unless there's not enough room for the other
s, then it's shown last, right-aligned |
| 9 module.exports.SpringLayoutManager = class SpringLayoutManager extends sky.Layo
utManager { } | 9 module.exports.SpringLayoutManager = class SpringLayoutManager extends sky.Layo
utManager { } |
| 10 sky.registerLayoutManager('spring', module.exports.SpringLayoutManager); | 10 sky.registerLayoutManager('spring', module.exports.SpringLayoutManager); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 while ((!loop.done) && (loop.value != this.firstSkippedChild)) | 188 while ((!loop.done) && (loop.value != this.firstSkippedChild)) |
| 189 this.paintChild(loop.value, canvas); | 189 this.paintChild(loop.value, canvas); |
| 190 if (this.showingOverflow) | 190 if (this.showingOverflow) |
| 191 this.paintChild(this.overflowChild, canvas); | 191 this.paintChild(this.overflowChild, canvas); |
| 192 } | 192 } |
| 193 function paintChild(child, canvas) { | 193 function paintChild(child, canvas) { |
| 194 if (child.needsPaint) { | 194 if (child.needsPaint) { |
| 195 canvas.save(); | 195 canvas.save(); |
| 196 try { | 196 try { |
| 197 canvas.beginPath(); | 197 canvas.beginPath(); |
| 198 canvas.rect(child.x, child.y, child.width, child.height); | 198 canvas.translate(child.x, child.y); |
| 199 canvas.rect(0, 0, child.width, child.height); |
| 199 canvas.clip(); | 200 canvas.clip(); |
| 200 child.paint(canvas); | 201 child.paint(canvas); |
| 201 } finally { | 202 } finally { |
| 202 canvas.restore(); | 203 canvas.restore(); |
| 203 } | 204 } |
| 204 } | 205 } |
| 205 } | 206 } |
| 206 } | 207 } |
| 207 sky.registerLayoutManager('toolbar', module.exports.ToolbarLayoutManager); | 208 sky.registerLayoutManager('toolbar', module.exports.ToolbarLayoutManager); |
| 208 </script> | 209 </script> |
| OLD | NEW |