Bug 142337 - 'gen' backend Button height doesn't take vertically aligned text into account
Summary: 'gen' backend Button height doesn't take vertically aligned text into account
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Caolán McNamara
Whiteboard: target:7.2.0
Depends on:
Blocks: 141942
  Show dependency treegraph
Reported: 2021-05-17 17:57 UTC by Heiko Tietze
Modified: 2021-05-19 08:43 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Glade (above) vs. LibreOffice (below) (63.53 KB, image/png)
2021-05-17 17:57 UTC, Heiko Tietze
Confirmed with gtk3 gen (58.90 KB, image/png)
2021-05-18 05:06 UTC, Rizal Muttaqin

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2021-05-17 17:57:37 UTC
Created attachment 172099 [details]
Glade (above) vs. LibreOffice (below)

GtkButtons can have an icon below or above the label. But apparently this is not taken into account when the height of the button is calculated and either the text is not visible when the icon is placed on top (or the icon when below the text.

Happens for gen and kf5 but not gtk3.

Version: / LibreOffice Community
Build ID: c29f91f3d7a0deb902b900ff07e6c32632b8c958
CPU threads: 8; OS: Linux 5.12; UI render: default; VCL: kf5 (cairo+xcb) (and gen)
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Rizal Muttaqin 2021-05-18 05:06:58 UTC
Created attachment 172106 [details]
Confirmed with gtk3 gen

Version: / LibreOffice Community
Build ID: dbd4110cc36011042c98549d997daa79e8065aba
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: id-ID (id_ID.UTF-8); UI: id-ID
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-05-13_01:08:22
Calc: threaded
Comment 2 Caolán McNamara 2021-05-18 15:17:50 UTC
yeah, it looks like the PushButton::GetOptimalSize isn't calculating the required size correctly. If I hack it to double the height then the text is visible. So the buttons render correctly and its just cut off.
Comment 3 Commit Notification 2021-05-18 18:18:33 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":


tdf#142337 Button::GetOptimalSize only considered image beside text case

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.