mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 22:05: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);
|
||||
QByteArray state = settings.value("state", QByteArray()).toByteArray();
|
||||
restoreState(state);
|
||||
if (settings.value("dark").toBool())
|
||||
{
|
||||
this->setDarkTheme();
|
||||
}
|
||||
this->responsive = settings.value("responsive").toBool();
|
||||
}
|
||||
|
||||
@ -868,9 +864,7 @@ void MainWindow::on_actionReset_settings_triggered()
|
||||
QMessageBox::Ok | QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Ok)
|
||||
{
|
||||
// Save options in settings
|
||||
QSettings settings;
|
||||
settings.clear();
|
||||
Config()->resetAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ Configuration* Configuration::mPtr = nullptr;
|
||||
Configuration::Configuration() : QObject()
|
||||
{
|
||||
mPtr = this;
|
||||
loadDefaultTheme();
|
||||
loadInitial();
|
||||
}
|
||||
|
||||
Configuration* Configuration::instance()
|
||||
@ -16,6 +16,18 @@ Configuration* Configuration::instance()
|
||||
return mPtr;
|
||||
}
|
||||
|
||||
void Configuration::loadInitial()
|
||||
{
|
||||
setDarkTheme(s.value("dark").toBool());
|
||||
}
|
||||
|
||||
void Configuration::resetAll()
|
||||
{
|
||||
s.clear();
|
||||
loadInitial();
|
||||
emit fontsUpdated();
|
||||
}
|
||||
|
||||
void Configuration::loadDefaultTheme()
|
||||
{
|
||||
QColor color0 = QColor(0, 0, 0);
|
||||
|
@ -15,6 +15,8 @@ private:
|
||||
QSettings s;
|
||||
static Configuration* mPtr;
|
||||
|
||||
void loadInitial();
|
||||
|
||||
// Colors
|
||||
void loadDefaultTheme();
|
||||
void loadDarkTheme();
|
||||
@ -25,6 +27,8 @@ public:
|
||||
Configuration();
|
||||
static Configuration* instance();
|
||||
|
||||
void resetAll();
|
||||
|
||||
// Fonts
|
||||
const QFont getFont() const;
|
||||
void setFont(const QFont &font);
|
||||
|
Loading…
Reference in New Issue
Block a user