[pitivi] elements: Queue for redraw only the KeyframeCurve
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] elements: Queue for redraw only the KeyframeCurve
- Date: Fri, 11 Nov 2016 18:08:12 +0000 (UTC)
commit 211ef0ec9bf01bf65d30b577fd35539b87faf3c4
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sun Nov 6 17:38:05 2016 +0100
elements: Queue for redraw only the KeyframeCurve
The "plot-changed" signal of the KeyframeCurve was emitted in a single
place and used only by its TimelineElement parent to queue itself for
redraw. This is not necessary though. It's enough to queue for redraw
directly the KeyframeCurve. The parent container can handle this.
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1449
pitivi/timeline/elements.py | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index bd1f1be..ab1e218 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -79,8 +79,6 @@ class KeyframeCurve(FigureCanvas, Loggable):
YLIM_OVERRIDES[pspec] = values
__gsignals__ = {
- # Signal our values changed, and a redraw will be needed
- "plot-changed": (GObject.SIGNAL_RUN_LAST, None, ()),
# Signal the keyframes or the curve are being hovered
"enter": (GObject.SIGNAL_RUN_LAST, None, ()),
# Signal the keyframes or the curve are not being hovered anymore
@@ -205,7 +203,7 @@ class KeyframeCurve(FigureCanvas, Loggable):
self.__keyframes.set_offsets(arr)
self.__line.set_xdata(self.__line_xs)
self.__line.set_ydata(self.__line_ys)
- self.emit("plot-changed")
+ self.queue_draw()
def __maybeCreateKeyframe(self, event):
line_contains = self.__line.contains(event)[0]
@@ -490,8 +488,6 @@ class TimelineElement(Gtk.Layout, Zoomable, Loggable):
# Nothing to remove.
return
- self.keyframe_curve.disconnect_by_func(
- self.__keyframePlotChangedCb)
self.keyframe_curve.disconnect_by_func(self.__curveEnterCb)
self.keyframe_curve.disconnect_by_func(self.__curveLeaveCb)
self.remove(self.keyframe_curve)
@@ -516,8 +512,6 @@ class TimelineElement(Gtk.Layout, Zoomable, Loggable):
self.__removeKeyframes()
self.keyframe_curve = KeyframeCurve(self.timeline, binding)
- self.keyframe_curve.connect("plot-changed",
- self.__keyframePlotChangedCb)
self.keyframe_curve.connect("enter", self.__curveEnterCb)
self.keyframe_curve.connect("leave", self.__curveLeaveCb)
self.keyframe_curve.set_size_request(self.__width, self.__height)
@@ -571,9 +565,6 @@ class TimelineElement(Gtk.Layout, Zoomable, Loggable):
else:
self.remove(self.keyframe_curve)
- def __keyframePlotChangedCb(self, unused_curve):
- self.queue_draw()
-
# Virtual methods
def _getPreviewer(self):
"""Gets a Gtk.Widget to be used as previewer.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]