Coding style
- Rename appearance to appearance_for.
This commit is contained in:
parent
d9e95c1485
commit
45af588792
2 changed files with 8 additions and 8 deletions
|
|
@ -332,7 +332,7 @@ class DiffEditor:
|
||||||
line[-1] = "↓"
|
line[-1] = "↓"
|
||||||
return columns
|
return columns
|
||||||
|
|
||||||
def appearance(self, dimensions):
|
def appearance_for(self, dimensions):
|
||||||
width, height = self.last_dimensions = dimensions
|
width, height = self.last_dimensions = dimensions
|
||||||
if self.diff is None:
|
if self.diff is None:
|
||||||
self.update_diff()
|
self.update_diff()
|
||||||
|
|
@ -340,8 +340,8 @@ class DiffEditor:
|
||||||
divider_width = 3
|
divider_width = 3
|
||||||
left_width = (width - divider_width) // 2
|
left_width = (width - divider_width) // 2
|
||||||
right_width = width - divider_width - left_width
|
right_width = width - divider_width - left_width
|
||||||
left_appearance = self.left_editor.appearance((left_width, height))
|
left_appearance = self.left_editor.appearance_for((left_width, height))
|
||||||
right_appearance = self.right_editor.appearance((right_width, height))
|
right_appearance = self.right_editor.appearance_for((right_width, height))
|
||||||
inactive_appearance = (right_appearance if self.left_editor is self.editors[0]
|
inactive_appearance = (right_appearance if self.left_editor is self.editors[0]
|
||||||
else left_appearance)
|
else left_appearance)
|
||||||
inactive_appearance[0] = highlight_str(inactive_appearance[0], termstr.Color.black, 0.5)
|
inactive_appearance[0] = highlight_str(inactive_appearance[0], termstr.Color.black, 0.5)
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ class Text:
|
||||||
def appearance_min(self):
|
def appearance_min(self):
|
||||||
return self.text
|
return self.text
|
||||||
|
|
||||||
def appearance(self, dimensions):
|
def appearance_for(self, dimensions):
|
||||||
return fill3.appearance_resize(self.appearance_min(), dimensions)
|
return fill3.appearance_resize(self.appearance_min(), dimensions)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -141,8 +141,8 @@ class Decor:
|
||||||
self.widget = widget
|
self.widget = widget
|
||||||
self.decorator = decorator
|
self.decorator = decorator
|
||||||
|
|
||||||
def appearance(self, dimensions):
|
def appearance_for(self, dimensions):
|
||||||
return self.decorator(self.widget.appearance(dimensions))
|
return self.decorator(self.widget.appearance_for(dimensions))
|
||||||
|
|
||||||
def appearance_min(self):
|
def appearance_min(self):
|
||||||
return self.decorator(self.widget.appearance_min())
|
return self.decorator(self.widget.appearance_min())
|
||||||
|
|
@ -623,13 +623,13 @@ class Editor:
|
||||||
return (termstr.TermStr(" " + path_part, self._HEADER_STYLE).bold() +
|
return (termstr.TermStr(" " + path_part, self._HEADER_STYLE).bold() +
|
||||||
termstr.TermStr(cursor_position + " ", self._HEADER_STYLE))
|
termstr.TermStr(cursor_position + " ", self._HEADER_STYLE))
|
||||||
|
|
||||||
def appearance(self, dimensions):
|
def appearance_for(self, dimensions):
|
||||||
width, height = dimensions
|
width, height = dimensions
|
||||||
is_changed = self.text_widget.actual_text != self.original_text
|
is_changed = self.text_widget.actual_text != self.original_text
|
||||||
header = self.get_header(self.path, width, self.cursor_x, self.cursor_y, is_changed)
|
header = self.get_header(self.path, width, self.cursor_x, self.cursor_y, is_changed)
|
||||||
self.last_width = width
|
self.last_width = width
|
||||||
self.last_height = height
|
self.last_height = height
|
||||||
result = [header] + self.view_widget.appearance((width, height - 1))
|
result = [header] + self.view_widget.appearance_for((width, height - 1))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
KEY_MAP = {
|
KEY_MAP = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue