Skip to content

Fix width argument, set overall width#2

Open
msalle wants to merge 4 commits intohramrach:masterfrom
msalle:fix/width_agenda
Open

Fix width argument, set overall width#2
msalle wants to merge 4 commits intohramrach:masterfrom
msalle:fix/width_agenda

Conversation

@msalle
Copy link
Copy Markdown

@msalle msalle commented Jan 21, 2025

This is a proper fix instead of #1, as also mentioned in that PR, I realise this repo is not upstream gcalcli, but since it's the source for OpenSUSE, I think it makes sense to fix it here too.

Fix the width for the description details, both default and as cmdline option, and make sure we don't break the width of the calw and calmoutput.
The (pretty much undocumented) option --width/-w option was used for setting the width of a day table cell in calw and calm but seemed to also be intended for setting the overall width of the description in agenda. The latter part was broken and the details description width would always default to 80.
We change the behaviour to set the overall width of the table, defaulting to the terminal width, both for calw and calm and for description details. The width of the day cell is calculated from the overall width.

Fix the width for the description details, both default and as cmdline option,
and make sure we don't break the width of the calw and calm output.
The (pretty much undocumented) option --width/-w option was used for setting the
width of a day table cell in calw and calm but seemed to also be intended for
setting the overall width of the description in agenda. The latter part was
broken and the details description width would always default to 80.
We change the behaviour to set the overall width of the table, defaulting to the
terminal width, both for calw and calm and for description details. The width of
the day cell is calculated from the overall width.
@msalle
Copy link
Copy Markdown
Author

msalle commented Jan 21, 2025

See also insanum#825

day_width was calculated assuming 7 days a week. This is not correct when
noweekend is set. days was already calculated in _GraphEvents, so move it to
instance level and set it in __init__ and use it to calculate the correct width.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant