[kupfer] ui: Center the result list under the two panes



commit eacbdedf8d6795327dd30a0173bd443749c237ab
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Mar 29 16:22:32 2011 +0200

    ui: Center the result list under the two panes
    
    The result list window has a fixed size equal to the two main panes,
    and is centered under them. This is true even if the indirect object
    pane is shown.

 kupfer/ui/browser.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index 124fd3c..5944f81 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -603,18 +603,16 @@ class Search (gtk.Bin):
 		pos_x, pos_y = self.window.get_position()
 		# find origin in parent's coordinates
 		self_x, self_y = self.translate_coordinates(self.get_parent(), 0, 0)
+		self_width = self.size_request()[0]
 		sub_x = pos_x
 		sub_y = pos_y + win_height
 		table_w, table_len = self.table.size_request()
-		subwin_height = min(table_len, 200)
-		subwin_width = self.list_window.size_request()[0]
+		subwin_height = min(table_len, 200) or 100
+		subwin_width = self_width*2 - self_x
 		if not text_direction_is_ltr():
 			sub_x += win_width - subwin_width + self_x
 		else:
 			sub_x -= self_x
-		if not subwin_height:
-			subwin_height = 200
-			subwin_width = win_width
 		self.list_window.move(sub_x, sub_y)
 		self.list_window.resize(subwin_width, subwin_height)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]