[pitivi] elements: Switch to use Gtk.Overlay to display handles
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] elements: Switch to use Gtk.Overlay to display handles
- Date: Thu, 11 Jun 2015 09:16:37 +0000 (UTC)
commit f5495f59e59507114efa9470d0561875bdaca3fc
Author: Thibault Saunier <tsaunier gnome org>
Date: Sat May 2 10:53:05 2015 +0200
elements: Switch to use Gtk.Overlay to display handles
This way we can display handles on top of the TrackElements.
Differential Revision: http://phabricator.freedesktop.org/D118
pitivi/timeline/elements.py | 22 ++++++++++++++--------
pitivi/utils/ui.py | 5 +++--
2 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 3fd93ad..82ad897 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -481,6 +481,13 @@ class TrimHandle(Gtk.EventBox, Loggable):
self.get_style_context().add_class("Trimbar")
self.edge = edge
+ self.props.valign = Gtk.Align.FILL
+ self.props.width_request = 5
+ if edge == GES.Edge.EDGE_END:
+ self.props.halign = Gtk.Align.END
+ else:
+ self.props.halign = Gtk.Align.START
+
self.connect("event", self._eventCb)
self.connect("notify::window", self._windowSetCb)
@@ -710,18 +717,17 @@ class SourceClip(Clip):
super(SourceClip, self).__init__(layer, bClip)
def _setupWidget(self):
- self._vbox = Gtk.Box()
- self._vbox.set_orientation(Gtk.Orientation.HORIZONTAL)
- self.add(self._vbox)
-
- self.leftHandle = TrimHandle(self, GES.Edge.EDGE_START)
- self._vbox.pack_start(self.leftHandle, False, False, 0)
+ overlay = Gtk.Overlay()
+ self.add(overlay)
self._elements_container = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
- self._vbox.pack_start(self._elements_container, True, True, 0)
+ overlay.add_overlay(self._elements_container)
+
+ self.leftHandle = TrimHandle(self, GES.Edge.EDGE_START)
+ overlay.add_overlay(self.leftHandle)
self.rightHandle = TrimHandle(self, GES.Edge.EDGE_END)
- self._vbox.pack_end(self.rightHandle, False, False, 0)\
+ overlay.add_overlay(self.rightHandle)
self.handles.append(self.leftHandle)
self.handles.append(self.rightHandle)
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index a03952c..282b751 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -115,7 +115,8 @@ TIMELINE_CSS = """
}
.Trimbar {
- background-image: url('%(trimbar_normal)s');
+ background-image: url('%(trimbar_normal)s');
+ opacity:0.7;
}
.Trimbar:first-child {
@@ -131,7 +132,7 @@ TIMELINE_CSS = """
}
.PlayHead {
- background-color: red;
+ background-color: red;
}
.Clip {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]