[pitivi] layer: Disable moving layer down/bottom when last
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] layer: Disable moving layer down/bottom when last
- Date: Fri, 2 Oct 2015 12:46:58 +0000 (UTC)
commit 286001ffbb7a95c6ff8745409110789b9db70786
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Fri Oct 2 14:41:56 2015 +0200
layer: Disable moving layer down/bottom when last
Summary: Depends on D283
Reviewers: thiblahute
Reviewed By: thiblahute
Differential Revision: https://phabricator.freedesktop.org/D284
pitivi/timeline/layer.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index e48ce6a..fa55549 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -342,6 +342,9 @@ class LayerControls(Gtk.EventBox, Loggable):
self.__move_layer_up_action.props.enabled = not first
self.__move_layer_top_action.props.enabled = not first
layers_count = len(self.bTimeline.get_layers())
+ last = priority == layers_count - 1
+ self.__move_layer_down_action.props.enabled = not last
+ self.__move_layer_bottom_action.props.enabled = not last
self.__delete_layer_action.props.enabled = layers_count > 1
def __createMenuModel(self):
@@ -360,12 +363,14 @@ class LayerControls(Gtk.EventBox, Loggable):
action_group.insert(action)
menu_model.append(_("Move layer up"), "layer.%s" % action.get_name().replace(" ", "."))
- action = Gio.SimpleAction.new("move_layer_down", None)
+ self.__move_layer_down_action = Gio.SimpleAction.new("move_layer_down", None)
+ action = self.__move_layer_down_action
action.connect("activate", self._moveLayerCb, 1)
action_group.insert(action)
menu_model.append(_("Move layer down"), "layer.%s" % action.get_name().replace(" ", "."))
- action = Gio.SimpleAction.new("move_layer_to_bottom", None)
+ self.__move_layer_bottom_action = Gio.SimpleAction.new("move_layer_to_bottom", None)
+ action = self.__move_layer_bottom_action
action.connect("activate", self._moveLayerCb, 2)
action_group.insert(action)
menu_model.append(_("Move layer to bottom"), "layer.%s" % action.get_name().replace(" ", "."))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]