summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-28 23:25:49 +0100
committerhut <hut@lavabit.com>2009-12-28 23:25:49 +0100
commitb19e53f9f6b25bfcc6c5e03f7078c8d0a14790e1 (patch)
treeda4e124d0471041c45006ad8476c6ede730a5e0e /ranger
parentf376e337c0fd4a0a855bc868de3cb94865ca77c4 (diff)
downloadranger-b19e53f9f6b25bfcc6c5e03f7078c8d0a14790e1.tar.gz
sub-windows are working well now
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/displayable.py11
-rw-r--r--ranger/gui/widgets/console.py3
-rw-r--r--ranger/gui/widgets/filelist.py40
3 files changed, 27 insertions, 27 deletions
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 4604f881..e876927b 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -140,13 +140,16 @@ class Displayable(EnvironmentAware, FileManagerAware, SettingsAware):
 			if y + hei > maxy:
 				raise OutOfBoundsException("Y out of bounds!")
 
-		self.win.mvderwin(0, 0)
 		try:
 			self.win.resize(hei, wid)
 		except:
-			log(self.__class__)
-			log("failed to resize {0}x{1}  {2}x{3}".format(y,x,hei,wid))
-		log("moving {2} to {0}x{1}".format(y, x, self.__class__.__name__))
+			# Not enough space for resizing...
+			try:
+				self.win.mvderwin(0, 0)
+				self.win.resize(hei, wid)
+			except:
+				raise OutOfBoundsException("Resizing Failed!")
+
 		self.win.mvderwin(y, x)
 		self.absx = x
 		self.absy = y
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 2d3f9b4c..52a8963b 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -46,7 +46,8 @@ class Console(Widget):
 
 	def finalize(self):
 		try:
-			self.win.move(self.y, self.x + self.pos + len(self.prompt))
+			self.fm.ui.win.move(self.absy,
+					self.absx + self.pos + len(self.prompt))
 		except:
 			pass
 
diff --git a/ranger/gui/widgets/filelist.py b/ranger/gui/widgets/filelist.py
index 9bbfb8f6..12f0c99a 100644
--- a/ranger/gui/widgets/filelist.py
+++ b/ranger/gui/widgets/filelist.py
@@ -2,6 +2,7 @@
 from . import Widget
 from ..displayable import DisplayableContainer
 from .pager import Pager
+from ranger import log
 
 class FileList(Widget, DisplayableContainer):
 	main_display = False
@@ -208,32 +209,27 @@ class FileList(Widget, DisplayableContainer):
 				this_color.append(drawed.exists and 'good' or 'bad')
 
 			string = drawed.basename
-			if self.main_display:
-				if tagged:
-					if self.wid > 1:
-						self.win.addnstr(self.y + line, self.x,
+			try:
+				if self.main_display:
+					if tagged:
+						if self.wid > 1:
+							self.win.addnstr(self.y + line, self.x,
+									text, self.wid - 2)
+					elif self.wid > 2:
+						self.win.addnstr(self.y + line, self.x + 1,
 								text, self.wid - 2)
-				elif self.wid > 2:
-					self.win.addnstr(self.y + line, self.x + 1,
-							text, self.wid - 2)
-			else:
-				try:
+				else:
 					self.win.addnstr(self.y + line, self.x, text, self.wid)
-				except:
-					# the last string will cause an error because
-					# ncurses tries to move out of the bounds
-					pass
 
-			if self.display_infostring and drawed.infostring:
-				info = drawed.infostring
-				x = self.x + self.wid - 1 - len(info)
-				if x > self.x:
-					try:
+				if self.display_infostring and drawed.infostring:
+					info = drawed.infostring
+					x = self.x + self.wid - 1 - len(info)
+					if x > self.x:
 						self.win.addstr(self.y + line, x, str(info) + ' ')
-					except:
-						# the last string will cause an error because
-						# ncurses tries to move out of the bounds
-						pass
+			except:
+				# the last string will cause an error because
+				# ncurses tries to move out of the bounds
+				pass
 
 			self.color_at(self.y + line, self.x, self.wid, this_color)
 
'/akspecs/ranger/blame/TODO?h=v1.5.1&id=23236d0cfd081305a8fd93428ab842d7814df380'>^
d955e3f0 ^
75013dc7 ^
67bb838c ^
a808a661 ^
bba8d293 ^
2a64495f ^
5e449699 ^
6f43de0a ^




fca1fc4f ^
ab65b353 ^

b2d63ef5 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50