summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-13 12:24:36 +0200
committerhut <hut@lavabit.com>2010-04-13 12:38:38 +0200
commit76aee8ea8d40a52639a52bd3d6ade13d85159ca0 (patch)
treed189d3cc6e500bde51730842768d27ed4350affb
parent59698d9d1529646719b108ad6b8596e1383d533b (diff)
downloadranger-76aee8ea8d40a52639a52bd3d6ade13d85159ca0.tar.gz
gui.bar: clean up
-rw-r--r--ranger/gui/bar.py6
-rw-r--r--ranger/gui/widgets/titlebar.py20
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69