frameworks/uki/src/uki-view/view/toolbar.js in uki-1.0.0 vs frameworks/uki/src/uki-view/view/toolbar.js in uki-1.0.1
- old
+ new
@@ -34,11 +34,11 @@
flowRect = rect.clone().normalize(),
moreRect = new Rect(rect.width - this._moreWidth, 0, this._moreWidth, rect.height),
flowML = { view: 'HFlow', rect: flowRect, anchors: 'left top right', className: 'toolbar-flow', hidePartlyVisible: true },
moreML = { view: 'Button', rect: moreRect, anchors: 'right top', className: 'toolbar-button', visible: false, backgroundPrefix: 'toolbar-more-', text: '>>', focusable: false },
popupML = { view: 'Popup', rect: '0 0', anchors: 'right top', className: 'toolbar-popup', background: 'theme(toolbar-popup)',
- childViews: { view: 'VFlow', rect: '0 0', anchors: 'right top left bottom' }
+ childViews: { view: 'VFlow', rect: '0 5 0 0', anchors: 'right top left bottom' }
};
this._flow = uki.build(flowML)[0];
this._more = uki.build(moreML)[0];
this.appendChild(this._flow);
@@ -56,18 +56,18 @@
for (var i=0, childViews = this._flow.childViews(), l = childViews.length; i < l; i++) {
currentWidth += childViews[i].rect().width;
if (currentWidth > maxWith) missing.push(i);
};
var newButtons = uki.map(missing, function(i) {
- var descr = { html: childViews[i].html(), backgroundPrefix: 'toolbar-popup-' };
+ var descr = { html: childViews[i].html(), backgroundPrefix: 'toolbar-popup-button-' };
uki.each(['fontSize', 'fontWeight', 'color', 'textAlign', 'inset'], function(j, name) {
descr[name] = uki.attr(childViews[i], name);
});
return this._createButton(descr);
}, this);
uki('VFlow', this._popup).childViews(newButtons).resizeToContents('width height');
- this._popup.resizeToContents('width height').toggle();
+ this._popup.resizeToContents('width height').height(this._popup.height() + 5).toggle();
};
this._updateMoreVisible = function() {
var rect = this._rect;
if (this._more.visible() != rect.width < this._totalWidth) {
@@ -83,11 +83,13 @@
if (rect) this._updateMoreVisible();
return result;
};
this._createButton = function(descr) {
+ var rect = this.rect().clone().normalize();
+ rect.width = 100;
return uki.extend({
- view: 'Button', rect: new Rect(100, this.rect().height), focusable: false, align: 'left',
+ view: 'Button', rect: rect, focusable: false, align: 'left',
anchors: 'left top', backgroundPrefix: 'toolbar-button-', autosizeToContents: 'width', focusable: false
}, descr);
};
});
\ No newline at end of file