Implement the basic shortcuts for window management

This commit is contained in:
Kovid Goyal
2016-12-03 12:48:37 +05:30
parent cb4454c562
commit 836494a8f0
5 changed files with 92 additions and 26 deletions

View File

@@ -33,7 +33,7 @@ class Window:
self.geometry = WindowGeometry(0, 0, 0, 0, 0, 0)
self.needs_layout = True
self.title = appname
self.is_visible_in_layout = True
self._is_visible_in_layout = True
self.child, self.opts = child, opts
self.child_fd = child.child_fd
self.screen = Screen(self, 24, 80, opts.scrollback_lines)
@@ -42,6 +42,18 @@ class Window:
self.write_buf = memoryview(b'')
self.char_grid = CharGrid(self.screen, opts)
@property
def is_visible_in_layout(self):
return self._is_visible_in_layout
@is_visible_in_layout.setter
def is_visible_in_layout(self, val):
val = bool(val)
if val != self._is_visible_in_layout:
self._is_visible_in_layout = val
if val:
self.refresh()
def refresh(self):
self.screen.mark_as_dirty()
wakeup()