diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-19 22:43:30 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-19 22:43:30 +0200 |
| commit | c1d2e48cba6e3624f7c825a17e5300e33f7f4b36 (patch) | |
| tree | a5bde6f36b93c96f0b87e2f54cadf520bc3bdf39 /dash | |
| parent | 3773733eca397e3bce7e787f2e5212ad3c224ccb (diff) | |
| parent | e27940b0e2fdaf8f9bc0358baa36a2ea56fa1160 (diff) | |
Merging with trunk
(bzr r3506.6.8)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/DashController.cpp | 24 | ||||
| -rw-r--r-- | dash/DashController.h | 3 |
2 files changed, 11 insertions, 16 deletions
diff --git a/dash/DashController.cpp b/dash/DashController.cpp index 4bcc98afa..ca36a8017 100644 --- a/dash/DashController.cpp +++ b/dash/DashController.cpp @@ -25,6 +25,7 @@ #include "UnityCore/GSettingsScopes.h" #include "ApplicationStarterImp.h" +#include "unity-shared/AnimationUtils.h" #include "unity-shared/DashStyle.h" #include "unity-shared/PanelStyle.h" #include "unity-shared/UBusMessages.h" @@ -67,7 +68,6 @@ Controller::Controller(Controller::WindowCreator const& create_window) , monitor_(0) , visible_(false) , need_show_(false) - , view_(nullptr) , ensure_timeout_(PRELOAD_TIMEOUT_LENGTH) , timeline_animator_(90) { @@ -142,10 +142,10 @@ void Controller::SetupWindow() void Controller::SetupDashView() { view_ = new DashView(std::make_shared<GSettingsScopes>(), std::make_shared<ApplicationStarterImp>()); - AddChild(view_); + AddChild(view_.GetPointer()); nux::HLayout* layout = new nux::HLayout(NUX_TRACKER_LOCATION); - layout->AddView(view_, 1); + layout->AddView(view_.GetPointer(), 1); layout->SetContentDistribution(nux::MAJOR_POSITION_START); layout->SetVerticalExternalMargin(0); layout->SetHorizontalExternalMargin(0); @@ -378,18 +378,7 @@ void Controller::HideDash(bool restore) void Controller::StartShowHideTimeline() { EnsureDash(); - - if (timeline_animator_.CurrentState() == nux::animation::Animation::State::Running) - { - timeline_animator_.Reverse(); - } - else - { - if (visible_) - timeline_animator_.SetStartValue(0.0f).SetFinishValue(1.0f).Start(); - else - timeline_animator_.SetStartValue(1.0f).SetFinishValue(0.0f).Start(); - } + animation::StartOrReverseIf(timeline_animator_, visible_); } void Controller::OnViewShowHideFrame(double opacity) @@ -477,6 +466,11 @@ nux::Geometry Controller::GetInputWindowGeometry() return geo; } +nux::ObjectPtr<DashView> const& Controller::Dash() const +{ + return view_; +} + } } diff --git a/dash/DashController.h b/dash/DashController.h index 4555caaf4..8a57c93c0 100644 --- a/dash/DashController.h +++ b/dash/DashController.h @@ -68,6 +68,7 @@ public: bool IsVisible() const; bool IsCommandLensOpen() const; nux::Geometry GetInputWindowGeometry(); + nux::ObjectPtr<DashView> const& Dash() const; protected: std::string GetName() const; @@ -99,11 +100,11 @@ private: private: WindowCreator create_window_; nux::ObjectPtr<ResizingBaseWindow> window_; + nux::ObjectPtr<DashView> view_; int monitor_; bool visible_; bool need_show_; - DashView* view_; connection::Wrapper screen_ungrabbed_slot_; glib::DBusServer dbus_server_; |
