From 9e65505ce3d6fa7f21b92cf8d2b2289a25fc8036 Mon Sep 17 00:00:00 2001 From: flavio Date: Tue, 08 Jan 2013 13:49:47 +0000 Subject: Port SugarMoon --- (limited to 'GnomeMoonActivity.py') diff --git a/GnomeMoonActivity.py b/GnomeMoonActivity.py index 33931c5..e284b8f 100755 --- a/GnomeMoonActivity.py +++ b/GnomeMoonActivity.py @@ -25,7 +25,7 @@ # Febrero 2012 # Correcciones, Simplificación y Reestructuración Modular: # Desarrollo de CalendarButton + MoonCalendar: -# Instalador y Portado a gnome: +# Instalador y Portado a gnome y Gtk 3: # Flavio Danesse CeibalJAM! - Uruguay - Activity Central import os @@ -101,7 +101,8 @@ class MoonActivity(Gtk.Window): boton = Gtk.ToggleToolButton() boton.connect('clicked', self.toggle_grid_clicked) - pixbuf= GdkPixbuf.Pixbuf.new_from_file_at_size(os.path.join(MG.ICONOS,'grid-ico.svg'), 32, 32) + pixbuf= GdkPixbuf.Pixbuf.new_from_file_at_size( + os.path.join(MG.ICONOS,'grid-ico.svg'), 32, 32) imagen = Gtk.Image() imagen.set_from_pixbuf(pixbuf) boton.set_icon_widget(imagen) @@ -112,7 +113,8 @@ class MoonActivity(Gtk.Window): boton = Gtk.ToggleToolButton() boton.connect('clicked', self.toggle_hemisphere_clicked) - pixbuf= GdkPixbuf.Pixbuf.new_from_file_at_size(os.path.join(MG.ICONOS,'hemi-ico.svg'), 32, 32) + pixbuf= GdkPixbuf.Pixbuf.new_from_file_at_size( + os.path.join(MG.ICONOS,'hemi-ico.svg'), 32, 32) imagen = Gtk.Image() imagen.set_from_pixbuf(pixbuf) boton.set_icon_widget(imagen) @@ -123,7 +125,8 @@ class MoonActivity(Gtk.Window): boton = Gtk.ToggleToolButton() boton.connect('clicked', self.switch_calendar_luna) - pixbuf= GdkPixbuf.Pixbuf.new_from_file_at_size(os.path.join(MG.ICONOS,'calendario-ico.svg'), 32, 32) + pixbuf= GdkPixbuf.Pixbuf.new_from_file_at_size( + os.path.join(MG.ICONOS,'calendario-ico.svg'), 32, 32) imagen = Gtk.Image() imagen.set_from_pixbuf(pixbuf) boton.set_icon_widget(imagen) @@ -167,12 +170,17 @@ class MoonActivity(Gtk.Window): def toggle_grid_clicked(self, widget= None): self.luna_hoy.toggle_grid_clicked() - self.mooncalendar.toggle_grid_clicked(widget= None, actualizar = self.mooncalendar in self.aspectframe.get_children()) + + self.mooncalendar.toggle_grid_clicked( + widget = None, + actualizar = self.mooncalendar in self.aspectframe.get_children()) def toggle_hemisphere_clicked(self, widget= None): self.luna_hoy.toggle_hemisphere_clicked() - self.mooncalendar.toggle_hemisphere_clicked(widget= None, actualizar = self.mooncalendar in self.aspectframe.get_children()) + self.mooncalendar.toggle_hemisphere_clicked( + widget = None, + actualizar = self.mooncalendar in self.aspectframe.get_children()) def switch_calendar_luna(self, widget): @@ -192,6 +200,7 @@ class MoonActivity(Gtk.Window): def handle(self): self.update_text_information_view() + if self.luna_hoy in self.aspectframe.get_children(): self.luna_hoy.actualizar() @@ -200,11 +209,10 @@ class MoonActivity(Gtk.Window): def repaint(self, widget= None, event= None): rect = self.luna_hoy.get_allocation() - anchoboton, altoboton = (rect.width, rect.height) - tamanioboton = min( [anchoboton,altoboton] ) - self.luna_hoy.repaint(tamanioboton) + self.luna_hoy.repaint(min( [rect.width, rect.height] )) def delete_event(self, widget, event, data=None): + sys.exit(0) return False -- cgit v0.9.1