Skip to content

Commit

Permalink
Use large font in theme only on screens >1920 resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellGarwood committed Feb 5, 2020
1 parent 93f356c commit 3a20870
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions SPIERScommon/src/darkstyletheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/

#include "darkstyletheme.h"
#include <QRect>
#include <QDesktopWidget>

/**
* @brief DarkStyleTheme::DarkStyleTheme
Expand Down Expand Up @@ -91,10 +93,15 @@ void DarkStyleTheme::polish(QApplication *app)
{
if (!app) return;

//ARTS - Increase font size for better reading,
QFont defaultFont = QApplication::font();
defaultFont.setPointSize(defaultFont.pointSize() + 1);
QApplication::setFont(defaultFont);
QRect screenGeometry = QApplication::desktop()->screenGeometry();
if (screenGeometry.width() > 1920)
{
//ARTS - Increase font size for better reading,
//RJG - Best to only do this at high screen resolutions, based on testing
QFont defaultFont = QApplication::font();
defaultFont.setPointSize(defaultFont.pointSize() + 1);
QApplication::setFont(defaultFont);
}

// Load CSS Stylesheet from resources
QFile darkstyleQSS(QStringLiteral(":/darkstyle/stylesheet_dark.qss"));
Expand Down

0 comments on commit 3a20870

Please sign in to comment.