mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-25 14:25:25 +00:00
Fix Reset Settings for Themes #123
This commit is contained in:
parent
b63d85b23d
commit
7d9cfca2d8
@ -443,10 +443,6 @@ void MainWindow::readSettings()
|
|||||||
restoreGeometry(geo);
|
restoreGeometry(geo);
|
||||||
QByteArray state = settings.value("state", QByteArray()).toByteArray();
|
QByteArray state = settings.value("state", QByteArray()).toByteArray();
|
||||||
restoreState(state);
|
restoreState(state);
|
||||||
if (settings.value("dark").toBool())
|
|
||||||
{
|
|
||||||
this->setDarkTheme();
|
|
||||||
}
|
|
||||||
this->responsive = settings.value("responsive").toBool();
|
this->responsive = settings.value("responsive").toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -868,9 +864,7 @@ void MainWindow::on_actionReset_settings_triggered()
|
|||||||
QMessageBox::Ok | QMessageBox::Cancel);
|
QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
if (ret == QMessageBox::Ok)
|
if (ret == QMessageBox::Ok)
|
||||||
{
|
{
|
||||||
// Save options in settings
|
Config()->resetAll();
|
||||||
QSettings settings;
|
|
||||||
settings.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ Configuration* Configuration::mPtr = nullptr;
|
|||||||
Configuration::Configuration() : QObject()
|
Configuration::Configuration() : QObject()
|
||||||
{
|
{
|
||||||
mPtr = this;
|
mPtr = this;
|
||||||
loadDefaultTheme();
|
loadInitial();
|
||||||
}
|
}
|
||||||
|
|
||||||
Configuration* Configuration::instance()
|
Configuration* Configuration::instance()
|
||||||
@ -16,6 +16,18 @@ Configuration* Configuration::instance()
|
|||||||
return mPtr;
|
return mPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Configuration::loadInitial()
|
||||||
|
{
|
||||||
|
setDarkTheme(s.value("dark").toBool());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Configuration::resetAll()
|
||||||
|
{
|
||||||
|
s.clear();
|
||||||
|
loadInitial();
|
||||||
|
emit fontsUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
void Configuration::loadDefaultTheme()
|
void Configuration::loadDefaultTheme()
|
||||||
{
|
{
|
||||||
QColor color0 = QColor(0, 0, 0);
|
QColor color0 = QColor(0, 0, 0);
|
||||||
|
@ -15,6 +15,8 @@ private:
|
|||||||
QSettings s;
|
QSettings s;
|
||||||
static Configuration* mPtr;
|
static Configuration* mPtr;
|
||||||
|
|
||||||
|
void loadInitial();
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
void loadDefaultTheme();
|
void loadDefaultTheme();
|
||||||
void loadDarkTheme();
|
void loadDarkTheme();
|
||||||
@ -25,6 +27,8 @@ public:
|
|||||||
Configuration();
|
Configuration();
|
||||||
static Configuration* instance();
|
static Configuration* instance();
|
||||||
|
|
||||||
|
void resetAll();
|
||||||
|
|
||||||
// Fonts
|
// Fonts
|
||||||
const QFont getFont() const;
|
const QFont getFont() const;
|
||||||
void setFont(const QFont &font);
|
void setFont(const QFont &font);
|
||||||
|
Loading…
Reference in New Issue
Block a user