+ reset built-in scheme when setting global style sheet
This commit is contained in:
parent
997001bbd9
commit
7b37841fdc
|
@ -36,6 +36,8 @@
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "PrefWidgets.h"
|
#include "PrefWidgets.h"
|
||||||
#include "Language/Translator.h"
|
#include "Language/Translator.h"
|
||||||
|
#include "Control.h"
|
||||||
|
#include "TaskView/TaskView.h"
|
||||||
|
|
||||||
using namespace Gui::Dialog;
|
using namespace Gui::Dialog;
|
||||||
|
|
||||||
|
@ -162,6 +164,10 @@ void DlgGeneralImp::saveSettings()
|
||||||
mdi->setBackground(QBrush(Qt::NoBrush));
|
mdi->setBackground(QBrush(Qt::NoBrush));
|
||||||
QTextStream str(&f);
|
QTextStream str(&f);
|
||||||
qApp->setStyleSheet(str.readAll());
|
qApp->setStyleSheet(str.readAll());
|
||||||
|
|
||||||
|
Gui::TaskView::TaskView* taskPanel = Control().taskPanel();
|
||||||
|
if (taskPanel)
|
||||||
|
taskPanel->clearActionStyle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,10 +175,16 @@ void DlgGeneralImp::saveSettings()
|
||||||
if (sheet.toString().isEmpty()) {
|
if (sheet.toString().isEmpty()) {
|
||||||
if (this->tiledBackground->isChecked()) {
|
if (this->tiledBackground->isChecked()) {
|
||||||
qApp->setStyleSheet(QString());
|
qApp->setStyleSheet(QString());
|
||||||
|
Gui::TaskView::TaskView* taskPanel = Control().taskPanel();
|
||||||
|
if (taskPanel)
|
||||||
|
taskPanel->restoreActionStyle();
|
||||||
mdi->setBackground(QPixmap(QLatin1String(":/icons/background.png")));
|
mdi->setBackground(QPixmap(QLatin1String(":/icons/background.png")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qApp->setStyleSheet(QString());
|
qApp->setStyleSheet(QString());
|
||||||
|
Gui::TaskView::TaskView* taskPanel = Control().taskPanel();
|
||||||
|
if (taskPanel)
|
||||||
|
taskPanel->restoreActionStyle();
|
||||||
mdi->setBackground(QBrush(QColor(160,160,160)));
|
mdi->setBackground(QBrush(QColor(160,160,160)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -619,5 +619,21 @@ void TaskView::clicked (QAbstractButton * button)
|
||||||
ActiveDialog->clicked(id);
|
ActiveDialog->clicked(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TaskView::clearActionStyle()
|
||||||
|
{
|
||||||
|
#if defined (QSINT_ACTIONPANEL)
|
||||||
|
static_cast<QSint::FreeCADPanelScheme*>(QSint::FreeCADPanelScheme::defaultScheme())->clearActionStyle();
|
||||||
|
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskView::restoreActionStyle()
|
||||||
|
{
|
||||||
|
#if defined (QSINT_ACTIONPANEL)
|
||||||
|
static_cast<QSint::FreeCADPanelScheme*>(QSint::FreeCADPanelScheme::defaultScheme())->restoreActionStyle();
|
||||||
|
taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "moc_TaskView.cpp"
|
#include "moc_TaskView.cpp"
|
||||||
|
|
|
@ -173,6 +173,9 @@ public:
|
||||||
void addTaskWatcher(const std::vector<TaskWatcher*> &Watcher);
|
void addTaskWatcher(const std::vector<TaskWatcher*> &Watcher);
|
||||||
void clearTaskWatcher(void);
|
void clearTaskWatcher(void);
|
||||||
|
|
||||||
|
void clearActionStyle();
|
||||||
|
void restoreActionStyle();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void accept();
|
void accept();
|
||||||
void reject();
|
void reject();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user