Skip to content

Commit

Permalink
gui: Fix debug console font & default font size
Browse files Browse the repository at this point in the history
 - Adds the font Inconsolata-Regular to the application database.
   This font is licensed under the Open Font License.
   More information can be found here:
   https://fonts.google.com/specimen/Inconsolata?query=Inconsolata
 - Sets the global default font to 10pt rather than pixels to deal
   with any further DPI scaling issues.
 - Fixes missing elements in native_stylesheet.css that were
   not alllowing the RPC font to display correctly in the RPC
   console.
   (The stylesheets really need to be reworked entirely although
    this satisfies the scope of this PR)
  • Loading branch information
opsinphark committed Oct 4, 2020
1 parent 912d115 commit 730d3ab
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ RES_IMAGES = \
qt/res/images/splash3.png

RES_FONTS = \
qt/res/fonts/Inconsolata-Regular.ttf \
qt/res/fonts/Inter-Regular.ttf

RES_STYLESHEETS = \
Expand Down
1 change: 1 addition & 0 deletions src/qt/bitcoin.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<file alias="ic_solo_inactive">res/images/ic_solo_inactive.svg</file>
</qresource>
<qresource prefix="/fonts">
<file alias="inconsolata-regular">res/fonts/Inconsolata-Regular.ttf</file>
<file alias="inter-regular">res/fonts/Inter-Regular.ttf</file>
</qresource>
<qresource prefix="/movies"/>
Expand Down
Binary file added src/qt/res/fonts/Inconsolata-Regular.ttf
Binary file not shown.
10 changes: 9 additions & 1 deletion src/qt/res/stylesheets/dark_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* {
font-family: "Inter";
font-size: 10pt;
}


Expand Down Expand Up @@ -352,6 +353,7 @@ QTabBar::tab:!first {
margin-left: -0.065em;
}


QTabBar::tab:selected {
background-color: rgb(58, 64, 69);
border-bottom-color: rgb(58, 64, 69);
Expand All @@ -367,10 +369,16 @@ QTabBar::tab:!selected:hover {
background-color: rgb(58, 64, 69);
}

QTextEdit{
QTextEdit {
background-color: rgb(35,38,41);
}

/* RPC Console */
#messagesWidget {
font-family: "Inconsolata";
font-size: 10pt;
}

QPlainTextEdit{
background-color: rgb(35,38,41);
}
Expand Down
9 changes: 8 additions & 1 deletion src/qt/res/stylesheets/light_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* {
font-family: "Inter";
font-size: 10pt;
}

QMainWindow {
Expand Down Expand Up @@ -351,10 +352,16 @@ QTabBar::tab:!selected:hover {
background: rgb(255, 255, 255);
}

QTextEdit{
QTextEdit {
background-color: white;
}

/* RPC Console */
#messagesWidget {
font-family: "Inconsolata";
font-size: 10pt;
}

QPlainTextEdit{
background-color: white;
}
Expand Down
17 changes: 16 additions & 1 deletion src/qt/res/stylesheets/native_stylesheet.qss
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
/* general */

* {
font-family: "Inter";
font-size: 10pt;
}

QMainWindow {
font-family:'Open Sans';
font-family: "Inter";
}

QTextEdit {
background-color: white;
}

/* RPC Console */
#messagesWidget {
font-family: "Inconsolata";
font-size: 10pt;
}

/* Main Window*/
Expand Down
5 changes: 3 additions & 2 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,11 @@ void RPCConsole::clear()
}

// Set default style sheet
QFontDatabase::addApplicationFont(":/fonts/Inconsolata-Regular.ttf");
ui->messagesWidget->document()->setDefaultStyleSheet(
"table { }"
"td.time { color: #808080; padding-top: 3px; } "
"td.message { font-family: Monospace; font-size: 12px; } "
"td.time { color: #808080; valign: bottom;} "
"td.message { valign: bottom; } "
"td.cmd-request { color: #006060; } "
"td.cmd-error { color: red; } "
"b { color: #006060; } "
Expand Down

0 comments on commit 730d3ab

Please sign in to comment.