Skip to content

Commit

Permalink
clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Jul 10, 2024
1 parent 1395a97 commit 730e432
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
15 changes: 7 additions & 8 deletions src/core/sizing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@
#include <QScreen>
#include <math.h>


Sizing::Sizing(QObject* parent)
: QObject(parent)
, m_mmScaleFactor(10)
, m_dpScaleFactor(1)
, m_screenDPI(0)
{
//All sizes we get from LipstickSettings::exportScreenProperties()
// All sizes we get from LipstickSettings::exportScreenProperties()
MGConfItem* physicalDotsPerInchConf = new MGConfItem("/lipstick/screen/primary/physicalDotsPerInch");
connect(physicalDotsPerInchConf, &MGConfItem::valueChanged, this, &Sizing::recalcConstants);
if(physicalDotsPerInchConf->value().isNull()) {
QScreen *primaryScreen = QGuiApplication::primaryScreen();
if (physicalDotsPerInchConf->value().isNull()) {
QScreen* primaryScreen = QGuiApplication::primaryScreen();
physicalDotsPerInchConf->set(primaryScreen->physicalDotsPerInch());
physicalDotsPerInchConf->sync();
}
Expand Down Expand Up @@ -83,15 +82,15 @@ void Sizing::recalcConstants()

qDebug() << "Screen DPI is: " << dpi;

qreal dpScaleFactor;
float dpScaleFactor;

if (dpi < 200) {
dpScaleFactor = 1;
} else if (dpi >= 200 && dpi < 300) {
dpScaleFactor = 1.5;
} else if (dpi >= 300 && dpi < 450) {
dpScaleFactor = 2;
} else if (dpi >= 450 && dpi < 600) {
} else {
dpScaleFactor = 2.5;
}

Expand All @@ -103,8 +102,8 @@ void Sizing::recalcConstants()
emit dpScaleFactorChanged();
}

float pixelsInMM = dpi/2.45/10;
if(pixelsInMM != m_mmScaleFactor) {
float pixelsInMM = dpi / 2.45 / 10;
if (pixelsInMM != m_mmScaleFactor) {
m_mmScaleFactor = pixelsInMM;
emit mmScaleFactorChanged();
}
Expand Down
12 changes: 6 additions & 6 deletions src/core/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ private slots:
int m_fontWeightMedium; // 25
QString m_fontPath; //???

QString m_accentColor; //#0091e5
QString m_fillColor; //#474747
QString m_fillDarkColor; //#313131
QString m_textColor; //#ffffff
QString m_backgroundColor; //#000000
QString m_backgroundAccentColor; //#ffffff
QString m_accentColor; // #0091e5
QString m_fillColor; // #474747
QString m_fillDarkColor; // #313131
QString m_textColor; // #ffffff
QString m_backgroundColor; // #000000
QString m_backgroundAccentColor; // #ffffff

QString m_theme;

Expand Down
10 changes: 3 additions & 7 deletions src/core/themedaemon/mlocalthemedaemonclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <QSettings>

#ifndef QT_INSTALL_QML
#error QT_INSTALL_QML is not set!
#error QT_INSTALL_QML is not set!
#endif

MLocalThemeDaemonClient::MLocalThemeDaemonClient(const QString& testPath, QObject* parent)
Expand Down Expand Up @@ -116,14 +116,10 @@ MLocalThemeDaemonClient::MLocalThemeDaemonClient(const QString& testPath, QObjec
if (themeRoots.at(i).endsWith(QDir::separator()))
themeRoots[i].truncate(themeRoots.at(i).length() - 1);

buildHash(themeRoots.at(i) + QDir::separator() + "icons", QStringList() << "*.svg"
<< "*.png"
<< "*.jpg");
buildHash(themeRoots.at(i) + QDir::separator() + "icons", QStringList() << "*.svg" << "*.png" << "*.jpg");
}

m_imageDirNodes.append(ImageDirNode("icons", QStringList() << ".svg"
<< ".png"
<< ".jpg"));
m_imageDirNodes.append(ImageDirNode("icons", QStringList() << ".svg" << ".png" << ".jpg"));
}

MLocalThemeDaemonClient::~MLocalThemeDaemonClient()
Expand Down

0 comments on commit 730e432

Please sign in to comment.