[pitivi] Add images to layer popup menu
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Add images to layer popup menu
- Date: Sat, 21 Jul 2012 20:01:23 +0000 (UTC)
commit 8e1b96a44a3d437c25061c663435b8a7537f6183
Author: Paul Lange <palango gmx de>
Date: Wed Jul 11 20:20:22 2012 +0200
Add images to layer popup menu
Also rename LayerControls _layer to layer
pitivi/timeline/layer.py | 16 ++++++++++------
pitivi/timeline/timeline.py | 10 +++++-----
2 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index b6ebdb0..d5daed2 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -44,7 +44,7 @@ class BaseLayerControl(gtk.VBox, Loggable):
Loggable.__init__(self)
self._app = app
- self._layer = layer
+ self.layer = layer
self._selected = False
# get the default colour for the current theme
@@ -119,18 +119,22 @@ class BaseLayerControl(gtk.VBox, Loggable):
self.show_all()
# Popup Menu
- # TODO: add icons
self.popup = gtk.Menu()
layer_delete = gtk.ImageMenuItem(_("_Delete layer"))
layer_delete.connect("activate", self._deleteLayerCb)
+ layer_delete.set_image(gtk.image_new_from_icon_name("edit-delete", gtk.ICON_SIZE_MENU))
layer_up = gtk.ImageMenuItem(_("Move layer up"))
layer_up.connect("activate", self._moveLayerCb, -1)
+ layer_up.set_image(gtk.image_new_from_icon_name("go-up", gtk.ICON_SIZE_MENU))
layer_down = gtk.ImageMenuItem(_("Move layer down"))
layer_down.connect("activate", self._moveLayerCb, 1)
+ layer_down.set_image(gtk.image_new_from_icon_name("go-down", gtk.ICON_SIZE_MENU))
layer_first = gtk.ImageMenuItem(_("Move layer to top"))
layer_first.connect("activate", self._moveLayerCb, -2)
+ layer_first.set_image(gtk.image_new_from_icon_name("go-top", gtk.ICON_SIZE_MENU))
layer_last = gtk.ImageMenuItem(_("Move layer to bottom"))
layer_last.connect("activate", self._moveLayerCb, 2)
+ layer_last.set_image(gtk.image_new_from_icon_name("go-bottom", gtk.ICON_SIZE_MENU))
self.popup.append(layer_first)
self.popup.append(layer_up)
@@ -182,7 +186,7 @@ class BaseLayerControl(gtk.VBox, Loggable):
"""
if button.get_active():
# Disable all other layers
- self._app.gui.timeline_ui.controls.soloLayer(self._layer)
+ self._app.gui.timeline_ui.controls.soloLayer(self.layer)
else:
# Enable all layers
self._app.gui.timeline_ui.controls.soloLayer(None)
@@ -211,8 +215,8 @@ class BaseLayerControl(gtk.VBox, Loggable):
return True
def _deleteLayerCb(self, widget):
- timeline = self._layer.get_timeline()
- timeline.remove_layer(self._layer)
+ timeline = self.layer.get_timeline()
+ timeline.remove_layer(self.layer)
def _moveLayerCb(self, widget, step):
index = self._app.gui.timeline_ui.controls.getControlIndex(self)
@@ -221,7 +225,7 @@ class BaseLayerControl(gtk.VBox, Loggable):
elif step == -2:
index = 0
else:
- index = self._layer.get_timeline().get_layers()
+ index = self.layer.get_timeline().get_layers()
self._app.gui.timeline_ui.controls.moveControlWidget(self, index)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index fbbf88f..621db57 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -571,9 +571,9 @@ class TimelineControls(gtk.VBox, Loggable):
middle = len(self.get_children()) / 2
for child in self.get_children():
if isinstance(child, VideoLayerControl):
- self.reorder_child(child, child._layer.get_priority())
+ self.reorder_child(child, child.layer.get_priority())
elif isinstance(child, AudioLayerControl):
- self.reorder_child(child, middle + child._layer.get_priority())
+ self.reorder_child(child, middle + child.layer.get_priority())
def _hideLastSeparator(self):
if self.children():
@@ -601,7 +601,7 @@ class TimelineControls(gtk.VBox, Loggable):
def getYOfLayer(self, track_type, layer):
y = 0
for child in self.get_children():
- if layer == child._layer and \
+ if layer == child.layer and \
isinstance(child, self.type_map[track_type]):
return y
@@ -664,7 +664,7 @@ class TimelineControls(gtk.VBox, Loggable):
"""
Select layer_control and unselect all other controls
"""
- layer = layer_control._layer
+ layer = layer_control.layer
# if selected layer changed
if self._selected_layer != layer:
self._selected_layer = layer
@@ -740,7 +740,7 @@ class TimelineControls(gtk.VBox, Loggable):
for child in self.get_children():
# only set layer priority once
if type(child) == widget_type:
- child._layer.set_priority(index)
+ child.layer.set_priority(index)
index += 1
# order controls and update separators
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]