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:
parent
a6a606ff3d
commit
9ad65f2e1d
@ -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
|
||||||
|
|||||||
@ -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.
|
||||||
|
|
||||||
|
|||||||
@ -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'
|
||||||
@ -256,7 +257,7 @@ class Vertical(Layout):
|
|||||||
|
|
||||||
xlayout = self.xlayout(1)
|
xlayout = self.xlayout(1)
|
||||||
xstart, xnum = next(xlayout)
|
xstart, xnum = next(xlayout)
|
||||||
ylayout = self.ylayout(window_count)
|
ylayout = self.ylayout(window_count)
|
||||||
|
|
||||||
for i in range(window_count):
|
for i in range(window_count):
|
||||||
ystart, ynum = next(ylayout)
|
ystart, ynum = next(ylayout)
|
||||||
@ -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}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user