summaryrefslogtreecommitdiff
diff options
authorManuel de la Pena <manuel@canonical.com>2013-04-02 14:37:59 +0200
committerManuel de la Pena <manuel@canonical.com>2013-04-02 14:37:59 +0200
commitca00ec3d58f534da655c2def7aba334d138916b0 (patch)
tree87ccc27915d527c8c3dcf5c03ef4cafcda03230c
parentdc31597fa2a33dc20e3b740a711524da67d2bf7e (diff)
Improve transition for payment previews.
(bzr r3263.2.7)
-rw-r--r--dash/DashView.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp
index fef7c2286..854428e0b 100644
--- a/dash/DashView.cpp
+++ b/dash/DashView.cpp
@@ -30,6 +30,7 @@
#include <NuxCore/Logger.h>
#include <UnityCore/GLibWrapper.h>
#include <UnityCore/RadioOptionFilter.h>
+#include <UnityCore/PaymentPreview.h>
#include "unity-shared/DashStyle.h"
#include "unity-shared/KeyboardUtil.h"
@@ -1255,7 +1256,15 @@ void DashView::OnLensAdded(Lens::Ptr& lens)
// Hook up to the new preview infrastructure
lens->preview_ready.connect([&] (std::string const& uri, Preview::Ptr model)
{
- LOG_DEBUG(logger) << "Got preview for: " << uri;
+ // HACK: Atm we don't support well the fact that a preview can be sent from
+ // an ActionResponse and therefore transition does not work, this hack allows
+ // to set the navigation mode to ensure that we have a nice transition
+ if (dynamic_cast<PaymentPreview*>(model.get()) != NULL)
+ {
+ preview_state_machine_.left_results.Set(0);
+ preview_state_machine_.right_results.Set(0);
+ preview_navigation_mode_ = previews::Navigation::RIGHT;
+ }
preview_state_machine_.ActivatePreview(model); // this does not immediately display a preview - we now wait.
});
}