From ada86a00d73f60511f1b6035a62e495d00caba5c Mon Sep 17 00:00:00 2001 From: Brandon Schaefer Date: Wed, 17 Jul 2013 14:54:34 -0700 Subject: * Move logic from SwitcherController -> SwitcherView * Mouse will only change the selected icon when it hits a different icon then it hit last. - This means if you hightlight icon 0, then use the keyboard to move the selection over, the mouse will not steal selection until it hits a new icon. * Added AP tests for normal icon mouse movement (bzr r3426.1.3) --- unity-shared/AbstractIconRenderer.h | 16 +++++++++++++++- unity-shared/LayoutSystem.cpp | 10 ++++++++++ unity-shared/LayoutSystem.h | 9 ++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) (limited to 'unity-shared') diff --git a/unity-shared/AbstractIconRenderer.h b/unity-shared/AbstractIconRenderer.h index abb9def0b..6bb7065c8 100644 --- a/unity-shared/AbstractIconRenderer.h +++ b/unity-shared/AbstractIconRenderer.h @@ -22,8 +22,11 @@ #include +#include "Introspectable.h" #include "IconTextureSource.h" +#include + namespace unity { namespace ui @@ -35,7 +38,7 @@ enum PipRenderStyle OVER_TILE, }; -class RenderArg +class RenderArg : public debug::Introspectable { public: RenderArg() @@ -91,6 +94,17 @@ public: bool colorify_background; int window_indicators; char shortcut_label; + +protected: + // Introspectable methods + std::string GetName() const { return "RenderArgs"; } + void AddProperties(GVariantBuilder* builder) + { + unity::variant::BuilderWrapper(builder) + .add("logical_center_x", logical_center.x) + .add("logical_center_y", logical_center.y) + .add("logical_center_z", logical_center.z); + } }; class AbstractIconRenderer diff --git a/unity-shared/LayoutSystem.cpp b/unity-shared/LayoutSystem.cpp index 611759250..7a15984bb 100644 --- a/unity-shared/LayoutSystem.cpp +++ b/unity-shared/LayoutSystem.cpp @@ -290,5 +290,15 @@ LayoutWindow::LayoutWindow(Window xid) } } +// Introspectable methods +std::string LayoutWindow::GetName() const +{ + return "LayoutSystem"; +} + +void LayoutWindow::AddProperties(GVariantBuilder* builder) +{ +} + } } diff --git a/unity-shared/LayoutSystem.h b/unity-shared/LayoutSystem.h index 68598b3d2..c10ba77d9 100644 --- a/unity-shared/LayoutSystem.h +++ b/unity-shared/LayoutSystem.h @@ -24,13 +24,15 @@ #include #include +#include "unity-shared/Introspectable.h" #include "unity-shared/WindowManager.h" namespace unity { namespace ui { -struct LayoutWindow +class LayoutWindow //: public debug::Introspectable//: public ui::UnityWindowView { +public: typedef std::shared_ptr Ptr; typedef std::vector Vector; @@ -45,6 +47,11 @@ struct LayoutWindow bool selected; float aspect_ratio; float alpha; + +protected: + // Introspectable methods + std::string GetName() const; + void AddProperties(GVariantBuilder* builder); }; class LayoutSystem -- cgit v1.2.3