Skip to content

Commit 2a45134

Browse files
hebastojarolrod
andcommitted
qt: Add shortcuts for console font resize buttons
Co-authored-by: Jarol Rodriguez <[email protected]>
1 parent a2e122f commit 2a45134

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/qt/rpcconsole.cpp

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,18 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
486486
ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));
487487
}
488488
ui->clearButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
489+
489490
ui->fontBiggerButton->setIcon(platformStyle->SingleColorIcon(":/icons/fontbigger"));
491+
//: Main shortcut to increase the RPC console font size.
492+
ui->fontBiggerButton->setShortcut(tr("Ctrl++"));
493+
//: Secondary shortcut to increase the RPC console font size.
494+
GUIUtil::AddButtonShortcut(ui->fontBiggerButton, tr("Ctrl+="));
495+
490496
ui->fontSmallerButton->setIcon(platformStyle->SingleColorIcon(":/icons/fontsmaller"));
497+
//: Main shortcut to decrease the RPC console font size.
498+
ui->fontSmallerButton->setShortcut(tr("Ctrl+-"));
499+
//: Secondary shortcut to decrease the RPC console font size.
500+
GUIUtil::AddButtonShortcut(ui->fontSmallerButton, tr("Ctrl+_"));
491501

492502
// Install event filter for up and down arrow
493503
ui->lineEdit->installEventFilter(this);
@@ -816,14 +826,23 @@ void RPCConsole::clear(bool clearHistory)
816826
).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize))
817827
);
818828

819-
message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + "<br>" +
820-
tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + "<br>" +
821-
tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "<br>" +
822-
tr("For more information on using this console type %1.").arg("<b>help-console</b>") +
823-
"<br><span class=\"secwarning\"><br>" +
824-
tr("WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.") +
825-
"</span>"),
826-
true);
829+
message(CMD_REPLY,
830+
tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) +
831+
"<br>" +
832+
tr("Use up and down arrows to navigate history, and %1 to clear screen.")
833+
.arg("<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>") +
834+
"<br>" +
835+
tr("Use %1 and %2 to increase or decrease the font size.")
836+
.arg("<b>" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "</b>")
837+
.arg("<b>" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "</b>") +
838+
"<br>" +
839+
tr("Type %1 for an overview of available commands.").arg("<b>help</b>") +
840+
"<br>" +
841+
tr("For more information on using this console type %1.").arg("<b>help-console</b>") +
842+
"<br><span class=\"secwarning\"><br>" +
843+
tr("WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.") +
844+
"</span>",
845+
true);
827846
}
828847

829848
void RPCConsole::keyPressEvent(QKeyEvent *event)

0 commit comments

Comments
 (0)