On master, for macOS, the console buttons’ hitboxes are quite small. This makes clicking on the button with your mouse a little more tedious than it should be. The Issue is related to recent versions of Qt (>5.9.8) not playing so nice on macOS when there are “incorrect” width
and height
values set for a QPushButton
(here is another example: #319#pullrequestreview-652907740).
This fixes this small hitbox issue by converting the buttons from QPushButton
to QToolButton
, which in turn makes the buttons look explicitly clickable. This approach was chosen as it helps us avoid having to play around with width
and height
values until we find values that play nice with macOS and look good on Linux & Windows. Also, QToolButton
is an appropriate class for these buttons.
Per Qt Docs:
A tool button is a special button that provides quick-access to specific commands or options. As opposed to a normal command button, a tool button usually doesn’t show a text label, but shows an icon instead.
Since we are changing the type of the buttons, we need to change the respective actions connection logic in rpcconsole
. Instead of plugging in QToolButton
, we abstract it to the base class: QAbstractButton
.
per Qt Dev Notes
Use base class functions as this makes the code more general, e.g., use QAbstractButton::clicked instead of QPushButton::clicked.
While here, we also update the size of the icons to 22x22
to be consistent with other tool buttons.
macOS: Master vs PR:
Master | PR |
---|---|
Linux: Master vs PR:
Master | PR |
---|---|