summaryrefslogtreecommitdiff
path: root/dash
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-07-04 18:53:41 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-07-04 18:53:41 +0200
commitaf3448ea158c06f3674ebd5ac1afd9d3ebd6eeba (patch)
treef0ca4a48fc6c60b726f9be199e517b6931681fbc /dash
parent9b34e136a5ae1094ef0b89477b757a1a042a7b65 (diff)
DashView: disable preview animation on low_gfx
(bzr r4132.6.11)
Diffstat (limited to 'dash')
-rw-r--r--dash/DashView.cpp24
-rw-r--r--dash/StandaloneDash.cpp2
2 files changed, 15 insertions, 11 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp
index d1aa1f512..922936c36 100644
--- a/dash/DashView.cpp
+++ b/dash/DashView.cpp
@@ -313,13 +313,15 @@ void DashView::StartPreviewAnimation()
preview_animation_.reset();
preview_container_animation_.reset();
+ double anim_length = Settings::Instance().low_gfx() ? 0 : PREVIEW_ANIMATION_LENGTH;
+
// Dash Split Open Animation
split_animation_.reset(new na::AnimateValue<float>());
- split_animation_->SetDuration((1.0f - animate_split_value_) * PREVIEW_ANIMATION_LENGTH);
+ split_animation_->SetDuration((1.0f - animate_split_value_) * anim_length);
split_animation_->SetStartValue(animate_split_value_);
split_animation_->SetFinishValue(1.0f);
split_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- split_animation_->updated.connect([this](float const& linear_split_animate_value)
+ split_animation_->updated.connect([this, anim_length](float const& linear_split_animate_value)
{
static na::EasingCurve split_animation_curve(na::EasingCurve::Type::InQuad);
@@ -331,11 +333,11 @@ void DashView::StartPreviewAnimation()
{
// Preview Container Close Animation
preview_container_animation_.reset(new na::AnimateValue<float>());
- preview_container_animation_->SetDuration((1.0f - animate_preview_container_value_) * PREVIEW_ANIMATION_LENGTH);
+ preview_container_animation_->SetDuration((1.0f - animate_preview_container_value_) * anim_length);
preview_container_animation_->SetStartValue(animate_preview_container_value_);
preview_container_animation_->SetFinishValue(1.0f);
preview_container_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- preview_container_animation_->updated.connect([this](float const& linear_preview_container_animate_value)
+ preview_container_animation_->updated.connect([this, anim_length](float const& linear_preview_container_animate_value)
{
static na::EasingCurve preview_container_animation_curve(na::EasingCurve::Type::InQuad);
@@ -347,7 +349,7 @@ void DashView::StartPreviewAnimation()
{
// Preview Close Animation
preview_animation_.reset(new na::AnimateValue<float>());
- preview_animation_->SetDuration((1.0f - animate_preview_value_) * PREVIEW_ANIMATION_LENGTH);
+ preview_animation_->SetDuration((1.0f - animate_preview_value_) * anim_length);
preview_animation_->SetStartValue(animate_preview_value_);
preview_animation_->SetFinishValue(1.0f);
preview_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
@@ -382,13 +384,15 @@ void DashView::EndPreviewAnimation()
split_animation_.reset();
preview_container_animation_.reset();
+ double anim_length = Settings::Instance().low_gfx() ? 0 : PREVIEW_ANIMATION_LENGTH;
+
// Preview Close Animation
preview_animation_.reset(new na::AnimateValue<float>());
- preview_animation_->SetDuration(animate_preview_value_ * PREVIEW_ANIMATION_LENGTH);
+ preview_animation_->SetDuration(animate_preview_value_ * anim_length);
preview_animation_->SetStartValue(1.0f - animate_preview_value_);
preview_animation_->SetFinishValue(1.0f);
preview_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- preview_animation_->updated.connect([this](float const& preview_value)
+ preview_animation_->updated.connect([this, anim_length](float const& preview_value)
{
animate_preview_value_ = 1.0f - preview_value;
QueueDraw();
@@ -398,11 +402,11 @@ void DashView::EndPreviewAnimation()
{
// Preview Container Close Animation
preview_container_animation_.reset(new na::AnimateValue<float>());
- preview_container_animation_->SetDuration(animate_preview_container_value_ * PREVIEW_ANIMATION_LENGTH);
+ preview_container_animation_->SetDuration(animate_preview_container_value_ * anim_length);
preview_container_animation_->SetStartValue(1.0f - animate_preview_container_value_);
preview_container_animation_->SetFinishValue(1.0f);
preview_container_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- preview_container_animation_->updated.connect([this](float const& linear_preview_container_animate_value)
+ preview_container_animation_->updated.connect([this, anim_length](float const& linear_preview_container_animate_value)
{
static na::EasingCurve preview_container_animation_curve(na::EasingCurve::Type::InQuad);
@@ -413,7 +417,7 @@ void DashView::EndPreviewAnimation()
{
// Dash Split Close Animation
split_animation_.reset(new na::AnimateValue<float>());
- split_animation_->SetDuration(animate_split_value_ * PREVIEW_ANIMATION_LENGTH);
+ split_animation_->SetDuration(animate_split_value_ * anim_length);
split_animation_->SetStartValue(1.0f - animate_split_value_);
split_animation_->SetFinishValue(1.0f);
split_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
diff --git a/dash/StandaloneDash.cpp b/dash/StandaloneDash.cpp
index 4f0a03d76..e869aced4 100644
--- a/dash/StandaloneDash.cpp
+++ b/dash/StandaloneDash.cpp
@@ -93,6 +93,7 @@ int main(int argc, char **argv)
{
gtk_init (&argc, &argv);
+ unity::Settings settings;
unity::BGHash bghash;
unity::FontSettings font_settings;
@@ -100,7 +101,6 @@ int main(int argc, char **argv)
nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
// The instances for the pseudo-singletons.
unity::ThumbnailGenerator thumb_generator;
- unity::Settings settings;
unity::dash::Style dash_style;
unity::panel::Style panel_style;