summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-29 18:23:05 +0100
committerhut <hut@lavabit.com>2009-12-29 18:23:05 +0100
commitacde88ad401904abab55bfc259cb74c6d5e661a6 (patch)
treee43ce524eafb7ecf87929883dbe1b1ec9115e7b5
parentd3eff0a94e7122a05f53be4021050cac98f929ee (diff)
downloadranger-acde88ad401904abab55bfc259cb74c6d5e661a6.tar.gz
fixed widget problems
-rw-r--r--ranger/gui/defaultui.py2
-rw-r--r--ranger/gui/displayable.py12
-rw-r--r--ranger/gui/widgets/notify.py2
3 files changed, 12 insertions, 4 deletions
diff --git a/ranger/gui/defaultui.py b/ranger/gui/defaultui.py
index 135ef0b5..462d394d 100644
--- a/ranger/gui/defaultui.py
+++ b/ranger/gui/defaultui.py
@@ -42,7 +42,7 @@ class DefaultUI(UI):
 		UI.update_size(self)
 		y, x = self.env.termsize
 
-		notify_hei = self.notify.requested_height
+		notify_hei = min(max(1, y - 4), self.notify.requested_height)
 
 		self.filelist_container.resize(1, 0, y - 1 - notify_hei, x)
 		self.pman.resize(1, 0, y - 1 - notify_hei, x)
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index f54a3fc7..a9c297b5 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -56,12 +56,20 @@ class Displayable(EnvironmentAware, FileManagerAware, SettingsAware):
 	def color(self, keylist = None, *keys):
 		"""Change the colors from now on."""
 		keys = combine(keylist, keys)
-		self.win.attrset(self.colorscheme.get_attr(*keys))
+		attr = self.colorscheme.get_attr(*keys)
+		try:
+			self.win.attrset(attr)
+		except:
+			pass
 
 	def color_at(self, y, x, wid, keylist = None, *keys):
 		"""Change the colors at the specified position"""
 		keys = combine(keylist, keys)
-		self.win.chgat(y, x, wid, self.colorscheme.get_attr(*keys))
+		attr = self.colorscheme.get_attr(*keys)
+		try:
+			self.win.chgat(y, x, wid, attr)
+		except:
+			pass
 	
 	def color_reset(self):
 		"""Change the colors to the default colors"""
diff --git a/ranger/gui/widgets/notify.py b/ranger/gui/widgets/notify.py
index e3f972ee..8b783fdb 100644
--- a/ranger/gui/widgets/notify.py
+++ b/ranger/gui/widgets/notify.py
@@ -33,7 +33,7 @@ class Notify(Widget):
 			self.color_at(i, 0, self.wid,\
 					'in_notify', 'background', how)
 			self.color('in_notify', 'message', how)
-			self.win.addnstr(i, 0, msg.text, self.wid)
+			self.addstr(i, 0, msg.text)
 			i += 1
 
 		self.color_reset()