Skip to content

Commit

Permalink
qt: make console buttons look clickable
Browse files Browse the repository at this point in the history
Change the type for the console's buttons to QToolButton which will make them look explicitly clickable, which in turn fixes the small hitbox issue for macOS.
With this change, we need to generalize the respective action connect logic from QPushButton to QAbstractButton.
While here, update width and height of icon for consistency with other tool buttons.
  • Loading branch information
jarolrod committed May 15, 2021
1 parent ecf5f2c commit 8b419b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 46 deletions.
56 changes: 13 additions & 43 deletions src/qt/forms/debugwindow.ui
Expand Up @@ -470,13 +470,7 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="fontSmallerButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<widget class="QToolButton" name="fontSmallerButton">
<property name="toolTip">
<string>Decrease font size</string>
</property>
Expand All @@ -489,26 +483,14 @@
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>16</height>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="fontBiggerButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<widget class="QToolButton" name="fontBiggerButton">
<property name="toolTip">
<string>Increase font size</string>
</property>
Expand All @@ -521,26 +503,14 @@
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>16</height>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<widget class="QToolButton" name="clearButton">
<property name="toolTip">
<string>Clear console</string>
</property>
Expand All @@ -554,15 +524,15 @@
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="shortcut">
<string notr="true">Ctrl+L</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
Expand Down
7 changes: 4 additions & 3 deletions src/qt/rpcconsole.cpp
Expand Up @@ -34,6 +34,7 @@
#include <wallet/wallet.h>
#endif

#include <QAbstractButton>
#include <QDateTime>
#include <QFont>
#include <QKeyEvent>
Expand Down Expand Up @@ -503,9 +504,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
ui->lineEdit->setMaxLength(16 * 1024 * 1024);
ui->messagesWidget->installEventFilter(this);

connect(ui->clearButton, &QPushButton::clicked, [this] { clear(); });
connect(ui->fontBiggerButton, &QPushButton::clicked, this, &RPCConsole::fontBigger);
connect(ui->fontSmallerButton, &QPushButton::clicked, this, &RPCConsole::fontSmaller);
connect(ui->clearButton, &QAbstractButton::clicked, [this] { clear(); });
connect(ui->fontBiggerButton, &QAbstractButton::clicked, this, &RPCConsole::fontBigger);
connect(ui->fontSmallerButton, &QAbstractButton::clicked, this, &RPCConsole::fontSmaller);
connect(ui->btnClearTrafficGraph, &QPushButton::clicked, ui->trafficGraph, &TrafficGraphWidget::clear);

// disable the wallet selector by default
Expand Down

0 comments on commit 8b419b5

Please sign in to comment.