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)
 
/a> 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449