mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
9372df260b
commit
cc0c929ab9
|
@ -190,10 +190,7 @@ void Settings::loadGlobal()
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("GUI");
|
s.beginGroup("GUI");
|
||||||
enableSmoothAnimation = s.value("smoothAnimation", true).toBool();
|
|
||||||
smileyPack = s.value("smileyPack", ":/smileys/TwitterEmojiSVG/emoticons.xml").toString();
|
smileyPack = s.value("smileyPack", ":/smileys/TwitterEmojiSVG/emoticons.xml").toString();
|
||||||
customEmojiFont = s.value("customEmojiFont", true).toBool();
|
|
||||||
emojiFontFamily = s.value("emojiFontFamily", "DejaVu Sans").toString();
|
|
||||||
emojiFontPointSize = s.value("emojiFontPointSize", 16).toInt();
|
emojiFontPointSize = s.value("emojiFontPointSize", 16).toInt();
|
||||||
firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();
|
firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();
|
||||||
secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
|
secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
|
||||||
|
@ -202,7 +199,6 @@ void Settings::loadGlobal()
|
||||||
minimizeOnClose = s.value("minimizeOnClose", false).toBool();
|
minimizeOnClose = s.value("minimizeOnClose", false).toBool();
|
||||||
minimizeToTray = s.value("minimizeToTray", false).toBool();
|
minimizeToTray = s.value("minimizeToTray", false).toBool();
|
||||||
lightTrayIcon = s.value("lightTrayIcon", false).toBool();
|
lightTrayIcon = s.value("lightTrayIcon", false).toBool();
|
||||||
useNativeStyle = s.value("nativeStyle", false).toBool();
|
|
||||||
useEmoticons = s.value("useEmoticons", true).toBool();
|
useEmoticons = s.value("useEmoticons", true).toBool();
|
||||||
statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool();
|
statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool();
|
||||||
themeColor = s.value("themeColor", 0).toInt();
|
themeColor = s.value("themeColor", 0).toInt();
|
||||||
|
@ -372,14 +368,10 @@ void Settings::saveGlobal()
|
||||||
const QList<QString> widgetNames = widgetSettings.keys();
|
const QList<QString> widgetNames = widgetSettings.keys();
|
||||||
for (const QString& name : widgetNames)
|
for (const QString& name : widgetNames)
|
||||||
s.setValue(name, widgetSettings.value(name));
|
s.setValue(name, widgetSettings.value(name));
|
||||||
|
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("GUI");
|
s.beginGroup("GUI");
|
||||||
s.setValue("smoothAnimation", enableSmoothAnimation);
|
|
||||||
s.setValue("smileyPack", smileyPack);
|
s.setValue("smileyPack", smileyPack);
|
||||||
s.setValue("customEmojiFont", customEmojiFont);
|
|
||||||
s.setValue("emojiFontFamily", emojiFontFamily);
|
|
||||||
s.setValue("emojiFontPointSize", emojiFontPointSize);
|
s.setValue("emojiFontPointSize", emojiFontPointSize);
|
||||||
s.setValue("firstColumnHandlePos", firstColumnHandlePos);
|
s.setValue("firstColumnHandlePos", firstColumnHandlePos);
|
||||||
s.setValue("secondColumnHandlePosFromRight", secondColumnHandlePosFromRight);
|
s.setValue("secondColumnHandlePosFromRight", secondColumnHandlePosFromRight);
|
||||||
|
@ -388,7 +380,6 @@ void Settings::saveGlobal()
|
||||||
s.setValue("minimizeOnClose", minimizeOnClose);
|
s.setValue("minimizeOnClose", minimizeOnClose);
|
||||||
s.setValue("minimizeToTray", minimizeToTray);
|
s.setValue("minimizeToTray", minimizeToTray);
|
||||||
s.setValue("lightTrayIcon", lightTrayIcon);
|
s.setValue("lightTrayIcon", lightTrayIcon);
|
||||||
s.setValue("nativeStyle", useNativeStyle);
|
|
||||||
s.setValue("useEmoticons", useEmoticons);
|
s.setValue("useEmoticons", useEmoticons);
|
||||||
s.setValue("themeColor", themeColor);
|
s.setValue("themeColor", themeColor);
|
||||||
s.setValue("style", style);
|
s.setValue("style", style);
|
||||||
|
@ -927,18 +918,6 @@ QByteArray Settings::getWidgetData(const QString& uniqueName) const
|
||||||
return widgetSettings.value(uniqueName);
|
return widgetSettings.value(uniqueName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Settings::isAnimationEnabled() const
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
return enableSmoothAnimation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Settings::setAnimationEnabled(bool newValue)
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
enableSmoothAnimation = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Settings::getSmileyPack() const
|
QString Settings::getSmileyPack() const
|
||||||
{
|
{
|
||||||
QMutexLocker locker{&bigLock};
|
QMutexLocker locker{&bigLock};
|
||||||
|
@ -952,19 +931,6 @@ void Settings::setSmileyPack(const QString &value)
|
||||||
emit smileyPackChanged();
|
emit smileyPackChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Settings::isCurstomEmojiFont() const
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
return customEmojiFont;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Settings::setCurstomEmojiFont(bool value)
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
customEmojiFont = value;
|
|
||||||
emit emojiFontChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
int Settings::getEmojiFontPointSize() const
|
int Settings::getEmojiFontPointSize() const
|
||||||
{
|
{
|
||||||
QMutexLocker locker{&bigLock};
|
QMutexLocker locker{&bigLock};
|
||||||
|
@ -1026,31 +992,6 @@ void Settings::setDateFormat(const QString &format)
|
||||||
dateFormat = format;
|
dateFormat = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Settings::getEmojiFontFamily() const
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
return emojiFontFamily;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Settings::setEmojiFontFamily(const QString &value)
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
emojiFontFamily = value;
|
|
||||||
emit emojiFontChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Settings::getUseNativeStyle() const
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
return useNativeStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Settings::setUseNativeStyle(bool value)
|
|
||||||
{
|
|
||||||
QMutexLocker locker{&bigLock};
|
|
||||||
useNativeStyle = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray Settings::getWindowGeometry() const
|
QByteArray Settings::getWindowGeometry() const
|
||||||
{
|
{
|
||||||
QMutexLocker locker{&bigLock};
|
QMutexLocker locker{&bigLock};
|
||||||
|
|
|
@ -174,9 +174,6 @@ public:
|
||||||
bool isCurstomEmojiFont() const;
|
bool isCurstomEmojiFont() const;
|
||||||
void setCurstomEmojiFont(bool value);
|
void setCurstomEmojiFont(bool value);
|
||||||
|
|
||||||
QString getEmojiFontFamily() const;
|
|
||||||
void setEmojiFontFamily(const QString &value);
|
|
||||||
|
|
||||||
int getEmojiFontPointSize() const;
|
int getEmojiFontPointSize() const;
|
||||||
void setEmojiFontPointSize(int value);
|
void setEmojiFontPointSize(int value);
|
||||||
|
|
||||||
|
@ -210,9 +207,6 @@ public:
|
||||||
void setTypingNotification(bool enabled);
|
void setTypingNotification(bool enabled);
|
||||||
|
|
||||||
// State
|
// State
|
||||||
bool getUseNativeStyle() const;
|
|
||||||
void setUseNativeStyle(bool value);
|
|
||||||
|
|
||||||
QByteArray getWindowGeometry() const;
|
QByteArray getWindowGeometry() const;
|
||||||
void setWindowGeometry(const QByteArray &value);
|
void setWindowGeometry(const QByteArray &value);
|
||||||
|
|
||||||
|
@ -319,13 +313,9 @@ private:
|
||||||
QString globalAutoAcceptDir;
|
QString globalAutoAcceptDir;
|
||||||
|
|
||||||
// GUI
|
// GUI
|
||||||
bool enableSmoothAnimation;
|
|
||||||
QString smileyPack;
|
QString smileyPack;
|
||||||
bool customEmojiFont;
|
|
||||||
QString emojiFontFamily;
|
|
||||||
int emojiFontPointSize;
|
int emojiFontPointSize;
|
||||||
bool minimizeOnClose;
|
bool minimizeOnClose;
|
||||||
bool useNativeStyle;
|
|
||||||
QByteArray windowGeometry;
|
QByteArray windowGeometry;
|
||||||
QByteArray windowState;
|
QByteArray windowState;
|
||||||
QByteArray splitterState;
|
QByteArray splitterState;
|
||||||
|
|
|
@ -76,15 +76,12 @@ QList<QColor> Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#9
|
||||||
|
|
||||||
|
|
||||||
QString Style::getStylesheet(const QString &filename)
|
QString Style::getStylesheet(const QString &filename)
|
||||||
{
|
|
||||||
if (!Settings::getInstance().getUseNativeStyle())
|
|
||||||
{
|
{
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
if (file.open(QFile::ReadOnly | QFile::Text))
|
if (file.open(QFile::ReadOnly | QFile::Text))
|
||||||
return resolve(file.readAll());
|
return resolve(file.readAll());
|
||||||
else
|
else
|
||||||
qWarning() << "Stylesheet " << filename << " not found";
|
qWarning() << "Stylesheet " << filename << " not found";
|
||||||
}
|
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user