diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-18 15:25:56 +0300 |
---|---|---|
committer | Jarol Rodriguez <jarolrod@tutanota.com> | 2021-05-17 14:01:38 -0400 |
commit | 2a45134b5694c12546d77cdff541612881f7e3e7 (patch) | |
tree | f9707855aae065471d5363e16f248b0a92f95b71 /src | |
parent | a2e122f0fe72d695762db2b83905e246f451300c (diff) | |
download | bitcoin-2a45134b5694c12546d77cdff541612881f7e3e7.tar.xz |
qt: Add shortcuts for console font resize buttons
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/rpcconsole.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 2e29992c0e..4bf661e92a 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -486,8 +486,18 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); } ui->clearButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove")); + ui->fontBiggerButton->setIcon(platformStyle->SingleColorIcon(":/icons/fontbigger")); + //: Main shortcut to increase the RPC console font size. + ui->fontBiggerButton->setShortcut(tr("Ctrl++")); + //: Secondary shortcut to increase the RPC console font size. + GUIUtil::AddButtonShortcut(ui->fontBiggerButton, tr("Ctrl+=")); + ui->fontSmallerButton->setIcon(platformStyle->SingleColorIcon(":/icons/fontsmaller")); + //: Main shortcut to decrease the RPC console font size. + ui->fontSmallerButton->setShortcut(tr("Ctrl+-")); + //: Secondary shortcut to decrease the RPC console font size. + GUIUtil::AddButtonShortcut(ui->fontSmallerButton, tr("Ctrl+_")); // Install event filter for up and down arrow ui->lineEdit->installEventFilter(this); @@ -816,14 +826,23 @@ void RPCConsole::clear(bool clearHistory) ).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize)) ); - message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + "<br>" + - tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + "<br>" + - tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "<br>" + - tr("For more information on using this console type %1.").arg("<b>help-console</b>") + - "<br><span class=\"secwarning\"><br>" + - 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.") + - "</span>"), - true); + message(CMD_REPLY, + tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + + "<br>" + + tr("Use up and down arrows to navigate history, and %1 to clear screen.") + .arg("<b>" + ui->clearButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + + "<br>" + + tr("Use %1 and %2 to increase or decrease the font size.") + .arg("<b>" + ui->fontBiggerButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + .arg("<b>" + ui->fontSmallerButton->shortcut().toString(QKeySequence::NativeText) + "</b>") + + "<br>" + + tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + + "<br>" + + tr("For more information on using this console type %1.").arg("<b>help-console</b>") + + "<br><span class=\"secwarning\"><br>" + + 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.") + + "</span>", + true); } void RPCConsole::keyPressEvent(QKeyEvent *event) |