+ Visual cleanup:

+ Page names are no longer visible when in stacks
 + Page names have been prettified when in the stack tray.
 + TODO: Page names don't seem to come back after a group is turned into a stack, and then unstacked.
This commit is contained in:
Aza Raskin 2010-04-29 00:42:37 -07:00
parent 5e96413c12
commit 8e2f4638c6
3 changed files with 48 additions and 9 deletions

View File

@ -492,8 +492,13 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
bb.inset(6, 6);
if((bb.width * bb.height) / count > 7000) {
this._children.forEach(function(child){
child.removeClass("stacked")
});
Items.arrange(this._children, bb, options);
this._isStacked = false;
} else
this._stackArrange(bb, options);
},
@ -540,6 +545,7 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
child.setBounds(box, !animate);
child.setRotation(self._randRotate(35, index));
child.addClass("stacked");
}
});
@ -582,7 +588,7 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
zIndex: 99998
}).appendTo("body");
var w = 240;
var w = 180;
var h = w * (TabItems.tabHeight / TabItems.tabWidth) * 1.1;
var padding = 20;
var col = Math.ceil(Math.sqrt(this._children.length));
@ -605,7 +611,11 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
height: overlayHeight,
top: pos.top,
left: pos.left
}, 350, "tabcandyBounce").addClass("overlay");//xxx
}, 350, "tabcandyBounce").addClass("overlay");
this._children.forEach(function(child){
child.addClass("stack-trayed");
});
var box = new Rect(pos.left, pos.top, overlayWidth, overlayHeight);
box.inset(8, 8);
@ -643,6 +653,10 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
this.expanded.$shield.remove();
this.expanded = null;
this._children.forEach(function(child){
child.removeClass("stack-trayed");
});
this.arrange({z: this.getZ() + 1});
}
},

View File

@ -106,12 +106,17 @@ window.TabItem.prototype = $.extend(new Item(), {
}
if(css.fontSize) {
if(css.fontSize < minFontSize)
$title.fadeOut();
if(css.fontSize < minFontSize )
$title.fadeOut().dequeue();
else
$title.fadeIn();
$title.fadeIn().dequeue();
}
if( $container.hasClass("stacked") ){
$title.hide();
}
if(css.width) {
if(css.width < 30) {
$thumb.fadeOut();
@ -135,6 +140,16 @@ window.TabItem.prototype = $.extend(new Item(), {
this.tab.close();
},
// ----------
addClass: function(className) {
$(this.container).addClass(className);
},
// ----------
removeClass: function(className) {
$(this.container).removeClass(className);
},
// ----------
addOnClose: function(referenceObject, callback) {
this.tab.mirror.addOnClose(referenceObject, callback);
@ -258,7 +273,7 @@ window.TabItems = {
left: 0,
width: orig.width*scale,
height: orig.height*scale
}, 200, "easeOutQuad", onZoomDone);
}, 200, "easeInQuad", onZoomDone);
}
} else {
$(this).find("canvas").data("link").tab.raw.pos = $(this).position();

View File

@ -110,7 +110,17 @@ body {
overflow: hidden;
}
.stacked .tab-title{ display: none; }
.stacked .thumbShadow{display: none;}
.stacked .thumb{-moz-box-shadow: rgba(0,0,0,.2) 1px 1px 6px;}
.stack-trayed .tab-title{
display: block !important;
text-shadow: rgba(0,0,0,1) 1px 1px 2px;
color: #EEE;
font-size: 11px;
}
.stack-trayed .thumb{ -moz-box-shadow: none !important;}
/* Tab Group
----------------------------------*/