ui: color schemes

Put all colors into single xml file. Accessing colors is handled via the singleton class ColorScheme. The default scheme
"bright.xml" holds the original colors. The scheme "dark.xml" is a start, but still a poor alternative. Color schemes
can be switched via the View menu.
This commit is contained in:
Eberhard Graether
2015-07-17 19:50:39 +02:00
parent fb170cbd5d
commit 5722b4dc23
42 changed files with 979 additions and 309 deletions
@@ -88,6 +88,15 @@ void FeatureController::handleMessage(MessageSearch* message)
m.dispatchImmediately();
}
void FeatureController::handleMessage(MessageSwitchColorScheme* message)
{
ApplicationSettings* settings = ApplicationSettings::getInstance().get();
settings->setColorSchemePath(message->colorSchemeFilePath);
settings->save();
MessageRefresh(true).dispatch();
}
void FeatureController::handleMessage(MessageZoom* message)
{
ApplicationSettings* settings = ApplicationSettings::getInstance().get();
@@ -7,6 +7,7 @@
#include "utility/messaging/type/MessageActivateNode.h"
#include "utility/messaging/type/MessageActivateTokenLocation.h"
#include "utility/messaging/type/MessageSearch.h"
#include "utility/messaging/type/MessageSwitchColorScheme.h"
#include "utility/messaging/type/MessageZoom.h"
#include "component/controller/Controller.h"
@@ -20,6 +21,7 @@ class FeatureController
, public MessageListener<MessageActivateNode>
, public MessageListener<MessageActivateTokenLocation>
, public MessageListener<MessageSearch>
, public MessageListener<MessageSwitchColorScheme>
, public MessageListener<MessageZoom>
{
public:
@@ -32,6 +34,7 @@ private:
virtual void handleMessage(MessageActivateNode* message);
virtual void handleMessage(MessageActivateTokenLocation* message);
virtual void handleMessage(MessageSearch* message);
virtual void handleMessage(MessageSwitchColorScheme* message);
virtual void handleMessage(MessageZoom* message);
StorageAccess* m_storageAccess;
@@ -213,10 +213,13 @@ void UndoRedoController::processNormalCommand(const Command& command)
void UndoRedoController::processRedoCommand(const Command& command)
{
m_undo.push_back(m_lastCommand);
m_lastCommand = command;
if (m_lastCommand.message)
{
m_undo.push_back(m_lastCommand);
getView()->setUndoButtonEnabled(true);
}
getView()->setUndoButtonEnabled(true);
m_lastCommand = command;
if (m_redo.empty())
{
@@ -226,10 +229,13 @@ void UndoRedoController::processRedoCommand(const Command& command)
void UndoRedoController::processUndoCommand(const Command& command)
{
m_redo.push_back(m_lastCommand);
m_lastCommand = command;
if (m_lastCommand.message)
{
m_redo.push_back(m_lastCommand);
getView()->setRedoButtonEnabled(true);
}
getView()->setRedoButtonEnabled(true);
m_lastCommand = command;
if (m_undo.empty())
{