ui: Added scroll speed setting to preferences

This commit is contained in:
Eberhard Graether
2016-08-18 12:12:19 +02:00
parent 3d40f4ed4e
commit c269493942
20 changed files with 206 additions and 27 deletions
+2
View File
@@ -5,6 +5,7 @@
#include "utility/messaging/MessageQueue.h"
#include "utility/messaging/type/MessageActivateNodes.h"
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
#include "utility/messaging/type/MessageScrollSpeedChange.h"
#include "utility/messaging/type/MessageStatus.h"
#include "utility/messaging/type/MessageShowStartScreen.h"
#include "utility/scheduling/TaskScheduler.h"
@@ -72,6 +73,7 @@ void Application::loadSettings()
{
std::shared_ptr<ApplicationSettings> settings = ApplicationSettings::getInstance();
settings->load(FilePath(UserPaths::getAppSettingsPath()));
loadStyle(settings->getColorSchemePath());
}
+10
View File
@@ -113,6 +113,16 @@ int ApplicationSettings::getWindowBaseHeight() const
return getValue<int>("application/window_base_height", 500);
}
float ApplicationSettings::getScrollSpeed() const
{
return getValue<float>("application/scroll_speed", 1.0f);
}
void ApplicationSettings::setScrollSpeed(float scrollSpeed)
{
setValue<float>("application/scroll_speed", scrollSpeed);
}
int ApplicationSettings::getIndexerThreadCount() const
{
return getValue<int>("indexing/indexer_thread_count", 4);
+4
View File
@@ -39,6 +39,10 @@ public:
int getWindowBaseWidth() const;
int getWindowBaseHeight() const;
float getScrollSpeed() const;
void setScrollSpeed(float scrollSpeed);
// indexing
int getIndexerThreadCount() const;
void setIndexerThreadCount(const int count);
@@ -0,0 +1,28 @@
#ifndef MESSAGE_SCROLL_SPEED_CHANGE_H
#define MESSAGE_SCROLL_SPEED_CHANGE_H
#include "utility/messaging/Message.h"
class MessageScrollSpeedChange
: public Message<MessageScrollSpeedChange>
{
public:
MessageScrollSpeedChange(float scrollSpeed)
: scrollSpeed(scrollSpeed)
{
}
static const std::string getStaticType()
{
return "MessageScrollSpeedChange";
}
virtual void print(std::ostream& os) const
{
os << scrollSpeed;
}
const float scrollSpeed;
};
#endif // MESSAGE_SCROLL_SPEED_CHANGE_H