Skip to content

Commit 8b419b5

Browse files
committed
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.
1 parent ecf5f2c commit 8b419b5

File tree

2 files changed

+17
-46
lines changed

2 files changed

+17
-46
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,7 @@
470470
</spacer>
471471
</item>
472472
<item>
473-
<widget class="QPushButton" name="fontSmallerButton">
474-
<property name="maximumSize">
475-
<size>
476-
<width>24</width>
477-
<height>24</height>
478-
</size>
479-
</property>
473+
<widget class="QToolButton" name="fontSmallerButton">
480474
<property name="toolTip">
481475
<string>Decrease font size</string>
482476
</property>
@@ -489,26 +483,14 @@
489483
</property>
490484
<property name="iconSize">
491485
<size>
492-
<width>24</width>
493-
<height>16</height>
486+
<width>22</width>
487+
<height>22</height>
494488
</size>
495489
</property>
496-
<property name="autoDefault">
497-
<bool>false</bool>
498-
</property>
499-
<property name="flat">
500-
<bool>true</bool>
501-
</property>
502490
</widget>
503491
</item>
504492
<item>
505-
<widget class="QPushButton" name="fontBiggerButton">
506-
<property name="maximumSize">
507-
<size>
508-
<width>24</width>
509-
<height>24</height>
510-
</size>
511-
</property>
493+
<widget class="QToolButton" name="fontBiggerButton">
512494
<property name="toolTip">
513495
<string>Increase font size</string>
514496
</property>
@@ -521,26 +503,14 @@
521503
</property>
522504
<property name="iconSize">
523505
<size>
524-
<width>24</width>
525-
<height>16</height>
506+
<width>22</width>
507+
<height>22</height>
526508
</size>
527509
</property>
528-
<property name="autoDefault">
529-
<bool>false</bool>
530-
</property>
531-
<property name="flat">
532-
<bool>true</bool>
533-
</property>
534510
</widget>
535511
</item>
536512
<item>
537-
<widget class="QPushButton" name="clearButton">
538-
<property name="maximumSize">
539-
<size>
540-
<width>24</width>
541-
<height>24</height>
542-
</size>
543-
</property>
513+
<widget class="QToolButton" name="clearButton">
544514
<property name="toolTip">
545515
<string>Clear console</string>
546516
</property>
@@ -554,15 +524,15 @@
554524
<iconset resource="../bitcoin.qrc">
555525
<normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>
556526
</property>
527+
<property name="iconSize">
528+
<size>
529+
<width>22</width>
530+
<height>22</height>
531+
</size>
532+
</property>
557533
<property name="shortcut">
558534
<string notr="true">Ctrl+L</string>
559535
</property>
560-
<property name="autoDefault">
561-
<bool>false</bool>
562-
</property>
563-
<property name="flat">
564-
<bool>true</bool>
565-
</property>
566536
</widget>
567537
</item>
568538
</layout>

src/qt/rpcconsole.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <wallet/wallet.h>
3535
#endif
3636

37+
#include <QAbstractButton>
3738
#include <QDateTime>
3839
#include <QFont>
3940
#include <QKeyEvent>
@@ -503,9 +504,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
503504
ui->lineEdit->setMaxLength(16 * 1024 * 1024);
504505
ui->messagesWidget->installEventFilter(this);
505506

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

511512
// disable the wallet selector by default

0 commit comments

Comments
 (0)