[pitivi] mediafilespreviewer: Keep the PreviewWidget size fixed
- From: Mathieu Duponchelle <mathieudu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] mediafilespreviewer: Keep the PreviewWidget size fixed
- Date: Mon, 10 Feb 2014 21:58:11 +0000 (UTC)
commit 510354e1f7fd12f26bf2857b809b7c77990b62d4
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sun Jan 19 00:09:14 2014 +0100
mediafilespreviewer: Keep the PreviewWidget size fixed
pitivi/mainwindow.py | 3 +--
pitivi/mediafilespreviewer.py | 16 +++++++---------
2 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index b96ec54..e43eac0 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -1258,11 +1258,10 @@ class PitiviMainWindow(Gtk.Window, Loggable):
preview_window.set_type_hint(Gdk.WindowTypeHint.UTILITY)
preview_window.set_transient_for(self)
preview_window.connect("focus-out-event", self._leavePreviewCb)
- previewer = PreviewWidget(self)
+ previewer = PreviewWidget(self, minimal=True)
preview_window.add(previewer)
previewer.previewUri(uri)
- previewer.setMinimal()
previewer.show()
controls_height = previewer.bbox.size_request().height
width, height = self._calculatePreviewWindowSize(uri, controls_height)
diff --git a/pitivi/mediafilespreviewer.py b/pitivi/mediafilespreviewer.py
index ca51abe..dd791ba 100644
--- a/pitivi/mediafilespreviewer.py
+++ b/pitivi/mediafilespreviewer.py
@@ -70,7 +70,7 @@ acceptable_tags = [
class PreviewWidget(Gtk.Grid, Loggable):
- def __init__(self, instance):
+ def __init__(self, instance, minimal=False):
Gtk.Grid.__init__(self)
Loggable.__init__(self)
@@ -102,8 +102,8 @@ class PreviewWidget(Gtk.Grid, Loggable):
# Gui elements:
# Drawing area for video output
self.preview_video = ViewerWidget(realizedCb=self._on_preview_video_realize_cb)
- self.preview_video.props.hexpand = False
- self.preview_video.props.vexpand = False
+ self.preview_video.props.hexpand = minimal
+ self.preview_video.props.vexpand = minimal
self.attach(self.preview_video, 0, 0, 1, 1)
# An image for images and audio
@@ -159,12 +159,10 @@ class PreviewWidget(Gtk.Grid, Loggable):
vbox.show()
self.attach(vbox, 0, 4, 1, 1)
- def setMinimal(self):
- self.remove(self.l_tags)
- self.b_zoom_in.hide()
- self.b_zoom_out.hide()
- # Allow expanding/filling and pack the video preview below the controls
- self.set_child_packing(self.preview_video, True, True, 0, Gtk.PackType.END)
+ if minimal:
+ self.remove(self.l_tags)
+ self.bbox.remove(self.b_zoom_in)
+ self.bbox.remove(self.b_zoom_out)
def add_preview_request(self, dialogbox):
"""add a preview request """
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]