Skip to content

Commit

Permalink
add a live drag attribute to the DockArea
Browse files Browse the repository at this point in the history
  • Loading branch information
sccolbert committed Jun 5, 2013
1 parent 6123ffe commit 0cd6889
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions enaml/widgets/dock_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The full license is in the file COPYING.txt, distributed with this software.
#------------------------------------------------------------------------------
from atom.api import (
Coerced, Enum, Typed, ForwardTyped, Unicode, observe, set_default
Bool, Coerced, Enum, Typed, ForwardTyped, Unicode, observe, set_default
)

from enaml.core.declarative import d_
Expand Down Expand Up @@ -49,6 +49,9 @@ class ProxyDockArea(ProxyConstraintsWidget):
def set_tab_position(self, position):
raise NotImplementedError

def set_live_drag(self, live_drag):
raise NotImplementedError

def set_style(self, style):
raise NotImplementedError

Expand Down Expand Up @@ -76,6 +79,11 @@ class DockArea(ConstraintsWidget):
#: The default tab position for newly created dock tabs.
tab_position = d_(Enum('top', 'bottom', 'left', 'right'))

#: Whether the dock items resize as a dock splitter is being dragged
#: (True), or if a simple indicator is drawn until the drag handle
#: is released (False). The default is True.
live_drag = d_(Bool(True))

#: The style to apply to the dock area. The default style resembles
#: Visual Studio 2010. The builtin styles are: 'vs-2010', 'grey-wind',
#: 'new-moon', and 'metro'.
Expand Down Expand Up @@ -204,7 +212,7 @@ def _update_layout(self, change):
if change['type'] == 'update':
self.apply_layout(change['value'])

@observe(('tab_position', 'style'))
@observe(('tab_position', 'live_drag', 'style'))
def _update_proxy(self, change):
""" Update the proxy when the area state changes.
Expand Down

0 comments on commit 0cd6889

Please sign in to comment.