diff options
author | hut <hut@lavabit.com> | 2010-04-13 12:24:36 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-13 12:38:38 +0200 |
commit | 76aee8ea8d40a52639a52bd3d6ade13d85159ca0 (patch) | |
tree | d189d3cc6e500bde51730842768d27ed4350affb /ranger | |
parent | 59698d9d1529646719b108ad6b8596e1383d533b (diff) | |
download | ranger-76aee8ea8d40a52639a52bd3d6ade13d85159ca0.tar.gz |
gui.bar: clean up
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/bar.py | 6 | ||||
-rw-r--r-- | ranger/gui/widgets/titlebar.py | 20 |
2 files changed, 11 insertions, 15 deletions
diff --git a/ranger/gui/bar.py b/ranger/gui/bar.py index 0ef840a4..8b8eb33c 100644 --- a/ranger/gui/bar.py +++ b/ranger/gui/bar.py @@ -96,9 +96,6 @@ class BarSide(list): def add(self, string, *lst, **kw): cs = ColoredString(string, self.base_color_tag, *lst) cs.__dict__.update(kw) - if 'fixedsize' in kw: - kw['fixed'] = kw['fixedsize'] - del kw['fixedsize'] self.append(cs) def add_space(self, n=1): @@ -121,11 +118,10 @@ class BarSide(list): class ColoredString(object): - fixed = False - def __init__(self, string, *lst): self.string = string self.lst = lst + self.fixed = False def cut_off(self, n): n = max(n, min(len(self.string), 1)) diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index ddcd03c3..b815a07e 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -106,16 +106,16 @@ class TitleBar(Widget): else: clr = 'good' - bar.add(self.env.username, 'hostname', clr, fixedsize=True) - bar.add('@', 'hostname', clr, fixedsize=True) - bar.add(self.env.hostname, 'hostname', clr, fixedsize=True) - bar.add(':', 'hostname', clr, fixedsize=True) + bar.add(self.env.username, 'hostname', clr, fixed=True) + bar.add('@', 'hostname', clr, fixed=True) + bar.add(self.env.hostname, 'hostname', clr, fixed=True) + bar.add(':', 'hostname', clr, fixed=True) pathway = self.env.pathway if self.settings.tilde_in_titlebar and \ self.fm.env.cwd.path.startswith(self.env.home_path): pathway = pathway[self.env.home_path.count('/')+1:] - bar.add('~/', 'directory', fixedsize=True) + bar.add('~/', 'directory', fixed=True) for path in pathway: if path.islink: @@ -124,22 +124,22 @@ class TitleBar(Widget): clr = 'directory' bar.add(path.basename, clr, directory=path) - bar.add('/', clr, fixedsize=True, directory=path) + bar.add('/', clr, fixed=True, directory=path) if self.env.cf is not None: - bar.add(self.env.cf.basename, 'file', fixedsize=True) + bar.add(self.env.cf.basename, 'file', fixed=True) def _get_right_part(self, bar): kb = str(self.env.keybuffer) self.old_keybuffer = kb - bar.addright(kb, 'keybuffer', fixedsize=True) - bar.addright(' ', 'space', fixedsize=True) + bar.addright(kb, 'keybuffer', fixed=True) + bar.addright(' ', 'space', fixed=True) self.tab_width = 0 if len(self.fm.tabs) > 1: for tabname in self.fm._get_tab_list(): self.tab_width += len(str(tabname)) + 1 clr = 'good' if tabname == self.fm.current_tab else 'bad' - bar.addright(' '+str(tabname), 'tab', clr, fixedsize=True) + bar.addright(' '+str(tabname), 'tab', clr, fixed=True) def _print_result(self, result): import _curses |