diff options
| author | Luke Yelavich <luke.yelavich@canonical.com> | 2015-06-27 04:44:51 +0000 |
|---|---|---|
| committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-06-27 04:44:51 +0000 |
| commit | 638dfd160ad3df5b88db647c6697744c82e82278 (patch) | |
| tree | fb8ee8b5311897d2ebb1ee5a2b926eae3850c4ce /dash | |
| parent | 5061c303e63e67bd86172861c156db5c5dc0d976 (diff) | |
| parent | d5bb4941f70ae6f0f073df1dac2acbf0a7b71f07 (diff) | |
Implement filter results controls accessibility Fixes: #1457071
Approved by: PS Jenkins bot, Marco Trevisan (TreviƱo) (bzr r3982)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/FilterBasicButton.cpp | 5 | ||||
| -rw-r--r-- | dash/FilterBasicButton.h | 2 | ||||
| -rw-r--r-- | dash/FilterExpanderLabel.cpp | 37 | ||||
| -rw-r--r-- | dash/FilterExpanderLabel.h | 5 |
4 files changed, 13 insertions, 36 deletions
diff --git a/dash/FilterBasicButton.cpp b/dash/FilterBasicButton.cpp index d66980663..727be89dc 100644 --- a/dash/FilterBasicButton.cpp +++ b/dash/FilterBasicButton.cpp @@ -188,5 +188,10 @@ void FilterBasicButton::Draw(nux::GraphicsEngine& graphics_engine, bool force_dr graphics_engine.PopClippingRectangle(); } +std::string const& FilterBasicButton::GetLabel() const +{ + return label_; +} + } // namespace dash } // namespace unity diff --git a/dash/FilterBasicButton.h b/dash/FilterBasicButton.h index bb5d79cb9..d3ee5418c 100644 --- a/dash/FilterBasicButton.h +++ b/dash/FilterBasicButton.h @@ -42,6 +42,8 @@ public: nux::Property<double> scale; + std::string const& GetLabel() const; + protected: virtual long ComputeContentSize(); virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff --git a/dash/FilterExpanderLabel.cpp b/dash/FilterExpanderLabel.cpp index da683c054..b6dd20b86 100644 --- a/dash/FilterExpanderLabel.cpp +++ b/dash/FilterExpanderLabel.cpp @@ -40,40 +40,6 @@ const RawPixel ARROW_BOTTOM_PADDING = 9_em; // font const char* const FONT_EXPANDER_LABEL = "Ubuntu 13"; // 17px = 13 -class ExpanderView : public nux::View -{ -public: - ExpanderView(NUX_FILE_LINE_DECL) - : nux::View(NUX_FILE_LINE_PARAM) - { - SetAcceptKeyNavFocusOnMouseDown(false); - SetAcceptKeyNavFocusOnMouseEnter(true); - } - -protected: - void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw) - {}; - - void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) - { - if (GetLayout()) - GetLayout()->ProcessDraw(graphics_engine, force_draw); - } - - bool AcceptKeyNavFocus() - { - return true; - } - - nux::Area* FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) - { - if (event_type != nux::EVENT_MOUSE_WHEEL && TestMousePointerInclusion(mouse_position, event_type)) - return this; - else - return nullptr; - } -}; - } NUX_IMPLEMENT_OBJECT_TYPE(FilterExpanderLabel); @@ -97,6 +63,7 @@ FilterExpanderLabel::FilterExpanderLabel(std::string const& label, NUX_FILE_LINE void FilterExpanderLabel::SetLabel(std::string const& label) { cairo_label_->SetText(label); + expander_view_->label = label; } void FilterExpanderLabel::UpdateScale(double scale) @@ -139,6 +106,8 @@ void FilterExpanderLabel::BuildLayout() expander_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION); expander_view_ = new ExpanderView(NUX_TRACKER_LOCATION); + expander_view_->expanded = expanded(); + expanded.changed.connect([this] (bool expanded) { expander_view_->expanded = expanded; }); expander_view_->SetLayout(expander_layout_); top_bar_layout_->AddView(expander_view_, 1); diff --git a/dash/FilterExpanderLabel.h b/dash/FilterExpanderLabel.h index f107d6803..52f672788 100644 --- a/dash/FilterExpanderLabel.h +++ b/dash/FilterExpanderLabel.h @@ -35,6 +35,7 @@ #include "unity-shared/IconTexture.h" #include "unity-shared/Introspectable.h" #include "unity-shared/StaticCairoText.h" +#include "unity-shared/ExpanderView.h" namespace nux { @@ -62,7 +63,7 @@ public: virtual void SetFilter(Filter::Ptr const& filter) = 0; virtual std::string GetFilterType() = 0; - nux::View* expander_view() const { return expander_view_; } + ExpanderView* expander_view() const { return expander_view_; } nux::Property<double> scale; nux::Property<bool> expanded; @@ -87,7 +88,7 @@ private: nux::VLayout* layout_; nux::LinearLayout* top_bar_layout_; - nux::View* expander_view_; + ExpanderView* expander_view_; nux::LinearLayout* expander_layout_; nux::View* right_hand_contents_; StaticCairoText* cairo_label_; |
