スプリッタとの境界線上ではタブバーのドラッグを無視するように

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5087 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-09-04 01:42:32 +00:00
parent 82461970b2
commit 96afe9a053
2 changed files with 32 additions and 1 deletions

View File

@ -39,13 +39,43 @@ TreeStyleTabBrowserTabbarDNDObserver.prototype = {
var tab = sv.getTabFromEvent(aEvent);
var tabbar = sv.getTabbarFromEvent(aEvent);
return (
var canDrag = (
(tab ? aEvent.shiftKey : tabbar ) &&
(
aEvent.shiftKey ||
sv.mTabBrowser.getAttribute(sv.kFIXED) != 'true'
)
);
if (canDrag && !aEvent.shiftKey) {
let insensitiveArea = sv.getTreePref('tabbar.fixed.insensitiveArea');
let box = tabbar.boxObject;
switch (sv.mTabBrowser.getAttribute(sv.kTABBAR_POSITION))
{
case 'right':
if (aEvent.screenX < box.screenX + insensitiveArea)
canDrag = false;
break;
case 'left':
if (aEvent.screenX > box.screenX + box.width - insensitiveArea)
canDrag = false;
break;
default:
case 'top':
if (aEvent.screenY > box.screenY + box.height - insensitiveArea)
canDrag = false;
break;
case 'bottom':
if (aEvent.screenY < box.screenY + insensitiveArea)
canDrag = false;
break;
}
}
return canDrag;
},
onDragEnter : function(aEvent, aDragSession)

View File

@ -38,6 +38,7 @@ pref("extensions.treestyletab.tabbar.autoShow.feedback.delay", 3000);
pref("extensions.treestyletab.tabbar.autoShow.keepShownOnMouseover", true);
pref("extensions.treestyletab.tabbar.togglerSize", 5);
pref("extensions.treestyletab.tabbar.fixed.autoCancelOnDrop", true);
pref("extensions.treestyletab.tabbar.fixed.insensitiveArea", 7);
pref("extensions.treestyletab.tabbar.fixed.horizontal", true);
pref("extensions.treestyletab.tabbar.fixed.vertical", false);
pref("extensions.treestyletab.tabbar.syncRelatedPrefsForDynamicPosition", true);