[gnome-clocks/clutter] small cleanups
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/clutter] small cleanups
- Date: Fri, 24 Aug 2012 12:40:12 +0000 (UTC)
commit d300858f18c3c553dd42266adc04a00ba6a03aea
Author: Seif Lotfy <seif lotfy com>
Date: Fri Aug 24 14:39:49 2012 +0200
small cleanups
gnomeclocks/widgets.py | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/gnomeclocks/widgets.py b/gnomeclocks/widgets.py
index f61264b..d108da3 100644
--- a/gnomeclocks/widgets.py
+++ b/gnomeclocks/widgets.py
@@ -675,20 +675,23 @@ class SelectableIconView(Gtk.IconView):
self.emit("item-activated", path)
return False
+def alphaGtkWidget(widget):
+ widget.override_background_color(0, Gdk.RGBA(0,0,0,0))
class SelectionToolbar():
def __init__(self, parent_actor):
self._parent_actor = parent_actor
- self.widget = Gtk.Toolbar()
- self.widget.set_show_arrow(False)
- self.widget.set_icon_size(Gtk.IconSize.LARGE_TOOLBAR)
+ self.widget = Gtk.Button()
+ self.widget.set_label("Delete") #FIXME: Make translatable
+ #self.widget.set_icon_size(Gtk.IconSize.LARGE_TOOLBAR)
self.widget.get_style_context().add_class('osd');
self.widget.set_size_request(SELECTION_TOOLBAR_DEFAULT_WIDTH, -1);
self.actor = GtkClutter.Actor.new_with_contents(self.widget)
self.actor.set_opacity(0)
- #Utils.alphaGtkWidget(self.actor.get_widget());
+ alphaGtkWidget(self.actor.get_widget())
+
constraint = Clutter.AlignConstraint()
constraint.set_source(self._parent_actor)
constraint.set_align_axis(Clutter.AlignAxis.X_AXIS)
@@ -697,14 +700,6 @@ class SelectionToolbar():
constraint.set_source(self._parent_actor)
constraint.set_align_axis(Clutter.AlignAxis.Y_AXIS)
constraint.set_factor(0.50)
-
- self._leftBox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
- self._leftGroup = Gtk.ToolItem()
- self._leftGroup.add(self._leftBox)
- self.widget.insert(self._leftGroup, -1);
- self._toolbarDelete = Gtk.Button("Delete") #FIXME: Make translatable
- self._leftBox.add(self._toolbarDelete);
- self._toolbarDelete.connect('clicked', self._on_toolbar_delete)
self.widget.show_all()
def _on_toolbar_delete(self, widget, event):
@@ -728,6 +723,7 @@ class SelectionToolbar():
# time: 0.30,
# transition: 'easeOutQuad' });
self.actor.opacity = 255
+ self.actor.show()
def _fade_out(self):
# FIXME: add tween
@@ -740,6 +736,7 @@ class SelectionToolbar():
# },
# onCompleteScope: this });
self.actor.opacity = 0
+ self.actor.hide()
class Embed (GtkClutter.Embed):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]