Exemplo n.º 1
0
    def draw_top_left_corner(self, cr):
        area = shapes.Area(0, 0, self.day_width * self.scale, self.height)

        shapes.labeled_box(
            cr,
            area,
            datetime.date.fromordinal(int(self.date + 1)).strftime("%x"),
            settings.corner_bg_color,
            settings.heading_outline_color,
            settings.text_color)
Exemplo n.º 2
0
    def draw_day_header(self, cr, nth_day):
        x = self.scale * (self.get_week_pixel_offset() + 
                          nth_day * self.day_width)

        leftmost_day = int(self.date)
        
        date = self.get_date(leftmost_day + nth_day)
        weekday = date.weekday()

        if weekday > 4:
            bgcolor = settings.weekday_bg_color
        else:
            bgcolor = settings.weekend_bg_color

        area = shapes.Area(x, 0, self.day_width * self.scale, self.height)

        shapes.labeled_box(
            cr,
            area,
            date.strftime("%a\n%x"),
            bgcolor,
            settings.heading_outline_color,
            settings.text_color)