ui: Fixed content disappears when switching color scheme in preferences
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml
|
||||
Token.cpp ERROR: Location Id was not referenced by this Token.
|
||||
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
|
||||
Edge.cpp ERROR: Nodes are not plain copies.
|
||||
|
||||
@@ -302,8 +302,8 @@ void Application::handleMessage(MessageLoadProject* message)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Failed to load project. Try restarting Coati as admin");
|
||||
MessageStatus("Failed to load project. Try restarting Coati as admin", true).dispatch();
|
||||
LOG_ERROR_STREAM(<< "Failed to load project.");
|
||||
MessageStatus("Failed to load project.", true).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,10 @@ void Application::handleMessage(MessageRefresh* message)
|
||||
{
|
||||
TRACE("app refresh");
|
||||
|
||||
loadSettings();
|
||||
if (message->reloadSettings)
|
||||
{
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
if (message->uiOnly)
|
||||
{
|
||||
@@ -331,7 +334,7 @@ void Application::handleMessage(MessageRefresh* message)
|
||||
void Application::handleMessage(MessageSwitchColorScheme* message)
|
||||
{
|
||||
loadStyle(message->colorSchemePath);
|
||||
m_componentManager->refreshViews();
|
||||
MessageRefresh().refreshUiOnly().keepSettings().dispatch();
|
||||
}
|
||||
|
||||
void Application::startMessagingAndScheduling()
|
||||
|
||||
@@ -9,6 +9,7 @@ public:
|
||||
MessageRefresh()
|
||||
: uiOnly(false)
|
||||
, all(false)
|
||||
, reloadSettings(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,6 +30,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
MessageRefresh& keepSettings()
|
||||
{
|
||||
reloadSettings = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual void print(std::ostream& os) const
|
||||
{
|
||||
if (uiOnly)
|
||||
@@ -43,6 +50,7 @@ public:
|
||||
|
||||
bool uiOnly;
|
||||
bool all;
|
||||
bool reloadSettings;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_REFRESH_H
|
||||
|
||||
Reference in New Issue
Block a user