60 lines
854 B
C++
60 lines
854 B
C++
#include "settings.hpp"
|
|
|
|
#include <QMutexLocker>
|
|
|
|
Settings::Settings(QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
|
|
}
|
|
|
|
const Settings* Settings::get()
|
|
{
|
|
return getSettable();
|
|
}
|
|
|
|
Settings* Settings::getSettable()
|
|
{
|
|
QMutexLocker locker(&lock);
|
|
if (!instance)
|
|
instance = new Settings();
|
|
return instance;
|
|
}
|
|
|
|
QSize Settings::cardSize() const
|
|
{
|
|
return _cardSize;
|
|
}
|
|
|
|
void Settings::setCardSize(QSize newSize)
|
|
{
|
|
_cardSize = newSize;
|
|
emit cardSizeChange(newSize);
|
|
}
|
|
|
|
void Settings::setCardSize(int w, int h)
|
|
{
|
|
setCardSize(QSize(w, h));
|
|
}
|
|
|
|
void Settings::setMainWindow(QWidget* wid)
|
|
{
|
|
_mainWindow = wid;
|
|
}
|
|
|
|
QWidget* Settings::mainWindow() const
|
|
{
|
|
return _mainWindow;
|
|
}
|
|
|
|
void Settings::setRowFade(float fade)
|
|
{
|
|
_rowFade = fade;
|
|
emit rowFadeChange(fade);
|
|
}
|
|
|
|
float Settings::rowFade() const
|
|
{
|
|
return _rowFade;
|
|
}
|