+ event to restore/clear action style scheme

This commit is contained in:
wmayer
2015-07-09 23:08:10 +02:00
parent 9f9df364fd
commit d126506fca
4 changed files with 58 additions and 14 deletions

View File

@@ -36,8 +36,6 @@
#include "MainWindow.h"
#include "PrefWidgets.h"
#include "Language/Translator.h"
#include "Control.h"
#include "TaskView/TaskView.h"
using namespace Gui::Dialog;
@@ -165,9 +163,8 @@ void DlgGeneralImp::saveSettings()
QTextStream str(&f);
qApp->setStyleSheet(str.readAll());
Gui::TaskView::TaskView* taskPanel = Control().taskPanel();
if (taskPanel)
taskPanel->clearActionStyle();
ActionStyleEvent e(ActionStyleEvent::Clear);
qApp->sendEvent(getMainWindow(), &e);
}
}
}
@@ -175,16 +172,14 @@ void DlgGeneralImp::saveSettings()
if (sheet.toString().isEmpty()) {
if (this->tiledBackground->isChecked()) {
qApp->setStyleSheet(QString());
Gui::TaskView::TaskView* taskPanel = Control().taskPanel();
if (taskPanel)
taskPanel->restoreActionStyle();
ActionStyleEvent e(ActionStyleEvent::Restore);
qApp->sendEvent(getMainWindow(), &e);
mdi->setBackground(QPixmap(QLatin1String(":/icons/background.png")));
}
else {
qApp->setStyleSheet(QString());
Gui::TaskView::TaskView* taskPanel = Control().taskPanel();
if (taskPanel)
taskPanel->restoreActionStyle();
ActionStyleEvent e(ActionStyleEvent::Restore);
qApp->sendEvent(getMainWindow(), &e);
mdi->setBackground(QBrush(QColor(160,160,160)));
}
}