Rearranged the layout of the summary.

Putting the statuses on the left and the paths on the right
works better when the window is narrow, because the paths were
often invisible when on the left.
This commit is contained in:
Andrew Hamilton 2017-05-27 10:01:34 +01:00
parent fc741a8fd0
commit 1876793b34

9
vigil
View file

@ -113,8 +113,8 @@ class Entry(collections.UserList):
self.widget[self.highlighted] = self._get_cursor() self.widget[self.highlighted] = self._get_cursor()
new_appearance = self.widget.appearance_min() new_appearance = self.widget.appearance_min()
path = tools.path_colored(self.path) path = tools.path_colored(self.path)
padding = " " * (self.summary._max_path_length - len(path) + 1) padding = " " * (self.summary._max_width - len(self.widget) + 1)
new_appearance[0] = path + padding + new_appearance[0] new_appearance[0] = new_appearance[0] + padding + path
self.appearance_cache = appearance = new_appearance self.appearance_cache = appearance = new_appearance
return appearance return appearance
@ -311,7 +311,7 @@ class Summary:
def appearance(self, dimensions): def appearance(self, dimensions):
width, height = dimensions width, height = dimensions
x, y = self.cursor_position() x, y = self.cursor_position()
screen_x, screen_y = self._max_path_length + 1 + x, y screen_x, screen_y = x, y
width, height = width - 1, height - 1 # Minus one for the scrollbars width, height = width - 1, height - 1 # Minus one for the scrollbars
scroll_y = (screen_y // height) * height scroll_y = (screen_y // height) * height
self._view_widget.position = ((screen_x // width) * width, scroll_y) self._view_widget.position = ((screen_x // width) * width, scroll_y)
@ -766,8 +766,7 @@ class Screen:
return return
view_x, view_y = self._summary._view_widget.portal.position view_x, view_y = self._summary._view_widget.portal.position
spacer = 1 spacer = 1
column_index = (x - self._summary._max_path_length - spacer - column_index = x - border_width + view_x
border_width + view_x)
row_index = y - border_width + view_y row_index = y - border_width + view_y
if row_index >= len(self._summary._column): if row_index >= len(self._summary._column):
return return