Cleanup layouts patch

Fix bottom rect in horizontal layout not covering all windows. Fix pep8
issues. Add README and CHANGELOG entries.
This commit is contained in:
Kovid Goyal 2018-01-23 19:35:30 +05:30
parent a6a606ff3d
commit 9ad65f2e1d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 11 additions and 5 deletions

View File

@ -14,6 +14,8 @@ version 0.7.0 [future]
- Add option to override the default shell - Add option to override the default shell
- Add "Horizontal" and "Vertical" window layouts
- Sessions: Allow setting titles and working directories for individual windows - Sessions: Allow setting titles and working directories for individual windows
- Option to copy to clipboard on mouse select - Option to copy to clipboard on mouse select

View File

@ -265,8 +265,10 @@ hold down `ctrl+shift` and click on a URL to open it in a browser.
Currently, there are three layouts available, Currently, there are three layouts available,
* Stack -- Only a single maximized window is shown at a time * Stack -- Only a single maximized window is shown at a time
* Tall -- One window is shown full height on the left, the rest of the windows are shown one below the other on the right. * Tall -- One window is shown full height on the left, the rest of the windows are shown one below the other on the right
* Grid -- All windows are shown in a grid * Grid -- All windows are shown in a grid
* Horizontal -- All windows are shown side-by-side
* Vertical -- All windows are shown one below the other
You can switch between layouts using the {sc_next_layout} key combination. You can switch between layouts using the {sc_next_layout} key combination.

View File

@ -241,6 +241,7 @@ class Grid(Tall):
for i in range(ncols - 1): for i in range(ncols - 1):
self.between_blank_rect(win_col_map[i][0], win_col_map[i + 1][0]) self.between_blank_rect(win_col_map[i][0], win_col_map[i + 1][0])
class Vertical(Layout): class Vertical(Layout):
name = 'vertical' name = 'vertical'
@ -264,7 +265,7 @@ class Vertical(Layout):
# left, top and right blank rects # left, top and right blank rects
self.simple_blank_rects(windows[0], windows[-1]) self.simple_blank_rects(windows[0], windows[-1])
#bottom blank rect # bottom blank rect
self.bottom_blank_rect(windows[-1]) self.bottom_blank_rect(windows[-1])
@ -294,7 +295,8 @@ class Horizontal(Layout):
# left, top and right blank rects # left, top and right blank rects
self.simple_blank_rects(windows[0], windows[-1]) self.simple_blank_rects(windows[0], windows[-1])
#bottom blank rect # bottom blank rect
self.bottom_blank_rect(windows[0]) self.blank_rects.append(Rect(windows[0].geometry.left, windows[0].geometry.bottom, windows[-1].geometry.right, central.bottom + 1))
all_layouts = {o.name: o for o in globals().values() if isinstance(o, type) and issubclass(o, Layout) and o is not Layout} all_layouts = {o.name: o for o in globals().values() if isinstance(o, type) and issubclass(o, Layout) and o is not Layout}