0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

qt: make console buttons look clickable

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.
This commit is contained in:
Jarol Rodriguez 2021-05-14 17:28:39 -04:00
parent ecf5f2c1a0
commit 8b419b5163
2 changed files with 17 additions and 46 deletions

View file

@ -470,13 +470,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="fontSmallerButton"> <widget class="QToolButton" name="fontSmallerButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Decrease font size</string> <string>Decrease font size</string>
</property> </property>
@ -489,26 +483,14 @@
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>24</width> <width>22</width>
<height>16</height> <height>22</height>
</size> </size>
</property> </property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="fontBiggerButton"> <widget class="QToolButton" name="fontBiggerButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Increase font size</string> <string>Increase font size</string>
</property> </property>
@ -521,26 +503,14 @@
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>24</width> <width>22</width>
<height>16</height> <height>22</height>
</size> </size>
</property> </property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="clearButton"> <widget class="QToolButton" name="clearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Clear console</string> <string>Clear console</string>
</property> </property>
@ -554,15 +524,15 @@
<iconset resource="../bitcoin.qrc"> <iconset resource="../bitcoin.qrc">
<normaloff>:/icons/remove</normaloff>:/icons/remove</iconset> <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>
</property> </property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="shortcut"> <property name="shortcut">
<string notr="true">Ctrl+L</string> <string notr="true">Ctrl+L</string>
</property> </property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -34,6 +34,7 @@
#include <wallet/wallet.h> #include <wallet/wallet.h>
#endif #endif
#include <QAbstractButton>
#include <QDateTime> #include <QDateTime>
#include <QFont> #include <QFont>
#include <QKeyEvent> #include <QKeyEvent>
@ -503,9 +504,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
ui->lineEdit->setMaxLength(16 * 1024 * 1024); ui->lineEdit->setMaxLength(16 * 1024 * 1024);
ui->messagesWidget->installEventFilter(this); ui->messagesWidget->installEventFilter(this);
connect(ui->clearButton, &QPushButton::clicked, [this] { clear(); }); connect(ui->clearButton, &QAbstractButton::clicked, [this] { clear(); });
connect(ui->fontBiggerButton, &QPushButton::clicked, this, &RPCConsole::fontBigger); connect(ui->fontBiggerButton, &QAbstractButton::clicked, this, &RPCConsole::fontBigger);
connect(ui->fontSmallerButton, &QPushButton::clicked, this, &RPCConsole::fontSmaller); connect(ui->fontSmallerButton, &QAbstractButton::clicked, this, &RPCConsole::fontSmaller);
connect(ui->btnClearTrafficGraph, &QPushButton::clicked, ui->trafficGraph, &TrafficGraphWidget::clear); connect(ui->btnClearTrafficGraph, &QPushButton::clicked, ui->trafficGraph, &TrafficGraphWidget::clear);
// disable the wallet selector by default // disable the wallet selector by default