Skip to content

Commit

Permalink
UI|Default Style|Widgets: Slightly smaller monospace font on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 21, 2017
1 parent 4065200 commit 1e16231
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Expand Up @@ -167,3 +167,14 @@ slider {
log {
font normal inherits default {}
}

document {
font monospace inherits monospace {}
}

script {
# Make monospace a bit smaller on Windows - Courier New is pretty wide.
if Version.OS == 'windows'
document.monospace.size = '9pt'
end
}
2 changes: 1 addition & 1 deletion doomsday/sdk/libappfw/src/style.cpp
Expand Up @@ -190,7 +190,7 @@ Font const *Style::richStyleFont(Font::RichFormat::Style fontStyle) const
switch (fontStyle)
{
case Font::RichFormat::Monospace:
return &fonts().font("monospace");
return &fonts().font(QStringLiteral("monospace"));

default:
return nullptr;
Expand Down
4 changes: 4 additions & 0 deletions doomsday/sdk/libappfw/src/widgets/documentwidget.cpp
Expand Up @@ -125,6 +125,10 @@ public Font::RichFormat::IStyle

Font const *richStyleFont(Font::RichFormat::Style fontStyle) const
{
if (fontStyle == Font::RichFormat::Monospace)
{
return &style().fonts().font(QStringLiteral("document.monospace"));
}
return style().richStyleFont(fontStyle);
}

Expand Down

0 comments on commit 1e16231

Please sign in to comment.