mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
coding style: rename themeInterface to ThemeInterface
As per coding style, class names are PascalCase. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1702747459
commit
ce1629ccce
3 changed files with 11 additions and 11 deletions
|
@ -44,13 +44,13 @@ static const QColor DARK_PRIMARY_TEXT_COLOR = "#ECECEC";
|
||||||
static const QColor DARK_SECONDARY_TEXT_COLOR = "#757575";
|
static const QColor DARK_SECONDARY_TEXT_COLOR = "#757575";
|
||||||
static const QColor DARK_TEXT_COLOR = "#ECECEC";
|
static const QColor DARK_TEXT_COLOR = "#ECECEC";
|
||||||
|
|
||||||
themeInterface *themeInterface::instance()
|
ThemeInterface *ThemeInterface::instance()
|
||||||
{
|
{
|
||||||
static themeInterface *self = new themeInterface;
|
static ThemeInterface *self = new ThemeInterface;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
void themeInterface::setup(QQmlContext *ct)
|
void ThemeInterface::setup(QQmlContext *ct)
|
||||||
{
|
{
|
||||||
// Register interface class
|
// Register interface class
|
||||||
ct->setContextProperty("subsurfaceTheme", this);
|
ct->setContextProperty("subsurfaceTheme", this);
|
||||||
|
@ -67,7 +67,7 @@ void themeInterface::setup(QQmlContext *ct)
|
||||||
set_currentScale(qPrefDisplay::mobile_scale());
|
set_currentScale(qPrefDisplay::mobile_scale());
|
||||||
}
|
}
|
||||||
|
|
||||||
void themeInterface::set_currentTheme(const QString &theme)
|
void ThemeInterface::set_currentTheme(const QString &theme)
|
||||||
{
|
{
|
||||||
m_currentTheme = theme;
|
m_currentTheme = theme;
|
||||||
qPrefDisplay::set_theme(m_currentTheme);
|
qPrefDisplay::set_theme(m_currentTheme);
|
||||||
|
@ -75,11 +75,11 @@ void themeInterface::set_currentTheme(const QString &theme)
|
||||||
emit currentThemeChanged(theme);
|
emit currentThemeChanged(theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
double themeInterface::currentScale()
|
double ThemeInterface::currentScale()
|
||||||
{
|
{
|
||||||
return qPrefDisplay::mobile_scale();
|
return qPrefDisplay::mobile_scale();
|
||||||
}
|
}
|
||||||
void themeInterface::set_currentScale(double newScale)
|
void ThemeInterface::set_currentScale(double newScale)
|
||||||
{
|
{
|
||||||
if (newScale != qPrefDisplay::mobile_scale()) {
|
if (newScale != qPrefDisplay::mobile_scale()) {
|
||||||
qPrefDisplay::set_mobile_scale(newScale);
|
qPrefDisplay::set_mobile_scale(newScale);
|
||||||
|
@ -103,7 +103,7 @@ void themeInterface::set_currentScale(double newScale)
|
||||||
emit titlePointSizeChanged(m_titlePointSize);
|
emit titlePointSizeChanged(m_titlePointSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void themeInterface::update_theme()
|
void ThemeInterface::update_theme()
|
||||||
{
|
{
|
||||||
if (m_currentTheme == "Blue") {
|
if (m_currentTheme == "Blue") {
|
||||||
m_backgroundColor = BLUE_BACKGROUND_COLOR;
|
m_backgroundColor = BLUE_BACKGROUND_COLOR;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
|
|
||||||
class themeInterface : public QObject {
|
class ThemeInterface : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// Color themes
|
// Color themes
|
||||||
|
@ -35,7 +35,7 @@ class themeInterface : public QObject {
|
||||||
Q_PROPERTY(QString currentTheme MEMBER m_currentTheme WRITE set_currentTheme NOTIFY currentThemeChanged)
|
Q_PROPERTY(QString currentTheme MEMBER m_currentTheme WRITE set_currentTheme NOTIFY currentThemeChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static themeInterface *instance();
|
static ThemeInterface *instance();
|
||||||
void setup(QQmlContext *ct);
|
void setup(QQmlContext *ct);
|
||||||
double currentScale();
|
double currentScale();
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ signals:
|
||||||
void currentThemeChanged(const QString &);
|
void currentThemeChanged(const QString &);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
themeInterface() {}
|
ThemeInterface() {}
|
||||||
void update_theme();
|
void update_theme();
|
||||||
|
|
||||||
QColor m_backgroundColor;
|
QColor m_backgroundColor;
|
||||||
|
|
|
@ -199,7 +199,7 @@ void register_qml_types(QQmlEngine *engine)
|
||||||
|
|
||||||
// Register qml interface classes
|
// Register qml interface classes
|
||||||
QMLInterface::setup(ct);
|
QMLInterface::setup(ct);
|
||||||
themeInterface::instance()->setup(ct);
|
ThemeInterface::instance()->setup(ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGISTER_TYPE(QMLManager, "QMLManager");
|
REGISTER_TYPE(QMLManager, "QMLManager");
|
||||||
|
|
Loading…
Add table
Reference in a new issue