summaryrefslogtreecommitdiff
path: root/portato/gui/gtk/windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui/gtk/windows.py')
-rw-r--r--portato/gui/gtk/windows.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index d154ab1..fb9836c 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -105,7 +105,7 @@ class UpdateWindow (AbstractDialog):
def __init__ (self, parent, packages, queue, jump_to):
AbstractDialog.__init__(self, parent)
-
+
self.queue = queue
self.jump = jump_to
@@ -132,6 +132,21 @@ class UpdateWindow (AbstractDialog):
for p in self.packages:
store.append([False, p.get_cpv()])
+ def cb_set_size (self, *args):
+ """
+ This callback is called shortly before drawing.
+ It calculates the optimal size of the window.
+ The optimum is defined as: as large as possible w/o scrollbars
+ """
+
+ bb = self.tree.get_widget("updateBB")
+ vals = (self.view.get_vadjustment().upper+bb.size_request()[1]+10, # max size of list + size of BB + constant
+ self.parent.get_size()[1]) # size of the parent -> maximum size
+ debug("Size values for the list and for the parent: %d / %d", *vals)
+ val = int(min(vals))
+ debug("Minimum value: %d", val)
+ self.window.set_geometry_hints(self.window, min_height = val)
+
def cb_select_all_clicked (self, btn):
model = self.view.get_model()
iter = model.get_iter_first()
@@ -789,9 +804,7 @@ class MainWindow (Window):
# main window stuff
Window.__init__(self)
self.window.set_title(self.main_title)
- mHeight = 800
- if gtk.gdk.screen_height() <= 800: mHeight = 600
- self.window.set_geometry_hints (self.window, min_width = 600, min_height = mHeight, max_height = gtk.gdk.screen_height(), max_width = gtk.gdk.screen_width())
+ self.window.set_geometry_hints (self.window, max_height = gtk.gdk.screen_height(), max_width = gtk.gdk.screen_width())
# booleans
self.doUpdate = False
@@ -837,7 +850,7 @@ class MainWindow (Window):
splash(_("Building frontend"))
# set vpaned position
self.vpaned = self.tree.get_widget("vpaned")
- self.vpaned.set_position(int(mHeight/2))
+ self.vpaned.set_position(int(self.window.get_size()[1]/2))
# cat and pkg list
self.sortPkgListByName = True
ers/feed2imap.git/commit/lib/feed2imap/maildir.rb?h=ruby22&id=94dc1db641f98242496a32409e823920f4e700e9&follow=1'>Patch to use feed item pubDate in Maildir file namesBernie Maier1-6/+10 2010-04-18update websiteLucas Nussbaum2-2/+15 2010-04-18prepare releaseLucas Nussbaum4-5/+5 2010-04-18provide a way to disable SSL certificate verificationLucas Nussbaum4-1/+12 2010-04-18update changelogLucas Nussbaum1-0/+4 2010-04-18Update rubyimap.rbLucas Nussbaum1-5/+38 2010-03-17Document the maildir targetSandra Snan3-5/+5 2009-12-26Avoid using "acme.com"Lucas Nussbaum4-10/+19 2009-09-04fix to use Message-Id instead of X-CacheIndexLucas Nussbaum1-5/+2 2009-09-03added the forth arg to ConfigFeed::new for maildirLucas Nussbaum1-1/+1