Bug 365257 - Columns in main window do not resize properly to fit their contents
Summary: Columns in main window do not resize properly to fit their contents
Status: CLOSED FIXED
Alias: None
Product: kalarm
Classification: Applications
Component: general (show other bugs)
Version: 2.11
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: David Jarvie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-08 21:28 UTC by David Jarvie
Modified: 2021-01-09 17:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Jarvie 2016-07-08 21:28:13 UTC
They were resizeable in KDE 4, but not in KDE 5.

Reproducible: Always
Comment 1 David Jarvie 2016-07-08 21:47:38 UTC
The original comment is incorrect - the columns were not manually resizeable in KDE 4 either.

The time and repetition columns are supposed to resize to fit their contents. However this does not always work properly, so that when times are shown as am/pm, the whole text is not shown (e.g. "07/08/16 06:50 P...").
Comment 2 Andrey Bondarenko 2018-07-23 18:40:42 UTC
I can confirm the issue with time column width in Kubuntu 18.04 (kalarm version 2.11.16-5, Qt version 5.9.5). The column is too narrow and last digit replaced with ellipsis in 24 hours time formats (“23.07.2018 23:05” displayed as “23.07.2018 23:0...”). It is quite annoying sometimes.

The issue is also reproducible in Kubuntu 16.04.4 (kalarm version 4:16.04.3-0ubuntu2~ubuntu16.04~ppa63, Qt version 5.6.1+dfsg-3ubuntu1~xenialoverlay1~4+fix1) and in version compiled from sources in kdepim docker (kalarm version 2.12.0-5, qt version 5.11.1+dfsg-2+16.04+xenial+build57).

Looks like the issue somehow related to configured system font and probably DPI (96 in my case). For my default font Noto Sans 10 only last digit in minutes is hidden. If I increase font to Noto Sans 11, I can see all the digits. With default font Liberation Sans 9, I cannot see minutes at all (“23.07.2018 23:05” displayed as “23.07.2018 23:...”).

Interesting that commenting out code for AlarmListModel::TimeColumn in AlarmListDelegate::sizeHint (src/alarmlistdelegate.cpp lines 95-113) and delegating calculations to QItemDelegate::sizeHint from QT 5.11.1 resolves issue for all three fonts in my setup.
Comment 3 David Jarvie 2018-07-29 00:18:35 UTC
Thanks Andrey for the details which you provided. These helped a lot to get this fixed.

Now fixed for version 2.12.0, which will be in KDE Applications 18.08 (git commit 202a828796e4cf600d2f63e2fc930fbdf5ddd9ad).