1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 23:36:08 +03:00

GH-296 Implement more drop

This commit is contained in:
Tae Won Ha 2016-11-17 22:20:09 +01:00
parent cf9fd3796c
commit 5455afedca
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -113,7 +113,7 @@ class WorkspaceBar: NSView, WorkspaceToolDelegate {
tool.location = self.location
self.tools.append(tool)
if self.isOpen {
if self.isOpen || tool.isSelected {
self.selectedTool?.isSelected = false
self.selectedTool = tool
}
@ -127,7 +127,7 @@ class WorkspaceBar: NSView, WorkspaceToolDelegate {
tool.location = self.location
self.tools.insert(tool, at: idx)
if self.isOpen {
if self.isOpen || tool.isSelected {
self.selectedTool?.isSelected = false
self.selectedTool = tool
}
@ -145,7 +145,6 @@ class WorkspaceBar: NSView, WorkspaceToolDelegate {
self.tools.remove(at: idx)
if self.isOpen && self.selectedTool == tool {
tool.isSelected = false
self.selectedTool = self.tools.first
}
@ -234,9 +233,9 @@ extension WorkspaceBar {
}
// 3
NSLog("append at the end")
return false
tool.bar?.remove(tool: tool)
self.append(tool: tool)
return true
}
// If we are here, the dragged tool is dropped somewhere in the middle and