Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/agenda-module-aesthetic-changes #325

Merged
merged 8 commits into from
Mar 15, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions inkycal/modules/inkycal_agenda.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ 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 = date_width
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 - date_width
event_width = im_width - time_width
logger.debug(f'width for events: {event_width}')

# Calculate x-pos for event titles
x_event = date_width + time_width
x_event = int(date_width/3) + time_width
logger.debug(f'x-event: {x_event}')

# Merge list of dates and list of events
Expand Down Expand Up @@ -202,11 +202,15 @@ def generate_image(self):
if not parser.all_day(_):
write(im_black, (x_time, line_pos[cursor][1]),
(time_width, line_height), time,
font=self.font, alignment='left')
font=self.font, alignment='right')
if parser.all_day(_):
aceisace marked this conversation as resolved.
Show resolved Hide resolved
write(im_black, (x_time, line_pos[cursor][1]),
(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
Loading