[pitivi] viewer: Fix the AspectFrame size request algorithm
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] viewer: Fix the AspectFrame size request algorithm
- Date: Wed, 18 Nov 2015 21:14:00 +0000 (UTC)
commit 25d467909d08a20ac71f1052606ae14aa1493a21
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date: Mon Nov 16 17:15:20 2015 -0500
viewer: Fix the AspectFrame size request algorithm
This behaves better on normal screen resolutions, especially 1280x800
pitivi/viewer.py | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 063a06c..d2eb20e 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -145,16 +145,14 @@ class ViewerContainer(Gtk.Box, Loggable):
self.pack_start(self.target, True, True, 0)
screen = Gdk.Screen.get_default()
height = screen.get_height()
- # Force the aspect frame to have at least the same width as
- # the toolbar +110 (magic number to minimize dead padding).
+ # Force the AspectFrame to be tall (and wide) enough to look good.
# TODO: review this code to create a smarter algorithm,
# and use get_preferred_size() instead of size_request()
- if not self._compactMode and height >= 800:
+ if not self._compactMode:
req = self.buttons.size_request()
width = req.width
- height = req.height
- width += 110
height = int(width / self.target.props.ratio)
+ width += 110 # Magic number to minimize dead padding
self.target.set_size_request(width, height)
else:
self.external_vbox.pack_start(self.target, False, False, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]