Skip to content

Instantly share code, notes, and snippets.

@dexX7
Created October 8, 2015 15:11
Show Gist options
  • Save dexX7/218beb74246a1b5f0a6f to your computer and use it in GitHub Desktop.
Save dexX7/218beb74246a1b5f0a6f to your computer and use it in GitHub Desktop.
RPC console with smaller Monospace font
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 8917f77..5b330e1 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -243,6 +243,7 @@ QString HtmlEscape(const QString& str, bool fMultiLine)
if(fMultiLine)
{
escaped = escaped.replace("\n", "<br>\n");
+ escaped = escaped.replace(" ", "&nbsp;");
}
return escaped;
}
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index f387a3e..eddcc05 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -462,14 +462,15 @@ void RPCConsole::clear()
}
// Set default style sheet
- ui->messagesWidget->document()->setDefaultStyleSheet(
+ QString styleStr = QString::fromStdString(strprintf(
"table { }"
"td.time { color: #808080; padding-top: 3px; } "
+ "td.message { font-family: monospace; font-size: %dpt; } "
"td.cmd-request { color: #006060; } "
"td.cmd-error { color: red; } "
- "b { color: #006060; } "
- );
-
+ "b { color: #006060; } ", (QFont("Monospace").pointSize() * 4 / 5) // 0.8 em
+ ));
+ ui->messagesWidget->document()->setDefaultStyleSheet(styleStr);
message(CMD_REPLY, (tr("Welcome to the Bitcoin Core RPC console.") + "<br>" +
tr("Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.") + "<br>" +
tr("Type <b>help</b> for an overview of available commands.")), true);
@@ -849,4 +850,4 @@ void RPCConsole::showOrHideBanTableIfRequired()
bool visible = clientModel->getBanTableModel()->shouldShow();
ui->banlistWidget->setVisible(visible);
ui->banHeading->setVisible(visible);
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment