Added day dependent event prefixes

This commit is contained in:
Maximilian Giller 2019-04-05 22:07:47 +02:00
parent 4b656ee819
commit afd94ea10f
3 changed files with 7 additions and 5 deletions

View file

@ -3,7 +3,7 @@ from Assets import defaultfontsize, colors
from datetime import datetime, date, timedelta from datetime import datetime, date, timedelta
from TableTextDesign import TableTextDesign from TableTextDesign import TableTextDesign
from PIL import ImageDraw from PIL import ImageDraw
from TextFormatter import date_summary_str, event_time_detailed from TextFormatter import date_summary_str, event_prefix_str
line_width = 1 line_width = 1
@ -44,7 +44,7 @@ class AgendaListDesign (DesignEntity):
else: else:
row.append("") row.append("")
row.append(event_time_detailed(event)) row.append(event_prefix_str(event, fetch_day))
row.append(event.title) row.append(event.title)
self.infos.append(row) self.infos.append(row)

View file

@ -65,7 +65,8 @@ class DayHeaderDesign (DesignEntity):
size = (self.size[0] - pos[0] - weather_width, self.size[1] - pos[1] - box_ypos) size = (self.size[0] - pos[0] - weather_width, self.size[1] - pos[1] - box_ypos)
fontsize = eventlist_y_fontsize * self.size[1] fontsize = eventlist_y_fontsize * self.size[1]
event_list = SingelDayEventListDesign(size, events, fontsize) rel_dates = [self.date for _ in range(len(events))]
event_list = SingelDayEventListDesign(size, events, fontsize, event_prefix_rel_dates = rel_dates)
event_list.pos = pos event_list.pos = pos
self.draw_design(event_list) self.draw_design(event_list)

View file

@ -48,7 +48,8 @@ class DayRowDesign (DesignEntity):
fontsize = eventlist_y_fontsize * self.size[1] fontsize = eventlist_y_fontsize * self.size[1]
events = calendar.get_day_events(self.date) events = calendar.get_day_events(self.date)
event_list = SingelDayEventListDesign(size, events, fontsize, line_spacing=0) rel_dates = [self.date for _ in range(len(events))]
event_list = SingelDayEventListDesign(size, events, fontsize, line_spacing=0, event_prefix_rel_dates = rel_dates)
event_list.pos = pos event_list.pos = pos
self.draw_design(event_list) self.draw_design(event_list)