Skip to content

Commit

Permalink
Update inkycal_agenda.py
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyboda authored Mar 15, 2024
1 parent 0469e75 commit e8835c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inkycal/modules/inkycal_agenda.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ def generate_image(self):

time_width = int(max([self.font.getlength(
events['begin'].format(self.time_format, locale=self.language))
for events in upcoming_events]) * 1.2)
for events in upcoming_events]))
logger.debug(f'time_width: {time_width}')

# Calculate x-pos for time
x_time = int(date_width/3)
logger.debug(f'x-time: {x_time}')

# Find out how much space is left for event titles
event_width = im_width - time_width - int(date_width/3)
event_width = im_width - time_width
logger.debug(f'width for events: {event_width}')

# Calculate x-pos for event titles
Expand Down Expand Up @@ -201,16 +201,16 @@ def generate_image(self):
# Check if event is all day, if not, add the time
if not parser.all_day(_):
write(im_black, (x_time, line_pos[cursor][1]),
(time_width, line_height), time+" ",
(time_width, line_height), time,
font=self.font, alignment='right')
if parser.all_day(_):
write(im_black, (x_time, line_pos[cursor][1]),
(time_width, line_height), "all day ",
(time_width, line_height), "all day",
font=self.font, alignment='right')

write(im_black, (x_event, line_pos[cursor][1]),
(event_width, line_height),
'• ' + title, font=self.font, alignment='left')
' • ' + title, font=self.font, alignment='left')
cursor += 1

# If no events were found, write only dates and lines
Expand Down

0 comments on commit e8835c7

Please sign in to comment.