Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2012-02-25 21:50:47 (GMT)
committer flavio <fdanesse@gmail.com>2012-02-25 21:50:47 (GMT)
commit593305608c6b537b5e4ad6ac065e7b6d4ef76d8e (patch)
tree8e6e5456159c6ab8bc934b3de98e142db25f6a48
parent832940f07a4a86c3e553cb7f3525e2f0ce920142 (diff)
Correcciones en la Grilla
-rw-r--r--GnomeMoonActivity.py10
-rw-r--r--Moonwidgets.py25
-rw-r--r--SugarMoonActivity.py10
3 files changed, 24 insertions, 21 deletions
diff --git a/GnomeMoonActivity.py b/GnomeMoonActivity.py
index 5103ce6..3bf6239 100644
--- a/GnomeMoonActivity.py
+++ b/GnomeMoonActivity.py
@@ -57,6 +57,7 @@ class MoonActivity(gtk.Window):
self.luna_hoy = None
self.label_emisferio = None
self.aspectframe = None
+ self.bufferinfo = None
self.set_layout()
@@ -139,6 +140,8 @@ class MoonActivity(gtk.Window):
self.main_view.pack_end(self.aspectframe, True, True, 5)
self.add(cajabase)
+ self.bufferinfo = gtk.TextBuffer()
+ self.info.set_buffer(self.bufferinfo)
self.mooncalendar.set_mes(anio, mes, fecha, hora)
self.update_text_information_view()
@@ -226,10 +229,9 @@ class MoonActivity(gtk.Window):
solare = {'date':time.strftime(MG.LOCALE_DATE_FORMAT, time.localtime(self.luna_hoy.data_model.next_solar_eclipse_date)),
'days':self.luna_hoy.data_model.days_until_solar_eclipse}
information += _("Next Solar eclipse:\n%(date)s in %(days).0f days") % solare
- text = gtk.TextBuffer()
- text.set_text(information)
- self.info.set_buffer(text)
- self.label_emisferio.set_text( "%s: %s" % (_("Vista Hemisferio"),_(self.luna_hoy.hemisphere_view)) )
+
+ self.bufferinfo.set_text(information)
+ self.label_emisferio.set_text( " %s: %s" % (_("Vista Hemisferio"),_(self.luna_hoy.hemisphere_view)) )
if __name__=="__main__":
MoonActivity()
diff --git a/Moonwidgets.py b/Moonwidgets.py
index e421bde..051e682 100644
--- a/Moonwidgets.py
+++ b/Moonwidgets.py
@@ -128,12 +128,14 @@ class CalendarButton(gtk.EventBox):
self.image_pixmap = gtk.gdk.Pixmap(self.window, self.imagen_size, self.imagen_size)
gc = self.image_pixmap.new_gc(foreground=MG.BACKGROUND)
self.image.set_from_pixmap(self.image_pixmap, None)
+
self.image_pixmap.draw_rectangle(gc, True, 0, 0, self.imagen_size, self.imagen_size)
# Create a 1bit shadow mask
mask_pixmap = gtk.gdk.Pixmap(None, self.imagen_size, self.imagen_size, depth=1)
kgc = mask_pixmap.new_gc(foreground=MG.BACKGROUND)
wgc = mask_pixmap.new_gc(foreground=MG.FOREGROUND)
+
mask_pixmap.draw_rectangle(kgc, True, 0, 0, self.imagen_size, self.imagen_size)
if self.data_model.phase_of_moon <= .25:
@@ -171,12 +173,12 @@ class CalendarButton(gtk.EventBox):
uno = (self.data_model.next_lunar_eclipse_sec == -1 and self.data_model.last_lunar_eclipse_sec > 7200)
dos = (self.data_model.next_lunar_eclipse_sec > 7200 and self.data_model.last_lunar_eclipse_sec == -1)
tres = min(self.data_model.next_lunar_eclipse_sec, self.data_model.last_lunar_eclipse_sec) > 7200
+
if uno or dos or tres:
#print "Normal Moon phase render"
moon_pixbuf.composite(dark_pixbuf, 0, 0, self.imagen_size, self.imagen_size, 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 127)
self.image_pixmap.draw_pixbuf(gc, dark_pixbuf, 0, 0, 0, 0) # parte oscura
self.image_pixmap.draw_pixbuf(maskgc, moon_pixbuf, 0, 0, 0, 0) # parte iluminada
-
else:
#print "Reddening eclipse effect, 2hrs (7200sec) before and after (by masking out green & blue)"
if self.data_model.next_lunar_eclipse_sec == -1:
@@ -201,18 +203,15 @@ class CalendarButton(gtk.EventBox):
self.image_pixmap.draw_pixbuf(gc, dark_pixbuf, 0, 0, 0, 0)
if self.hemisphere_view == _('Sur'):
- #print "Rotate final image for a view from Norte or Sur hemisphere"
- rot_pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, self.imagen_size, self.imagen_size)
- rot_pixbuf.get_from_drawable(self.image_pixmap, self.image_pixmap.get_colormap(), 0, 0, 0, 0, -1, -1)
- rot_pixbuf = rot_pixbuf.rotate_simple(gtk.gdk.PIXBUF_ROTATE_UPSIDEDOWN)
- self.image_pixmap.draw_pixbuf(gc, rot_pixbuf, 0, 0, 0, 0)
-
- if self.show_grid:
- # Draw grid rotated for Sur hemi
- self.draw_grid(_("SNWE"))
- elif self.show_grid:
- # Draw grid for Norte hemi
- self.draw_grid(_("NSEW"))
+ #print "Rotate final image for a view from Norte or Sur hemisphere"
+ rot_pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, self.imagen_size, self.imagen_size)
+ rot_pixbuf.get_from_drawable(self.image_pixmap, self.image_pixmap.get_colormap(), 0, 0, 0, 0, -1, -1)
+ rot_pixbuf = rot_pixbuf.rotate_simple(gtk.gdk.PIXBUF_ROTATE_UPSIDEDOWN)
+ self.image_pixmap.draw_pixbuf(gc, rot_pixbuf, 0, 0, 0, 0)
+
+ if self.show_grid: self.draw_grid(_("SNWE"))
+ else:
+ if self.show_grid: self.draw_grid(_("NSEW"))
def draw_grid(self, compass_text):
# Draw Selenographic grid line data.
diff --git a/SugarMoonActivity.py b/SugarMoonActivity.py
index 2e26742..4f9210a 100644
--- a/SugarMoonActivity.py
+++ b/SugarMoonActivity.py
@@ -60,6 +60,7 @@ class MoonActivity(activity.Activity):
self.luna_hoy = None
self.label_emisferio = None
self.aspectframe = None
+ self.bufferinfo = None
self.activity_state = {}
self.max_participants = 1
@@ -214,6 +215,8 @@ class MoonActivity(activity.Activity):
self.main_view.pack_end(event, True, True, 5)
self.set_canvas(cajabase)
+ self.bufferinfo = gtk.TextBuffer()
+ self.info.set_buffer(self.bufferinfo)
self.mooncalendar.set_mes(anio, mes, fecha, hora)
self.update_text_information_view()
@@ -297,10 +300,9 @@ class MoonActivity(activity.Activity):
solare = {'date':time.strftime(MG.LOCALE_DATE_FORMAT, time.localtime(self.luna_hoy.data_model.next_solar_eclipse_date)),
'days':self.luna_hoy.data_model.days_until_solar_eclipse}
information += _("Next Solar eclipse:\n%(date)s in %(days).0f days") % solare
- text = gtk.TextBuffer()
- text.set_text(information)
- self.info.set_buffer(text)
- self.label_emisferio.set_text( "%s: %s" % (_("Vista Hemisferio"),_(self.luna_hoy.hemisphere_view)) )
+
+ self.bufferinfo.set_text(information)
+ self.label_emisferio.set_text( " %s: %s" % (_("Vista Hemisferio"),_(self.luna_hoy.hemisphere_view)) )
def read_and_parse_prefs(self, file_path):
try: