Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Moonwidgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'Moonwidgets.py')
-rw-r--r--Moonwidgets.py25
1 files changed, 12 insertions, 13 deletions
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.