Added day dependent event prefixes
This commit is contained in:
parent
4b656ee819
commit
afd94ea10f
3 changed files with 7 additions and 5 deletions
|
@ -3,7 +3,7 @@ from Assets import defaultfontsize, colors
|
|||
from datetime import datetime, date, timedelta
|
||||
from TableTextDesign import TableTextDesign
|
||||
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
|
||||
|
||||
|
@ -44,7 +44,7 @@ class AgendaListDesign (DesignEntity):
|
|||
else:
|
||||
row.append("")
|
||||
|
||||
row.append(event_time_detailed(event))
|
||||
row.append(event_prefix_str(event, fetch_day))
|
||||
row.append(event.title)
|
||||
|
||||
self.infos.append(row)
|
||||
|
|
|
@ -65,7 +65,8 @@ class DayHeaderDesign (DesignEntity):
|
|||
size = (self.size[0] - pos[0] - weather_width, self.size[1] - pos[1] - box_ypos)
|
||||
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
|
||||
self.draw_design(event_list)
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ class DayRowDesign (DesignEntity):
|
|||
fontsize = eventlist_y_fontsize * self.size[1]
|
||||
|
||||
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
|
||||
self.draw_design(event_list)
|
||||
|
||||
|
|
Loading…
Reference in a new issue