summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJekyll Wu <adaptee@gmail.com>2012-05-14 06:48:55 (GMT)
committerJekyll Wu <adaptee@gmail.com>2012-05-14 07:16:50 (GMT)
commitb8b8ef7405e81dfcbe63e5a1b84cf773b6a36096 (patch)
tree44cad436143a252974e5a4d093f47e0b7e6c52b6
parent79e7c013cf5b02ccfe19871109c49a8640154dee (diff)
Support dragging tab out of current window and into its own window
Thanks to makis marimpis<makhsm@gmail.com> for the patch! REVIEW: 104933 FEATURE: 56749 FIXED-IN: 4.9.0
-rw-r--r--src/ViewContainer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp
index 1a0148e..8070bfb 100644
--- a/src/ViewContainer.cpp
+++ b/src/ViewContainer.cpp
@@ -620,9 +620,6 @@ void TabbedViewContainer::startTabDrag(int tab)
// start drag, if drag-and-drop is successful the view at 'tab' will be
// deleted
- //
- // if the tab was dragged onto another application
- // which blindly accepted the drop then ignore it
if (drag->exec() == Qt::MoveAction && drag->target() != 0) {
// Deleting the view may cause the view container to be deleted, which
// will also delete the QDrag object.
@@ -635,6 +632,15 @@ void TabbedViewContainer::startTabDrag(int tab)
// FIXME: Resolve this properly
drag->setParent(0);
removeView(view);
+ } else {
+ // if the tab was dragged onto another application
+ // which blindly accepted the drop, then detach the tab to achieve
+ // the effect of "dragging tab into its own window"
+ //
+ // It feels unnatural to do the detach when this is only one tab
+ // in the tabbar
+ if (_tabBar->count() > 1)
+ emit detachTab(this, view);
}
}